Skip to content

TMGilchrist/comp110-worksheet-B

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

comp110-worksheet-B

Base repository for COMP110 worksheet B

It's a FLOWCHART! Beware the ED! :D


wordLength = 5

guesses = 0
score = 0

secretWord = get random word where characters = wordLength

#Player has four attempts to guess the word
while guesses < 4
	
  userGuess = get user input

  #Game finishes if user guess word correctly
  if userGuess == secretWord
    print "you win"
    break

  #For each letter in the secret word, compare with the player's guess	
  else
    for i in range 0 .. length of secretWord
      if secretWord(i) == userGuess(i)
        increment score

    print "Likeness score is" + score
    score = 0
    increment guesses
		

About

Base repository for COMP110 worksheet B

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published