Browse Source

refactoring: Zuege -> makeMove

main^2
Simon Hildebrandt 11 months ago
committed by Peter Wiebe
parent
commit
ba9ee7b7d3
  1. 8
      src/main/c/TicTacToe.c

8
src/main/c/TicTacToe.c

@ -80,7 +80,7 @@ int Winner(char board[3][3]) {
printf("Es ist ein Unendschieden\n"); printf("Es ist ein Unendschieden\n");
return 0; return 0;
} }
void Zuege(char board[3][3], int row, int col) {
void makeMove(char board[3][3], int row, int col) {
if (Runde < 10) { if (Runde < 10) {
if (Runde % 2 == 0) { if (Runde % 2 == 0) {
if (board[row][col] == '_') { if (board[row][col] == '_') {
@ -94,7 +94,7 @@ void Zuege(char board[3][3], int row, int col) {
scanf("%d", &col); scanf("%d", &col);
row -= 1; row -= 1;
col -= 1; col -= 1;
Zuege(board, row, col);
makeMove(board, row, col);
} }
} }
else { else {
@ -109,7 +109,7 @@ void Zuege(char board[3][3], int row, int col) {
scanf("%d", &col); scanf("%d", &col);
row -= 1; row -= 1;
col -= 1; col -= 1;
Zuege(board, row, col);
makeMove(board, row, col);
} }
} }
} }
@ -157,7 +157,7 @@ int mainx() {
row -= 1; //Für Index eins kleiner row -= 1; //Für Index eins kleiner
col -= 1; col -= 1;
} }
Zuege(board, row, col);
makeMove(board, row, col);
Runde++; Runde++;
} }
displayBoard(board); displayBoard(board);

Loading…
Cancel
Save