Computer Science Canada

"get" more than one word

Author:  [Gandalf] [ Sat Jan 15, 2005 11:18 pm ]
Post subject:  "get" more than one word

I'm sorry for the newb question, but I can't find any solution to my problem. How do you get more than one word? Whenever the user inputs more than one word, the line jumps lines, assuming that wach word is a new answer to each get. I am forced to use underscores, but that is sort of stupid, so is there a way to do this properly? Thanks in advance.

Author:  Cervantes [ Sat Jan 15, 2005 11:23 pm ]
Post subject: 

use : *
Turing:

var myString : string
get myString : *
put myString

Author:  [Gandalf] [ Sat Jan 15, 2005 11:33 pm ]
Post subject: 

Thanks a lot! I can't believe I didn't know that, I remember seeing it before - not know why someone put it there... Foolish me Smile

I have another question, and I don't really want to start a new topic for it...
How would I randomly generate letters? Like Rand.int or randint for integers, but for single characters? is it possible?

Author:  Cervantes [ Sat Jan 15, 2005 11:37 pm ]
Post subject: 

It sure is possible!
Turing:

for i : 1 .. maxrow * maxcol
    put chr (Rand.Int (97, 122)) ..
end for

Check out the Turing reference. Make sure you're on the contents tab, then expand Turing Language then select Keystroke Codes.
-Cervantes

Author:  Drakain Zeil [ Sun Jan 16, 2005 5:34 pm ]
Post subject: 

The number after the get : will tell you how many letters are accepted, for example...

get var : 2
Only accepts 2

get var :*
Accepts max (256)

get var
Uses "whitespace" for next get Input.


: