-
Notifications
You must be signed in to change notification settings - Fork 0
/
todo.txt
68 lines (51 loc) · 2.43 KB
/
todo.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
> well... first, figure out what all that code is doing.
============= PERFORMANCE/VISUAL STUFF =============
> when two users, user1 and user2, start a game, they should see the board and maybe the chat area.
> board starts out as a blue rectangle, 7 x 6 white holes (7 width, 6 height)
> on user1's (the inviter) side, display: "Please make a move." since inviter starts first
> on user2's side, display: "Please wait for other player to make a move."
> This display alternates. So after user1 makes a move, he/she has to wait for user2 to make a move.
> colours: user1 = red, user2 = yellow
> to make a move, user selects column with left and right keyboard keys. Space will drop the piece.
> display a green square outlining the column we're on?
> default could be 0th column
> when user makes a move, a circle of that user's colour will drop down into the column
> ... so need to keep track of where the "bottom" of that column is
> after every move, check various things:
> if that completes a row of 4 or more
> alert users of their state
> change match state to U1WIN or U2WIN.
> alert redirects users to arcade page, ending the game.
> else if the number of pieces in the board = 6*7 = 42, there are no more moves
> change match state to TIE
> alert users of what happened, redirecting to arcade page, ending the game
> else (not a winning move)
> continue
============= ALGORITHMS STUFF ==============
> checking current board for row of 4
> checking current board for number of pieces
> if == 42, gg.
> board could be saved as an array sorted by columns:
[col1 col2 ... col 7]
each col starts from the bottom. This way, when a user drops a piece,
we can just insert the value at the first empty space found.
> check if match table is updated upon start of match
> get id from player1
> use id to update blob
> pass blob to server
> check for win on server's side
> implement what happens when we have a win (win message, play again? quit?.... etc)
> update match table in db with match info
> update player2's view with blob
> update player1's view with id (or blob)
> enforce turn (no consecutive turns)--> show "Waiting for opponent's move".... or "your turn" ... etc
GRACE can expect:
Input:
- var user //who's move this is
- an integer in [0,6] //where the user clicked
Output:
- a string //updated state of the board
*look at .serialize() to decide how to store the board state
*check for win
*
That's pretty much all~~~~~~~~~~~~~~~~