Browse Source

Merge branch 'Ariana' into 'main'

refactoring: using else and if

See merge request pmuw_projekt/pmuw_projekt_notebinder!22
remotes/origin/fdai7775-main-patch-54732
fdai7775 11 months ago
parent
commit
dbb2f8ac22
  1. 2
      src/main/c/GameTic_Tac_Toe/game.c

2
src/main/c/GameTic_Tac_Toe/game.c

@ -27,7 +27,7 @@ char checkWinner() {
} }
// Überprüfe diagonale Linien // Überprüfe diagonale Linien
if (board[0][0] == board[1][1] && board[1][1] == board[2][2]) return board[0][0]; if (board[0][0] == board[1][1] && board[1][1] == board[2][2]) return board[0][0];
if (board[0][2] == board[1][1] && board[1][1] == board[2][0]) return board[0][2];
else if (board[0][2] == board[1][1] && board[1][1] == board[2][0]) return board[0][2];
// Kein Gewinner // Kein Gewinner
return ' '; return ' ';

Loading…
Cancel
Save