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

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

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