const VOWELS : string := "AEIOUaeiou"
const CONSONANTS : string := "BCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz"
var word : string
var mic : string := ""
var guessedLetters : string :=""
var count:int:=0
var ans:string
var guess1:string
var wrong:int:=0
put "player 1 please enter a word use uppercase letters"
get word
put " _ stands for a consonant"
put " = stands for a vowel "
put skip
for x:1..8
count := count + 1
for i : 1 .. length (word)
if index (guessedLetters, word (i)) not= 0 then
mic := mic + word (i)
elsif index (CONSONANTS, word (i)) not= 0 then
mic := mic + "-"
elsif index (VOWELS, word (i)) not= 0 then
mic := mic + "="
else
mic := mic + word (i)
end if
end for
put " the word to guess is ", mic
exit when mic = word
var guess : string
put "please enter your guess " ..
get guess
guessedLetters := guessedLetters + guess
mic := ""
if guess = mic then
put "Nice Job you got a letter"
else
put "sorry"
wrong:=wrong+1
if wrong=1 then
drawarc(350,150,20,20,0,360,3)
drawline (300,50,300,220,3)
drawline (300,220,350,220,3)
drawline (350,220,350,170,3)
elsif wrong=2 then
drawarc(350,150,20,20,0,360,3)
drawline(350,130,350,90,3)
drawline(350,110,360,120,3)
drawline(350,110,340,120,3)
drawline (300,50,300,220,3)
drawline (300,220,350,220,3)
drawline (350,220,350,170,3)
elsif wrong=3 then
drawarc(350,150,20,20,0,360,3)
drawline(350,130,350,70,3)
drawline(350,110,360,120,3)
drawline(350,110,340,120,3)
drawline (300,50,300,220,3)
drawline (300,220,350,220,3)
drawline (350,220,350,170,3)
elsif wrong=4 then
drawarc(350,150,20,20,0,360,3)
drawline(350,130,350,70,3)
drawline(350,110,360,120,3)
drawline(350,110,340,120,3)
drawline(350,70,360,60,3)
drawline (300,50,300,220,3)
drawline (300,220,350,220,3)
drawline (350,220,350,170,3)
elsif wrong=5 then
drawarc(350,150,20,20,0,360,3)
drawline(350,130,350,70,3)
drawline(350,110,360,120,3)
drawline(350,110,340,120,3)
drawline(350,70,360,60,3)
drawline(350,70,340,60,3)
drawline (300,50,300,220,3)
drawline (300,220,350,220,3)
drawline (350,220,350,170,3)
elsif wrong=6 then
drawarc(350,150,20,20,0,360,3)
drawline(350,130,350,70,3)
drawline(350,110,360,120,3)
drawline(350,110,340,120,3)
drawline(350,70,360,60,3)
drawline(350,70,340,60,3)
drawline(340,120,330,130,3)
drawline (300,50,300,220,3)
drawline (300,220,350,220,3)
drawline (350,220,350,170,3)
elsif wrong=7 then
drawarc(350,150,20,20,0,360,3)
drawline(350,130,350,70,3)
drawline(350,110,360,120,3)
drawline(350,110,340,120,3)
drawline(350,70,360,60,3)
drawline(350,70,340,60,3)
drawline(340,120,330,130,3)
drawline(360,120,370,130,3)
drawline (300,50,300,220,3)
drawline (300,220,350,220,3)
drawline (350,220,350,170,3)
else
drawarc(350,150,20,20,0,360,3)
drawline(350,130,350,70,3)
drawline(350,110,360,120,3)
drawline(350,110,340,120,3)
drawline(350,70,360,60,3)
drawline(350,70,340,60,3)
drawline(340,120,330,130,3)
drawline(360,120,370,130,3)
drawline(340,60,330,50,3)
drawline (300,50,300,220,3)
drawline (300,220,350,220,3)
drawline (350,220,350,170,3)
end if
exit when wrong=9
end if
end for
put "Sorry thats 8 guesses! GUESS THE WORD!!"
get guess1
if (guess1=word) then
put "CONGRATS! you guessed it! the word was ",word
put skip, "thanks for playing"
else
put"HAHAHAHAAHA!!! YOU SUCK!!!!! The word was ",word
end if
|