Esempio n. 1
0
        public int RandomlySelectDoorWithPrize(int numberOfDoors)
        {
            GetRandomNumber randomNumberGenerator = new GetRandomNumber(new Random());
            int             doorWithPrizeNumber   = randomNumberGenerator.getRandomInt(0, numberOfDoors);

            return(doorWithPrizeNumber);
        }
Esempio n. 2
0
        public int RandomlySelectDoorWithPrize(int numberOfDoors, GetRandomNumber randomNumberGenerator)
        {
            int doorWithPrizeNumber = randomNumberGenerator.getRandomInt(0, numberOfDoors);

            return(doorWithPrizeNumber);
        }
Esempio n. 3
0
 public Monty(int numberOfDoors, GetRandomNumber randomNumberGenerator)
 {
     this.Doors = new Door[numberOfDoors];
     GenerateDoors(numberOfDoors, RandomlySelectDoorWithPrize(numberOfDoors, randomNumberGenerator));
 }