示例#1
0
        public static void nextTurn(int turn)
        {
            int    place = GameViewer.GetColumn();
            string token;

            if (turn == 1)
            {
                token = "R";
            }
            else
            {
                token = "Y";
            }

            if (board[5, place] == "")
            {
                board[5, place] += token;
            }
            else if (board[4, place] == "")
            {
                board[4, place] += token;
            }
            else if (board[3, place] == "")
            {
                board[3, place] += token;
            }
            else if (board[2, place] == "")
            {
                board[2, place] += token;
            }
            else if (board[1, place] == "")
            {
                board[1, place] += token;
            }
            else if (board[0, place] == "")
            {
                board[0, place] += token;
            }
        }
示例#2
0
        public static void gameStart(Player p1, Player p2)
        {
            Console.WriteLine();
            int randChoice = rand.Next(2);

            if (randChoice == 0)
            {
                Console.WriteLine("You'll be going first, " + p1);
                playerTurn = 1;
            }
            else
            {
                Console.WriteLine("You'll be going first, " + p2);
                playerTurn = 2;
            }
            if (playerTurn == 1)
            {
                GameViewer.DisplayBoard(board);
                int place = GameViewer.GetColumn();
                if (board[5, place] == "")
                {
                    board[5, place] += "R";
                }
                playerTurn++;
            }
            else
            {
                GameViewer.DisplayBoard(board);
                int place = GameViewer.GetColumn();
                if (board[5, place] == "")
                {
                    board[5, place] += "Y";
                }
                playerTurn = 1;
            }
            GameViewer.DisplayBoard(board);
            nextTurn(playerTurn);
        }
示例#3
0
 public Simulator(GameViewer viewer = null)
 {
     Viewer = viewer;
 }
示例#4
0
 public static void Main(string[] args)
 {
     GameViewer.MainMenu();
 }
 public Simulator(GameViewer viewer = null)
 {
     Viewer = viewer;
 }