Example #1
0
        public void Play(int position, SquareOwner player)
        {
            if (!PositionIsValid(position))
            {
                throw new Exception("Invalid position");
            }

            double rowPosition = position / 3;
            int    row         = (int)Math.Floor(rowPosition);
            int    col         = position % 3;

            this.board[row][col].owner = player;
        }
Example #2
0
 public Square()
 {
     owner = SquareOwner.UNOWNED;
 }