Sie sind auf Seite 1von 1

Team Apple

Main()
Import
random,
linecache

Set underArray =
length

Declare real Integer counter


Declare Integer index
Declare Integer error
Declare Integer guessCount
Declare Integer guessIndex
Declare Integer guessTotal
Declare Integer allGuessCounter
Declare guessArray = []
Declare guessEnumerate = []
Declare string guess =
Declare string word =
Declare integer length = 0
Declare integer underArray = 0
Declare integer jointWordLength = 0

Set jointWordLength =
length

Set guessArray =
(jointWordLength + 5)

Display The
length of the
word
is length, letter
s.
Display There
are jointWord
Length, differe
nt letters.

choice(word)

Display You
have 6
misguesses until
you lose.
length =
length(word)
While counter is in
range(0,
jointWordLength)

True
Display Enter in the dev
code to see the word or
press enter to skip:

False

Set guessTotal =
counter + error + 1
If counter =
jointWordLength

Display Please
input a single
letter:

Input code

Input guess
False

If code != apple
Display
Congratulatio
ns!! You have
correctly
guessed the
word word, in
guessTotal, tr
ies.

Set guess =
lowercase guess

Display,
word

True
Set guess, index =
guessMultipleCheck(guess,
allGuessCounter, guessArray, index, word)

Set index = index + 1

restartValid()

Set guessCount = the


amount of time the
guess is found in the
word

End

If guessCount >=
1

True

False

Display Sorry, the


letter guess, is not
in the length, letter
word.

guessCount = 1

True

False
Display Nice,
there
are guessCoun
t,guess, s.

Set error = error + 1

Display
Nice, there
is guess,

Set counter = counter + 1

restartValid()

Set allGuessCounter =
allGuessCounter + 1

Declare String
restart

errorDisplay(error,
word)

Display
Would you
like to play
again? (y/n)

underScore(word,
length, guess,
underArray)

Input restart

Display
Previous
guesses:

Display
guessArray

If restart == y or
restart == Y
True

False

Restart Program

Exit Program

guessMultipleCheck(String guess,
Integer allGuessCounter, String
guessArray, Integer index, String
word)

extreme_list(String
word)

Display You
have chosen
extreme
difficulty.

guess == 1 or
guess == or
guess ==
Display
Please input
a SINGLE
letter:

guessDuplicateCheck(g
uessArray, guess,
index, word,
allGuessCounter)

Display
Good Luck,
you re goint
to need it.

Input guess

Declare Integer num


=0

Return guess, index

Set num = number


randomly chosen
between (1, 58109)

Declare InputFile
wordDatabase

guessDuplicateCheck(String
guessArray, String guess, Integer
index, String word,
IntegerallGuessCounter)

Open wordDatabase
words_extreme.txt

guessArray.count(guess)
>=1 and index > 0
Read
wordDatabase

Display That
letter has
already been
guessed,

guessMultipleCheck(guess,
allGuessCounter,
guessArray, index, word)

Set word = word on


line chosen
depending on num

Display
please
guess
another

Set allGuessCounter =
allGuessCpunter + 1

Close wordDatabase
Input guess

Return guess, index

Return word

hard_list(String
word)

medium_list(String
word)

easy_list(String
word)

Display You
have chosen
hard
difficulty.

Display You
have chosen
medium
difficulty.

Display You
have chosen
easy
difficulty.

Display It is
not to be
taken
lightly.

Display This
is for the
average
player.

Display You
better not
lose.

Declare Integer num


=0

Declare Integer num


=0

Declare Integer num


=0

Set num = number


randomly chosen
between (1, 58109)

Set num = number


randomly chosen
between (1, 58109)

Set num = number


randomly chosen
between (1, 58109)

Declare InputFile
wordDatabase

Declare InputFile
wordDatabase

Declare InputFile
wordDatabase

Open wordDatabase
words_hard.txt

Open wordDatabase
words_medium.txt

Open wordDatabase
words_easy.txt

Read
wordDatabase

Read
wordDatabase

Read
wordDatabase
Set word = word on
line chosen
depending on num

Set word = word on


line chosen
depending on num

Set word = word on


line chosen
depending on num

Close wordDatabase

Close wordDatabase
Close wordDatabase

Return word

Return word
Return word

guessIndexFinder(S
tring word, String
guess, Integer
length)

underScore(String word,
Integer length, String guess,
String underArray)

Index = length - 1
Index = length - 1
True

True

Set guess =
word[index]

Set guess =
word[index]
False

False

Set
underArray[index] =
guess

Set tempIndex =
index

Return tempIndex
Display
underArray

choice(String word):

Declare String word


Declare String dif

Return
Display Please choose
a difficulty, (1)easy,
(2)medium, (3)hard,
(4)extreme:
Input dif

Easy_list(word)

True

dif = 1
False

medium_list(w
ord)

True

dif = 2
False

hard_list(word
)

True

dif = 3
False

Extreme_list(w
ord)

True

dif = 4

Return word

errorDisplay(Integer
error,String word)

Display
-------|
|
|
|
|
|
|
--------------

Display
-------|
|
0 |
|
|
|
|
--------------

Display
-------|
|
0 |
/
|
|
|
|
--------------

Display
-------|
|
0 |
/|\ |
| |
|
|
--------------

Display
-------|
|
0 |
/\ |
|
|
|
--------------

Display
-------|
|
0 |
/|\ |
| |
/
|
|
--------------

Display
Sorry, the
word
was word,
but you have
guessed
incorrectly
too many
times.

Display
-------|
|
0 |
/|\ |
| |
/\ |
|
--------------

restartValid()

Return

Das könnte Ihnen auch gefallen