Esempio n. 1
0
        public Board(Lst <Lst <Option <Shapes> > > cells)
        {
            if (!cells.ForAll(row => row.Length() == cells.Length()) || cells.Length() > Dimension.MaxBoardDimension)
            {
                throw new ArgumentOutOfRangeException("Invalid board");
            }

            Cells         = cells;
            NextMoveShape = CalculateNextMoveShape();
            Status        = CalculateGameStatus();

            GetWinner().Iter(w =>
            {
                Status = GameStatus.Over;
                Winner = Some(w);
            });
        }
Esempio n. 2
0
 private static bool Full(Lst <Move> board)
 {
     return(board.Length() == 9);
 }