Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions 05week/checkers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -60,6 +69,8 @@ function Game() {

this.start = function() {
this.board.createGrid();
this.board.populateBoard();
//console.log(this.board.checkers);
// Your code here
};
}
Expand Down
10 changes: 10 additions & 0 deletions 06week/ticTacToe/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
/*

*/
});