-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpseudo
More file actions
34 lines (23 loc) · 1.24 KB
/
pseudo
File metadata and controls
34 lines (23 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Create hangman game
intro to the game
choose 1 or 2 players
add player(s) name(s)
intro to player(s)
show secret word in underscores
player inputs guess
if wrong increase points, 11 points = game over
if 2 players game players switch turn on wrong guess, repeat turn on right guess
when game over or player wins return to intro
congratulate winning player
how to make game work
[*]make word randomiser in an array
[*]loop for picking number of players and adding names
[*]make intro with if loop (if true === welcome one player || false === welcome 2 players)
[ ]make game show array with underscores === to lenght of secret name
[ ]player input iterates trough array and looks for true value on comparison (if === then)
[ ]if equal, so if true. replace guessed letter with underscore of that position.
[*]if !==, so false. add a point to the player. If >= to 11 is true game over and other player is decleared winner.
if false go on or switch players (depending on nr of players)
if player guessed correct check for completion of the word, if true player wins. if false player my go again.
[*]if game over OR game wins === true prompt (win/lose has different promp) comment and
[ ]return to intro