-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpseudocode.txt
28 lines (22 loc) · 1.08 KB
/
pseudocode.txt
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
1. User clicks play
1.1 - event listener on the play button element
2. Simons turn
2.2 - randomly picks a index from array of four colors
2.3 - plays the audio for that color and changes the div with that colour to a brighter color
2.4 - enables divs to be clicked for user response
2.5 - user cannot respond until simon is done
3. User response
3.1 - user clicks the div to copy simon
3.2 - event listeners on the divs
3.3 - order of clicks is recorded
3.4 - user click order is compared to computer click order
3.4.1 - if order is same, then win indicator, level++ and score++, simons turn,
(3.4.1 - check current score with high score, if highscore less than score, highscore = current score)
3.4.2 - if order is different, then game over indicator, Initialize
(3.4.2 - if order is different, replay simons turn, user gets another turn)
4. Initialize Game
4.1 - level = 1
4.2 - score = 0
4.3 - simon's array becomes null
4.4 - users's array becomes null
5. reset high score button to reset high score