Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
368 B
1
Indexable
Never
public static GameResult GetGameResult(Mark[,] field)
{
    for (int x = 0; x < field.GetLength(0); x++)
    {
        if (field[x, 0] == field[x, 1] && field[x, 0] == field[x, 2])
        {
            return field[x, 0];
        }
        if (field[0,x] == field[1,x] && field[0,x] == field[2, x])
        {
            return field[0,x];
        }
    }