Im in a computer science class this year and i really really need help on my project. I'm new to all of this script and sprite implementing. I'm assigned a project where i have to make a Evil hangman game, where when you guess a letter, it will go through a list and delete all those words with that given letter in it until you're left with one set of words that have that guessed letter in it. I'm really confused. The words i used in this project were 5 letter words only and 30 words total. I appreciate all the help i can get! Thanks!
Offline
So you're asking for a script where it goes through the list, checks to see is any of the words contains a specific letter, and if so, delete that word?
Just, how is that hangman? Shouldn't it be it has a random word, and then you guess a letter, and check through the word to see if it contains that letter? That's what I know hangman as.
Offline
Im told that the point of Evil hangman is to prevent the player from winning for as long as possible. When the player guesses the letter, it should go thru the list, deleting the word and say that you guessed the wrong letter. and it would keep doing that until the last word. That's what i have been told on my paper. im pretty much reading it off to you.
Offline
the code is actually cheating to make the game as hard as possible for the player: it doesn't actually settle on a word until the very end of the game, but tries to keep the player in the dark for as long as possible. Instead of picking a word at the very beginning a la regular hangman, it chooses a word but readily changes to a different word if the player starts guessing letters correctly.
Offline
repeat until <(length of [possible words v]) = (1)> ask [letter?] and wait repeat until <(length of (answer)) = (1)> //make sure they said a letter ask [letter?] and wait end set [list index v] to (length of [possible words v]) repeat until <(list index) = (0)> set [word index v] to (1) //check if the word contains the letter repeat until <<(letter (word index) of (item (list index) of [possible words v])) = (answer)> or <(word index) > (length of (item (list index) of [possible words v]))>> change [word index v] by (1) end if <(letter (word index) of (item (list index) of [possible words v])) = (answer)> delete (list index) of [possible words v] end change [list index v] by (-1) end end
Last edited by joefarebrother (2012-11-08 17:26:17)
Offline