js/tictactoe.js
/* Gathers list of webelements 'Box' from HTML, then sorts the list into a 3x3 grid */
Gathers list of webelements 'Box' from HTML, then sorts the list into a 3x3 grid
Gathers list of webelements ' Box ' from HTML then sorts the list into a 3x3 grid
function GatherBoard()
{
    var list = document.getElementsByClassName("box");
    var count = 0;
    var board = [[],[],[]];
    for(var y = 0; y < 3; y++)
        {
            for(var x = 0; x < 3; x++)
                {
                    board[x][y] = list[count];
                    count++;
                } 
        } 
    return board;
} 
function GatherBoard ( ) { var list = document . getElementsByClassName ( "box" ) ; var count = 0 ; var board = [ [ ] , [ ] , [ ] ] ; for ( var y = 0 ; y < 3 ; y ++ ) { for ( var x = 0 ; x < 3 ; x ++ ) { board [ x ] [ y ] = list [ count ] ; count ++ ; } } return board ; }
Gathers list of webelements 'Box' from HTML, then sorts the list into a 3x3 grid
Gathers list of webelements ' Box ' from HTML then sorts the list into a 3x3 grid
//console.log(list.length);
 // End of double For loop 
 // End of function GatherBoard
