Browse Source

added print field function

remotes/origin/ticTacToe
Aimee Reincke 2 years ago
parent
commit
714e1224bf
  1. 14
      src/c/ticTacToe.c
  2. 1
      src/c/ticTacToe.h

14
src/c/ticTacToe.c

@ -10,5 +10,17 @@ int something(int a){
}
void printPrompt(){
printf("Let's play Tic Tac Toe. You will use O, I will use X.\nJust enter the number of the field you choose.\nYou start.\n");
printf("Let's play Tic Tac Toe. You will use O, I will use X.\nJust enter the number of the field you choose as row col.\nYou start.\n");
}
void printField(char field[3][3]){
for (int i = 0; i < 3; i++){
for (int j = 0; j < 3; j++){
printf("%d", field[i][j]);
if (j < 2) {
printf("|");
}
}
printf("\n");
}
}

1
src/c/ticTacToe.h

@ -3,5 +3,6 @@
int something(int a);
void printPrompt();
void printField(char field[3][3]);
#endif
Loading…
Cancel
Save