コード例 #1
0
        private void DoActionFor1() //Skal erstattes. Skal referere til game boarded.
        {
            Console.Clear();
            Console.WriteLine("Vælg mellem at spille standard eller variation");
            Console.WriteLine("Tast 1 for standard. Tast 2 for variation");
            //Console.ReadLine();
            string choiceOfGame = "";

            choiceOfGame = GetUserChoise();
            switch (choiceOfGame)
            {
            case "1": ticTacToe = new TicTacToe(); break;

            case "2": ticTacToe = new TicTacToe(); Variation(); break;

                // case "øverst venstre": ticTacToe.GameBoard[0, 2] = 'x'; break;
            }

            //ticTacToe = new TicTacToe();
        }
コード例 #2
0
 public void ShowMenu()
 {
     Console.Clear();
     if (ticTacToe != null)
     {
         Console.WriteLine(ticTacToe.GetGameBoardView());
         if (TicTacToe.Validate(ticTacToe.GameBoard) != ' ')                         //Hvis metoden Validate registrerer 3 på stribe ud fra koden i TicTacToe.cs - så afsluttes spillet(running = false) og nedenstående strings printes
         {
             Console.WriteLine("player " + TicTacToe.Validate(ticTacToe.GameBoard)); //Sidste del er for at finde ud af om det er spilleren X eller O.
             Console.WriteLine("A Winner is You!");
             running = false;                                                        //her afsluttes spillet.
         }
     }
     Console.WriteLine("tic tac toe");
     Console.WriteLine();
     Console.WriteLine("1. Opret et nyt spil");
     Console.WriteLine("2. Set en brik");
     Console.WriteLine("3. Flyt en brik");
     Console.WriteLine();
     Console.WriteLine("0. exit");
 }
コード例 #3
0
 public void ShowMenu()
 {
     Console.Clear();
     if (ticTacToe != null)
     {
         Console.WriteLine(ticTacToe.GetGameBoardView());
         if (TicTacToe.Validate(ticTacToe.GameBoard) != ' ')
         {
             Console.WriteLine("player " + TicTacToe.Validate(ticTacToe.GameBoard));
             Console.WriteLine("A Winner is You!");
             running = false;
         }
     }
     Console.WriteLine("tic tac toe");
     Console.WriteLine();
     Console.WriteLine("1. Opret et nyt almindeligt spil");
     Console.WriteLine("2. Set en brik");
     Console.WriteLine("3. Flyt en brik");
     Console.WriteLine("4. Opret et nyt variations Spil");
     Console.WriteLine();
     Console.WriteLine("0. exit");
 }
コード例 #4
0
ファイル: TicTacToeMenu.cs プロジェクト: markchr98/TicNShips
        private void DoActionFor1()
        {
            Console.Clear();
            Console.WriteLine("Which gamemode would you like to play?");
            Console.WriteLine();
            Console.WriteLine("Type 1 For standard");
            Console.WriteLine("Type 2 For Variation, with a max of 3 bricks");
            Console.WriteLine();

            switch (Console.ReadLine())
            {
            case "1":
                ticTacToe   = new TicTacToe();
                currentgame = true;
                player1     = true;
                variation   = false;
                Console.WriteLine("You chose standard");
                Console.WriteLine("Press enter to continue");
                Console.ReadLine();
                break;

            case "2":
                ticTacToe   = new TicTacToe();
                currentgame = true;
                player1     = true;
                variation   = true;
                brickcount  = 0;
                Console.WriteLine("You chose variation");
                Console.WriteLine("Press enter to continue");
                Console.ReadLine();
                break;

            default:
                ShowMenuSelectionError();
                break;
            }
        }
コード例 #5
0
 private void DoActionFor1()
 {
     ticTacToe = new TicTacToe(); //Får spillebrættet frem
 }
コード例 #6
0
ファイル: TicTacToeMenu.cs プロジェクト: QTPx/spil
 private void DoActionFor1()
 {
     ticTacToe = new TicTacToe();
 }
コード例 #7
0
ファイル: TicTacToeMenu.cs プロジェクト: Biest1155/spil
 private void DoActionFor1() //Opret nyt spil og slet det gamle.
 {
     ticTacToe = new TicTacToe();
 }
コード例 #8
0
 private void DoActionStartNormalGame()
 {
     ticTacToe             = new TicTacToe();
     ticTacToe.isVariation = false;
     ticTacToe.AddPlayers();
 }
コード例 #9
0
 private void DoActionStartVariationGame()
 {
     ticTacToe             = new TicTacToe();
     ticTacToe.isVariation = true;
     ticTacToe.AddPlayers();
 }
コード例 #10
0
 private void DoActionFor1()// starter et spil
 {
     ticTacToe = new TicTacToe();
 }
コード例 #11
0
ファイル: TicTacToeMenu.cs プロジェクト: QTPx/spil
 private void ExecuteMenuChoice1()
 {
     ticTacToe = new TicTacToe();
     {
     }
 }
コード例 #12
0
 private void DoActionFor4()
 {
     Console.WriteLine("Du har startet et variations spil");
     ticTacToe = new TicTacToeVariant();
 }