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