Zavrsen iksoks
This commit is contained in:
parent
1918da4073
commit
926043d8c0
18
iksoks.cpp
18
iksoks.cpp
@ -62,17 +62,23 @@ for(int i=0; i<8; i++){
|
|||||||
cout << "Choose a column (1-3): \n";
|
cout << "Choose a column (1-3): \n";
|
||||||
cin >> col;
|
cin >> col;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(board[col-1][row-1] == ' '){
|
||||||
|
board[col-1][row-1] = player;
|
||||||
|
checkWin(board, player);
|
||||||
|
player = (player == 'X') ? 'O' : 'X';
|
||||||
|
}
|
||||||
|
|
||||||
board[col-1][row-1] = player;
|
else{
|
||||||
|
cout << "###Place is taken###\n";
|
||||||
checkWin(board, player);
|
i--;
|
||||||
|
continue;
|
||||||
player = (player == 'X') ? 'O' : 'X';
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << "It's Draw!" << endl;
|
cout << "It's Draw!" << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user