This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-06-12 18:21:44

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

before or after a letter

How do you make the computer find if a letter is before or after another letter?

Offline

 

#2 2011-06-12 18:48:15

777w
Scratcher
Registered: 2009-02-10
Posts: 1000+

Re: before or after a letter

ImagineIt wrote:

How do you make the computer find if a letter is before or after another letter?

Umm...IDK...I don't think you can.

Offline

 

#3 2011-06-12 19:00:08

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: before or after a letter

You can check down the word to find the first letter, then assign it's position to a number.  Then you check down the letters to find the second letter, assign it it's own number, take the difference, and if it's positive the letter is before, if it's negative it's after.

Wait, give me a second to write a script.

Here, this isn't instantaneous, but it works:
http://i51.tinypic.com/20ue5cn.gif

Last edited by Kileymeister (2011-06-12 19:08:40)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#4 2011-06-13 09:39:19

owetre18
Scratcher
Registered: 2009-07-01
Posts: 1000+

Re: before or after a letter

Kileymeister wrote:

You can check down the word to find the first letter, then assign it's position to a number.  Then you check down the letters to find the second letter, assign it it's own number, take the difference, and if it's positive the letter is before, if it's negative it's after.

Wait, give me a second to write a script.

Here, this isn't instantaneous, but it works:
http://i51.tinypic.com/20ue5cn.gif

Put that in BYOB, set it to atomic (turbo, in blocks) and let 'er rip!

Offline

 

#5 2011-06-13 13:27:52

wulfmaster
Scratcher
Registered: 2011-04-23
Posts: 500+

Re: before or after a letter

owetre18 wrote:

Kileymeister wrote:

You can check down the word to find the first letter, then assign it's position to a number.  Then you check down the letters to find the second letter, assign it it's own number, take the difference, and if it's positive the letter is before, if it's negative it's after.

Wait, give me a second to write a script.

Here, this isn't instantaneous, but it works:
=]http://i51.tinypic.com/20ue5cn.gif

Put that in BYOB, set it to atomic (turbo, in blocks) and let 'er rip!

You don't need to use BYOB for that ' wink


Social Connections - Bringing communities close together! http://cyberkidscountry.com/ip.php

Offline

 

Board footer