Computer Science Canada Hangman Alternating Words HELP???? |
Author: | melteaax [ Sun Jun 07, 2015 6:13 pm ] | ||||||
Post subject: | Hangman Alternating Words HELP???? | ||||||
What is it you are trying to achieve? I am writing a Hangman game program and I've gotten the program to 'replace the - with the letter guessed if it's correct' but the only word my program is allowing the user to guess is marshmallows. However, marshmallows isn't the only word in the datafile I have opened in this program. Why isn't my program alternating between the words in the datafile each time the game is being played, like it should? What is the problem you are having? My program isn't alternating between the words in the datafile like it should for my Hangman game. Describe what you have tried to solve this problem I've tried to use strings but I don't really know what to do to solve this. Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Please specify what version of Turing you are using I'm not sure which version of Turing I'm using but I'm pretty sure it's not the latest one. |
Author: | melteaax [ Sun Jun 07, 2015 6:14 pm ] |
Post subject: | RE:Hangman Alternating Words HELP???? |
I forgot to say, I'm only a beginner in Turing |
Author: | Dreadnought [ Sun Jun 07, 2015 6:35 pm ] |
Post subject: | Re: Hangman Alternating Words HELP???? |
I'm guessing that marshmallows is the first word in your file. It might help to ask yourself the following: Where do you read the words from the file? How many words do you read? If the game is played again, will the word picked be different? You should at least be able to tell us why your program is doing what its doing. Afterwards we can start figuring out how to modify the behavior to suit your needs. |