Exemplo n.º 1
0
        static void Main(string[] args)
        {
            MarbleGame game = new MarbleGame();

            string[] lines = System.IO.File.ReadAllLines(@"..\..\..\input.txt");
            foreach (string line in lines)
            {
                double ergebnis = game.getBetterHighscore(line);
                Console.WriteLine("{0}: high score is {1}", line, ergebnis);
            }

            Console.Write("\nPress any key to continue... ");
            Console.ReadLine();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var numPlayers = int.Parse(Input.First().Split(' ').First());
            var numMarbles = int.Parse(Input.First().Split(' ').Skip(6).First());
            var game       = new MarbleGame(numPlayers);

            for (var i = 0; i < numMarbles; i++)
            {
                game.Play();
            }
            Console.WriteLine("Part 1: " + game.GetHighestScore()); // 399745

            for (var i = 0; i < numMarbles * 99; i++)
            {
                game.Play();
            }
            Console.WriteLine("Part 2: " + game.GetHighestScore()); // 3349098263
        }