public void SpinBotMartingaleTest()
        {
            RouletteTable tableOne  = new RouletteTable();
            Player        playerOne = new BotDAlembert("TestBotMartingaleOne", 0);

            tableOne.AddPlayer(playerOne);
            tableOne.Spin();
            Assert.AreEqual(tableOne.Observers[0], playerOne);

            Player playerTwo = new BotMartingale("TestBotMartingaleTwo", 3000);

            tableOne.AddPlayer(playerTwo);

            tableOne.Spin();
            tableOne.ShowInfoAboutPlayers();

            Assert.AreEqual(tableOne.Players[0].Name, "TestBotMartingaleTwo");
            Assert.AreEqual(tableOne.Players[0].AmountOfBets, 1);
            int oldBalance = tableOne.Players[0].Balance;

            tableOne.Spin();
            tableOne.ShowInfoAboutPlayers();

            Assert.AreEqual(tableOne.Players[0].AmountOfBets, 2);
            Assert.AreNotEqual(tableOne.Players[0].Balance, oldBalance);
        }
Пример #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to LUCKY ROULETTE!");
            Console.WriteLine("");

            if (args.Length != 1)
            {
                Console.WriteLine("Incorrect amount of parameters. Only one needed.");
                return;
            }

            List <Type> bots = new BotLoader().FindBots(args[0], typeof(Bot));

            if (bots == null)
            {
                return;
            }

            RouletteTable tableOne = new RouletteTable();

            for (int x = 0; x < bots.Count; x++)
            {
                object[] parameters = { bots[x].Name, 1000 };
                tableOne.AddPlayer((Player)Activator.CreateInstance(bots[x], parameters));
            }

            for (int x = 0; x < 40; x++)
            {
                tableOne.Spin();
            }

            Console.WriteLine("");
            tableOne.ShowInfoAboutPlayers();
        }
Пример #3
0
        static void Main()
        {
            Console.WriteLine("Welcome to LUCKY ROULETTE!");
            Console.WriteLine("");

            RouletteTable tableOne = new RouletteTable();

            tableOne.AddPlayer(new BotDAlembert("BotDAlembert", 1000));
            tableOne.AddPlayer(new BotLabouchere("BotLabouchere", 1000));
            tableOne.AddPlayer(new BotMartingale("BotMartingale", 1000));

            for (int x = 0; x < 40; x++)
            {
                tableOne.Spin();
            }

            Console.WriteLine("");
            tableOne.ShowInfoAboutPlayers();
        }