Пример #1
0
        public void welcomeMs()
        {
            try
            {
                print(TextClss.welcMesg);
                print(TextClss.playernumMesg);
                //   Scanner scanner = new Scanner(System.in);
                // playerNum = scanner.nextInt();
                //playernum = Console.ReadLine();
                playerNum = Convert.ToInt32(Console.ReadLine());

                playerNames = new String[playerNum];
                print(TextClss.playerNumber(playerNum));
                print(TextClss.sepMesgLine);
                int counter = 0;
                for (int i = 0; i < playerNum; i++)
                {
                    counter++;
                    print(TextClss.nameThePlayer(counter));
                    String name = Console.ReadLine();
                    playerNames[i] = name;
                    print(TextClss.sepMesgLine);
                }
            }
            catch (Exception exp)
            {
                print("Forkert input");
                welcomeMs();
            }
        }
Пример #2
0
        private void game()
        {
            scoreList = new int[pNum];

            do
            {
                round++;
                print(TextClss.roundShow(round));

                for (int i = 0; i < pNum; i++)
                {
                    dice.roll();
                    scoreList[i] += dice.getTotal();
                    // System.out.println(GameController.getPlayerNames()[i] + " :" + scoreList[i]);
                    print(TextClss.scoreShow(InputValidator.getPlayerNames()[i], scoreList[i]));
                }
                gameOver();
                print(TextClss.sepGameLine);
            } while (!gameOver());
            scoreCheck();
        }