From 694433b762a28f19c16953fb79229a8f25f69643 Mon Sep 17 00:00:00 2001 From: Chase Turner Date: Sun, 20 Aug 2017 14:25:12 -0500 Subject: [PATCH] Commit to save data from Atom crash --- 05week/checkers.js | 11 +++++++++++ 06week/ticTacToe/script.js | 10 ++++++++++ 2 files changed, 21 insertions(+) diff --git a/05week/checkers.js b/05week/checkers.js index 8f33a089c..c7f2c76e6 100644 --- a/05week/checkers.js +++ b/05week/checkers.js @@ -14,6 +14,15 @@ function Checker() { function Board() { this.grid = []; + this.checkers = []; + this.populateBoard = function (){ + for ( let i = 0; i < 12; i++){ + this.checkers.push('x'); + } + for ( let j = 0; j < 12; j++){ + this.checkers.push('o'); + } + } // creates an 8x8 array, filled with null values this.createGrid = function() { // loop to create the 8 rows @@ -60,6 +69,8 @@ function Game() { this.start = function() { this.board.createGrid(); + this.board.populateBoard(); + //console.log(this.board.checkers); // Your code here }; } diff --git a/06week/ticTacToe/script.js b/06week/ticTacToe/script.js index 9a6b571df..9a4c1e76b 100644 --- a/06week/ticTacToe/script.js +++ b/06week/ticTacToe/script.js @@ -2,4 +2,14 @@ document.addEventListener('DOMContentLoaded', () => { // Your code here + //Start with blank board + //on click, check for empty space, if yes then apply x or o(event listener on data cells) + //(how to get data cell attributes) + //rotate player to switch between x and o + //at the end of each turn, test for a win. + //a win would be x or o matching horizontal, diagonal, or vertical +//put data cell attributes into an array + /* + + */ });