-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
46 lines (31 loc) · 848 Bytes
/
script.js
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
//Create and Operate on the gameboard
const gameBoard = (function() {
const rows = 3;
const columns = 3;
const board = new Array(rows);
for (let i = 0; i < rows; i++) {
board[i] = new Array(columns);
}
//return the full game board
const getBoard = function() {
return board;
}
//place token on board
const placeToken = function (row, col, token) {
board[row][col] = token;
}
return {getBoard, placeToken};
})();
//Game Controller - handle game state and flow
const gameController = (function() {
const player1Name = 'Player 1';
const player2Name = 'Player 2';
})();
//play a round
//displayController - manage UI changes
const displayController = (function() {
console.log('hello');
//update screen
// handle clicks on the board
})();
//