Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 "get" more than one word
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
[Gandalf]




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Sat Jan 15, 2005 11:23 pm   Post subject: (No subject)

use : *
Turing:

var myString : string
get myString : *
put myString
[Gandalf]




PostPosted: Sat Jan 15, 2005 11:33 pm   Post subject: (No 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?
Cervantes




PostPosted: Sat Jan 15, 2005 11:37 pm   Post subject: (No 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
Drakain Zeil




PostPosted: Sun Jan 16, 2005 5:34 pm   Post subject: (No 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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: