Browse Source

Refactored TicTacToeBrett.Gewinner

feature/tictactoe
Felix Detig 3 years ago
parent
commit
cab4394752
  1. 12
      BlazorSolution/MiniGames/Shared/Models/TicTacToeBrett.cs

12
BlazorSolution/MiniGames/Shared/Models/TicTacToeBrett.cs

@ -82,14 +82,12 @@ namespace MiniGames.Shared.Models
public int Gewinner()
{
if (Felder[0, 0] == Felder[0, 1] && Felder[0, 1] == Felder[0, 2] && Felder[0, 0] != LEER)
{
return Felder[0, 0];
}
if (Felder[1, 0] == Felder[1, 1] && Felder[1, 1] == Felder[1, 2] && Felder[1, 0] != LEER)
for (int i = 0; i < 3; i++)
{
return Felder[1, 0];
if (Felder[i, 0] == Felder[i, 1] && Felder[i, 1] == Felder[i, 2] && Felder[i, 0] != LEER)
{
return Felder[i, 0];
}
}
return LEER;

Loading…
Cancel
Save