var text ='rkbqGbkrppppppppxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxpppppppprkbqGbkr' var j=0; for (i=1;i<text.length;i++){ if (i!=0 && i%8==0){ console.log(text.substring(j,i)) j+=8; } }
oops forgot the +1 in text.length
Message
Cancel
Creating...
Broadcasting...
//initiate //check if move is number 1 true //check if address 1 is x address 2 is y true //move odd //check if address is x true //check if move is odd true
Message
Cancel
Creating...
Broadcasting...
//check if move is valid true //check win condition false //rewrite pieces true //move even //check if address is y //check if move is even //check if move is valid true
Message
Cancel
Creating...
Broadcasting...
//check win condition false //rewrite pieces true //win condition //console.log('winner')
Message
Cancel
Creating...
Broadcasting...