TO INSTRUCTIONS
PR []
PR [Word Scramble...]
PR []
PR [From a list of 30 Logo words, the computer will pick one at]
PR [random and scramble it for you.  Your job is to unscramble it.]
PR []
PR [You don't have to guess the word on the first try.  The computer]
PR [ will tell you which letters you have in the right position by]
PR [printing an asterisk under the correct letter.  Any letter in the]
PR [wrong position will have a ? under it.  Once you know that a]
PR [letter is in the right spot, you can use that fact to make a]
PR [better guess.]
PR []
PR [If you get stuck, type GIVEUP and the computer will tell you]
PR [what the word is.]
PR []
PR [Good Luck!]
PR []
PR [Press any key to start...]
IGNORE RC
END

TO REMOVE :N :WORD
IF :N = 1 [OP BF :WORD]
OP WORD FIRST :WORD REMOVE :N - 1 BF :WORD
END

TO PICK :N :W
IF :N = 1 [OP FIRST :W]
OP PICK :N - 1 BF :WORD
END

TO PICKRANDOM :WORD
MAKE "X 1 + RANDOM LENGTH :WORD
OP PICK :X :WORD
END

TO LEN :L
IF :L = [] [OP 0]
OP 1 + LEN BF :L
END

TO LENGTH :WORD
IF :WORD = " [OP 0]
OP 1 + LENGTH BF :WORD
END

TO PICKLIST :N :L
IF :N = 1 [OP FIRST :L]
OP PICKLIST :N - 1 BF :L
END

TO COMPARE :GUESS :CORRECT
IF OR (:GUESS = " )(:CORRECT = ") [PR [] STOP]
IFELSE FIRST :GUESS = FIRST :CORRECT [PRINT "*][PRINT "?]
COMPARE BF :GUESS BF :CORRECT
END

TO SHOWS
PR []
PR SE [THE WORD WAS] :WORD
END

TO SCRAMBLE :WORD
IF :WORD = " [OP "]
OP WORD (PICKRANDOM :WORD)(SCRAMBLE REMOVE :X :WORD)
END

TO RANDOMPICK :L
OP PICKLIST (1 + RANDOM LEN :L) :L
END

TO ANOTHER?
PR []
PR [Do you want to try another word?]
MAKE "ANS FIRST READWORD
TEST FIRST FIRST :ANS = "Y
IFT [PLAY]
IFF [Bye for now...]
END

TO GET
PR []
PR [What's your guess?]
PR []
MAKE "GUESS READWORD
IF OR (:GUESS = "GIVEUP)(:GUESS = "GIVE) [SHOWS STOP]
COMPARE :GUESS :WORD
TEST :GUESS :WORD
TEST :GUESS = :WORD
IFT [PR [] PR RANDOMPICK :WIN.MESSAGES STOP]
IFF [GET]
END

TO THINK
PR [Thinking......]
MAKE "WORD RANDOMPICK :WORDS
MAKE "SCRAMBLED SCRAMBLE :WORD
PR []
PR [Ok...here is your scrambled word...]
PR :SCRAMBLED
END

TO PLAY
THINK
GET


