Professional Documents
Culture Documents
Pesudo Code ASSIGNMENT 1
Pesudo Code ASSIGNMENT 1
Student No:10521254
Pesudo code:
Section 1 Function:
def compareWords(word1,word2)
Set matchCount to 0
For I in range of length of word2
If word1[i] == word2[i]
Set matchCount++
Return matchCount
Section 2:
Declare/Set 100 word in wordscandidate
While true
Display welcome to word guess game 2021
Display choose difficulty level “e’’,”E”,”H’’,”h”,”M’’,”m”
Prompt for difficulty level choice
If choice==’e’ or ‘E’
Display difficulty level
Select 7 words randomly from candidate words to wordlist
Set guesses_remaining to 5
ElseIf choice==’’m’’ or ‘M’
Display difficulty level
Select 8 words randomly from candidate words to wordlist
Set guesses_remaining to 4
ElseIf choice==’H’ or ‘h’
Display difficulty level
Select 9 words randomly from candidate words to wordlist
Set guesses_remaining to 3
ElseIf choice is not “e’’,’’E’’,’’M’’,’’m”,’’H’’,”h” prompt invalid choice enter again
End while
Select randomly a word as a password from wordlist
Set won to False