mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-08 11:24:49 -08:00
Add Board and Coordinates
This commit is contained in:
18
56_Life_for_Two/csharp/Board.cs
Normal file
18
56_Life_for_Two/csharp/Board.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace LifeforTwo;
|
||||
|
||||
internal class Board
|
||||
{
|
||||
private readonly int[,] _cells = new int[7,7];
|
||||
|
||||
public int this[Coordinates coordinates]
|
||||
{
|
||||
get => _cells[coordinates.X, coordinates.Y];
|
||||
set => _cells[coordinates.X, coordinates.Y] = value;
|
||||
}
|
||||
|
||||
public int this[int x, int y]
|
||||
{
|
||||
get => _cells[x, y];
|
||||
set => _cells[x, y] = value;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user