コード例 #1
0
ファイル: Program.cs プロジェクト: bdr27/c-
        static void Main(string[] args)
        {            
            Board board = new Board();
            Cell[,] cells = board.getCells();
            Console.WriteLine("Win List Test");
            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    Console.WriteLine(cells[i, j].printWinList());
                }
            }
            board.ResetPiece();
            Console.WriteLine("\nIs Valid Move Test");
            addPieceToBoard("11", Piece.PLAYER1, board);
            addPieceToBoard("22", Piece.PLAYER1, board);
            addPieceToBoard("12", Piece.PLAYER2, board);
            addPieceToBoard("33", Piece.PLAYER2, board);
   
            Console.WriteLine("string [hello] (False): " + board.isValidMove("hello").ToString());
            Console.WriteLine("string [02] (False): " + board.isValidMove("02").ToString());
            Console.WriteLine("Pieces string: " + board.GetPieces());

            Console.WriteLine("\nPrint Board Test");
            Console.WriteLine(board);
            Console.ReadKey();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: bdr27/c-
        static void Main(string[] args)
        {
            Board board = new Board();
            Console.WriteLine(board);
            Console.ReadKey();

            board.ResetPieces();

            board.Move("11", Piece.PLAYER1);
            board.Move("12", Piece.PLAYER1);
            board.Move("13", Piece.PLAYER2);
            board.Move("22", Piece.PLAYER2);

            Console.WriteLine("pieces: " + board.GetPieces());
            Console.ReadKey();

            board.ResetPieces();
            Console.WriteLine("pieces: " + board.GetPieces());
            Console.ReadKey();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: bdr27/c-
 private static void addPieceToBoard(string position, Piece player, Board board)
 {
     Console.WriteLine("string [" + position + "] (True): " + board.isValidMove(position).ToString());
     board.Move(position, player);
     Console.WriteLine("string [" + position + "] when occupied by a player (False): " + board.isValidMove(position).ToString());
 }
コード例 #4
0
ファイル: MOCKMessageHandler.cs プロジェクト: bdr27/c-
 public MOCKMessageHandler()
 {
     gameState = GameState.WAIT_PLAYER1_NAME;
     response = "NONE";
     board = new Board();
 }