Projektdateien hinzufügen.

This commit is contained in:
Michael Chen
2020-01-04 11:54:13 +01:00
parent ab38da4384
commit 71c1a4d20c
17 changed files with 645 additions and 0 deletions

26
TicTacToe/Grid.cs Normal file
View File

@ -0,0 +1,26 @@
namespace TicTacToe {
public class Grid {
private readonly Player[,] _field;
private const int GRIDSIZE = 3;
public bool GameOver => IsGameOver();
private bool IsGameOver() {
for (var x = 0; x < GRIDSIZE; x++)
for (var y = 0; y < GRIDSIZE; y++)
if (IsFieldEmpty(x, y))
return false;
return true;
}
private bool IsFieldEmpty(int x, int y) {
return _field[x, y] == Player.Empty;
}
public Grid() {
_field = new Player[GRIDSIZE, GRIDSIZE];
}
public bool PickSpot() {
}
}
}

7
TicTacToe/Player.cs Normal file
View File

@ -0,0 +1,7 @@
namespace TicTacToe {
enum Player {
Empty = 0,
Cross = 1,
Circle = 2
}
}

View File

@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
</Project>