mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-25 20:34:32 -08:00
Add game intro
This commit is contained in:
18
67_One_Check/csharp/Board.cs
Normal file
18
67_One_Check/csharp/Board.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace OneCheck;
|
||||
|
||||
internal class Board
|
||||
{
|
||||
private readonly int[][] _checkers;
|
||||
|
||||
public Board()
|
||||
{
|
||||
_checkers =
|
||||
Enumerable.Range(0, 8)
|
||||
.Select(r => Enumerable.Range(0, 8)
|
||||
.Select(c => r > 1 && r < 6 && c > 1 && c < 6 ? 0 : 1).ToArray())
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
public override string ToString() =>
|
||||
string.Join(Environment.NewLine, _checkers.Select(r => string.Join(" ", r.Select(c => $" {c}"))));
|
||||
}
|
||||
Reference in New Issue
Block a user