fix js
This commit is contained in:
parent
9dceeac9fa
commit
a36105ddbe
|
@ -71,22 +71,16 @@ function playingAT(cellKey){
|
||||||
inputs[index].setAttribute("class","hidden");
|
inputs[index].setAttribute("class","hidden");
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById("playerButtons").setAttribute("class", "hidden");
|
|
||||||
|
|
||||||
if(currentPlayer == 1){
|
if(currentPlayer == 1){
|
||||||
var symbol= "X";
|
var symbol= "X";
|
||||||
}else{
|
}else{
|
||||||
var symbol="O";
|
var symbol="O";
|
||||||
}
|
}
|
||||||
|
|
||||||
//find the first line empty
|
//test if cell is empty
|
||||||
var i=0;
|
if(grid[cellKey] !== ""){
|
||||||
for(i = 0; i < 6 , grid[i][col] !== ""; i++){
|
addLog("Player " + currentPlayer + "tente de jouer sur " + cellKey +". Cette case est déjà prise, il perd");
|
||||||
//nothing juste a counter
|
|
||||||
}
|
}
|
||||||
grid[i][col]=symbol;
|
|
||||||
document.getElementById('td' + col + '_' + i).innerHTML = symbol;
|
|
||||||
addLog('player ' + currentPlayer + ', symbol ' + symbol + ' played col ' + col);
|
|
||||||
|
|
||||||
//does he win?
|
//does he win?
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user