You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.0 KiB
51 lines
1.0 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MiniGames.Shared.Models
|
|
{
|
|
public class TicTacToeBrett
|
|
{
|
|
int[,] Felder;
|
|
|
|
public TicTacToeBrett()
|
|
{
|
|
Felder = new[,]
|
|
{
|
|
{ -1, -1, -1 },
|
|
{ -1, -1, -1 },
|
|
{ -1, -1, -1 },
|
|
};
|
|
}
|
|
|
|
public TicTacToeBrett(int[,] felder)
|
|
{
|
|
Felder = felder;
|
|
}
|
|
|
|
public bool Gleich(TicTacToeBrett anderes)
|
|
{
|
|
for (int i = 0; i < 3; i++)
|
|
{
|
|
for (int j = 0; j < 3; j++)
|
|
{
|
|
if (Felder[i, j] != anderes.Felder[i, j])
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public bool Set(int pos, int wert)
|
|
{
|
|
Felder[pos / 3, pos % 3] = wert;
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|