Computer Science Canada

Turing School Project - HELP - Hangman

Author:  bigbut600 [ Thu Nov 20, 2008 10:41 pm ]
Post subject:  Turing School Project - HELP - Hangman

Hey guys, I'm very new to programming with Turing. I need you help with a project I received from school. It's a basic hangman game, no graphics needed, where Player 1 would enter a word, and Player 2 would be given chances to guess a letter in that word. Player 2 get as many chances as there are letters in the word. And after the last guess, Player 2 is allowed to take one last guess at what the word is.

My first problem is that, after Player 1 enters a word, I need to represent that word with dashes (-) for Player 2. How can I represent a string with dashes, and how can I replace letters in the word into the dashes? I'd really appreciate your help!

eg.

Player 1 - Choose a word: ant

(clear screen)

---
Player 2 - The word has 3 letters. Choose a letter: e
e is not in the word.

---
Player 2 - The word has 3 letters. Choose a letter: a
You found a letter!

a--
Player 2 - Etc.. Choose aletter: n
You found a letter!

an-

You have used up all your guesses!

Players 2 - Take one last guess at the word. Type in a word: and
I'm sorry, the word was "ant".
Please play again.

Please help, if it's not too much trouble.
Thanks!

Author:  Tony [ Fri Nov 21, 2008 12:26 am ]
Post subject:  RE:Turing School Project - HELP - Hangman

Draw the word one letter at a time.

Turing:

put "fifth letter"(5)


Read about String Manipulation, you will find it very helpful.


: