Skip to content

Commit

Permalink
update the array print for moves received
Browse files Browse the repository at this point in the history
  • Loading branch information
sirleech committed Mar 8, 2012
1 parent 117379d commit 86e5cee
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions chatClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
var paper;
var circles;

ma = new MultiArray();

// beginner boards of 9x9, 14x14. official Go is 19x19.
var gameBoardState = ma.create(9,9);

//////////////////////////

//////////////////////////

$(document).ready(function(){

now.receiveState = function(state,name,lastMoveDateTime){
Expand All @@ -21,6 +30,8 @@ $(document).ready(function(){
dateString = date.getHours() + ":" + date.getMinutes();
$("#lastMoveUser").empty();
$("#lastMoveUser").append("Last move by " + name + " on " + dateString);
gameBoardState[x][y] = state;
print2dArray(gameBoardState);
}

now.name = prompt("What's your name?", "");
Expand Down Expand Up @@ -130,6 +141,8 @@ function setCircleColour(x,y,state) {

function draw(state,name,lastMoveDateTime){

gameBoardState = state;

print2dArray(state);
$("#lastMoveUser").empty();
if (now.name == name)
Expand Down

0 comments on commit 86e5cee

Please sign in to comment.