insert move
This commit is contained in:
parent
9ecee70798
commit
964575d46d
|
@ -14,7 +14,6 @@ void warningMsg(char *msg) {
|
|||
}
|
||||
|
||||
void errExitMsg(char *msg) {
|
||||
fprintf(stderr, "\033[91m<Error>\033[39m\n");
|
||||
perror(msg);
|
||||
fprintf(stderr, "\033[91m<Error>\033[39m %s\n", msg);
|
||||
exit(1);
|
||||
}
|
10
src/forza4.c
10
src/forza4.c
|
@ -135,6 +135,12 @@ int checkMove(tile_t *board, int collums) {
|
|||
return pos;
|
||||
}
|
||||
|
||||
void insertCoin() {
|
||||
|
||||
void insertMove(tile_t *board, int pos, int turn) {
|
||||
if (board[pos] != EMPTY) {
|
||||
char buf[100];
|
||||
sprintf(buf, "The position %d indicated isn't empty", pos);
|
||||
errExitMsg(buf);
|
||||
}
|
||||
|
||||
board[pos] = (turn == 0) ? PLAYER1 : PLAYER2;
|
||||
}
|
Loading…
Reference in New Issue