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

Username:   Password: 
 RegisterRegister   
 Need help with for structure (beginnger)
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
jadelinanne




PostPosted: Mon Jan 21, 2013 6:26 pm   Post subject: Need help with for structure (beginnger)

What is it you are trying to achieve?
Im making a hangman game and I need a for structure that will make dashes/lines for the number of letters in a word
i.e if the word was cat ; _ _ _

I have the words in an array and I have a randint that generates a random number which I assign to each word in the array



What is the problem you are having?
don't know how to make a for structure to make the lines/dashes for the length of multiple words

Describe what you have tried to solve this problem


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
.
Turing:


<Add your code here>



Please specify what version of Turing you are using
<Answer Here>
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Mon Jan 21, 2013 6:39 pm   Post subject: RE:Need help with for structure (beginnger)

You can use the method length(word) to get the number of characters in the given word.

For example, length("cat") is 3, length("hello") is 5, and length(word) will be the number of letters in the string represented by word.
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  [ 2 Posts ]
Jump to:   


Style:  
Search: