示例#1
0
        static void Main(string[] args)
        {
            DiceRoller roller = new DiceRoller();
            Die        dice   = new Die(6);

            for (int i = 0; i < 20; i++)
            {
                roller.InsertDie(dice);
                dice.Roll(6);
                Console.Write(dice.Roll(6) + " ");
            }
        }
示例#2
0
        static void Main(string[] args)
        {       //5. zadatak
            ConsoleLogger logger     = new ConsoleLogger();
            DiceRoller    diceRoller = new DiceRoller();
            Random        random     = new Random();

            for (int i = 0; i < 20; i++)
            {
                diceRoller.InsertDie(new Die(6));
            }
            diceRoller.RollAllDice();
            logger.Log(diceRoller);
        }//6. zadatak: sučelje iz primjera sam razlomio na 2 sučelja IClosedDiceeRoller i ICompleteDiceRoller
示例#3
0
        static void Main(string[] args)
        {
            DiceRoller dice = new DiceRoller(20);

            for (int i = 0; i < 20; i++)
            {
                dice.InsertDie(new Die(6));
            }
            dice.RollAllDice();
            IList <int> results = dice.GetRollingResults();

            foreach (int result in results)
            {
                Console.WriteLine(result);
            }
        }
示例#4
0
        static void Main(string[] args)
        {
            /*zadatak 1.,2.*/
            DiceRoller diceRoller   = new DiceRoller();
            const int  numberOfDice = 20;

            for (int i = 0; i < numberOfDice; i++)
            {
                diceRoller.InsertDie(new Die(6));
            }
            diceRoller.RollAllDice();
            IList <int> results = diceRoller.GetRollingResults();

            foreach (int result in results)
            {
                Console.WriteLine(result);
            }
        }
示例#5
0
        static void Main(string[] args)
        {
            const int  numberOfDice = 20;
            DiceRoller diceRoller   = new DiceRoller();

            for (int i = 0; i < numberOfDice; i++)
            {
                diceRoller.InsertDie(new Die(6));
            }
            diceRoller.RollAllDice();
            IList <int> results = diceRoller.GetRollingResults();

            foreach (int result in results)
            {
                Console.WriteLine(result);
            }

            ConsoleLogger logger = new ConsoleLogger();

            logger.Log(diceRoller);



            /*ConsoleLogger logger=new ConsoleLogger();
             * logger.Log(diceRoller);
             */

            //Zadatak 2

            /*Console.WriteLine();
             *
             * DiceRoller diceRoller2 = new DiceRoller();
             * Random randomGenerator = new Random();
             * for (int i = 0; i < numberOfDice; i++)
             * {
             *  diceRoller2.InsertDie(new Die(6,randomGenerator));
             * }
             * diceRoller2.RollAllDice();
             * IList<int> results2 = diceRoller2.GetRollingResults();
             * foreach (int result in results2)
             * {
             *  Console.WriteLine(result);
             * }*/
        }
        static void Main(string[] args)
        {
            int dices = 20;

            DiceRoller roller = new DiceRoller();

            for (int i = 0; i < dices; i++)
            {
                roller.InsertDie(new Die(8));
            }

            roller.RollAllDice();

            roller.GetRollingResults();
            for (int i = 0; i < roller.GetRollingResults().Count; i++)
            {
                Console.WriteLine(roller.GetRollingResults().ElementAt(i));
            }
        }
示例#7
0
        static void Main(string[] args)
        {
            ConsoleLogger consoleLogger   = new ConsoleLogger();
            FileLogger    fileLogger      = new FileLogger(@"D:/LV_DOOP/LV/LV2/proba.txt");
            DiceRoller    diceRoller      = new DiceRoller();
            int           numberOfObjects = 20;

            for (int i = 0; i < numberOfObjects; i++)
            {
                diceRoller.InsertDie(new Die(6));
            }
            diceRoller.RollAllDice();
            //Zadatak 3
            //diceRoller.rollingPrint(diceRoller.GetRollingResults());

            //Zadatak 4
            //diceRoller.LogRollingResults();
            consoleLogger.Log(diceRoller);
            fileLogger.Log(diceRoller);
        }
示例#8
0
        static void Main(string[] args)
        {
            DiceRoller diceRoller      = new DiceRoller();
            Random     randomGenerator = new Random();

            for (int i = 0; i < 200; i++)
            {
                //Die die = new Die(6);
                //Die die = new Die(6, randomGenerator);
                Die die = new Die(6);
                diceRoller.InsertDie(die);
            }
            diceRoller.RollAllDice();
            IList <int> rollingResults = diceRoller.GetRollingResults();

            foreach (int dice in rollingResults)
            {
                Console.WriteLine(dice);
            }
        }