This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-11-07 23:50:36

tman0665
New Scratcher
Registered: 2012-11-07
Posts: 6

Evil Hangman Project help!

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

 

#2 2012-11-07 23:53:43

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Evil Hangman Project help!

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

 

#3 2012-11-07 23:57:47

tman0665
New Scratcher
Registered: 2012-11-07
Posts: 6

Re: Evil Hangman Project help!

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

 

#4 2012-11-08 00:00:57

tman0665
New Scratcher
Registered: 2012-11-07
Posts: 6

Re: Evil Hangman Project help!

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

 

#5 2012-11-08 00:04:00

tman0665
New Scratcher
Registered: 2012-11-07
Posts: 6

Re: Evil Hangman Project help!

http://inst.eecs.berkeley.edu/~cs10/su12/hw/evil-hangman-flowchart.pdf

that flow chart should help

Offline

 

#6 2012-11-08 17:20:19

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: Evil Hangman Project help!

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)


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

Board footer