示例#1
0
        private void Streets(RouletteWheel rouletteWheel)
        {
            double hold      = rouletteWheel.randomNumber / 3d;
            double rowNumber = Math.Ceiling(hold);

            Console.WriteLine($"Those who bet on row {rowNumber}.");
        }
示例#2
0
 private void LowsHighs(RouletteWheel rouletteWheel)
 {
     if (rouletteWheel.randomNumber > 19)
     {
         Console.WriteLine("Those who bet low.");
     }
     else
     {
         Console.WriteLine("Those who bet high.");
     }
 }
示例#3
0
 private void Colors(RouletteWheel rouletteWheel)
 {
     if (rouletteWheel.color == "red")
     {
         Console.WriteLine("Those who bet on red.");
     }
     else
     {
         Console.WriteLine("Those who bet on black.");
     }
 }
示例#4
0
 private void EvenOddNumbers(RouletteWheel rouletteWheel)
 {
     if (rouletteWheel.randomNumber % 2 == 0)
     {
         Console.WriteLine("Those who bet on evens.");
     }
     else
     {
         Console.WriteLine("Those who bet on odds.");
     }
 }
示例#5
0
        private void SixNumbers(RouletteWheel rouletteWheel)
        {
            double hold      = rouletteWheel.randomNumber / 3d;
            double rowNumber = Math.Ceiling(hold);

            if (rowNumber > 1)
            {
                Console.WriteLine($"Those who bet on the 6 numbers in row {rowNumber - 1} and {rowNumber}.");
            }
            if (rowNumber < 12)
            {
                Console.WriteLine($"Those who bet on the 6 numbers in row {rowNumber} and {rowNumber + 1}.");
            }
        }
示例#6
0
 private void Columns(RouletteWheel rouletteWheel)
 {
     if (rouletteWheel.randomNumber % 3 == 0)
     {
         Console.WriteLine("Those who bet on the third column.");
     }
     else if (rouletteWheel.randomNumber % 3 == 2)
     {
         Console.WriteLine("Those who bet on the second column.");
     }
     else
     {
         Console.WriteLine("Those who bet on the first column.");
     }
 }
示例#7
0
 private void Dozens(RouletteWheel rouletteWheel)
 {
     if (rouletteWheel.randomNumber >= 12)
     {
         Console.WriteLine("Those who bet on the first dozen.");
     }
     else if (rouletteWheel.randomNumber <= 24 && rouletteWheel.randomNumber >= 13)
     {
         Console.WriteLine("Those who bet on the second dozen.");
     }
     else
     {
         Console.WriteLine("Those who bet on the third dozen.");
     }
 }
示例#8
0
        private void Split(RouletteWheel rouletteWheel)
        {
            double hold      = rouletteWheel.randomNumber / 3d;
            double rowNumber = Math.Ceiling(hold);

            if (rouletteWheel.randomNumber % 3 == 0)
            {
                Console.WriteLine($"Those who bet on the {rouletteWheel.randomNumber}/{rouletteWheel.randomNumber - 1} split.");
                if (rowNumber > 1)
                {
                    Console.WriteLine($"Those who bet on the {rouletteWheel.randomNumber}/{rouletteWheel.randomNumber - 3} split.");
                }
                if (rowNumber < 12)
                {
                    Console.WriteLine($"Those who bet on the {rouletteWheel.randomNumber}/{rouletteWheel.randomNumber + 3} split.");
                }
            }
            else if (rouletteWheel.randomNumber % 3 == 2)
            {
                Console.WriteLine($"Those who bet on the {rouletteWheel.randomNumber}/{rouletteWheel.randomNumber - 1} split.");
                if (rowNumber > 1)
                {
                    Console.WriteLine($"Those who bet on the {rouletteWheel.randomNumber}/{rouletteWheel.randomNumber - 3} split.");
                }
                if (rowNumber < 12)
                {
                    Console.WriteLine($"Those who bet on the {rouletteWheel.randomNumber}/{rouletteWheel.randomNumber + 3} split.");
                }
                Console.WriteLine($"Those who bet on the {rouletteWheel.randomNumber}/{rouletteWheel.randomNumber + 1} split.");
            }
            else
            {
                if (rowNumber > 1)
                {
                    Console.WriteLine($"Those who bet on the {rouletteWheel.randomNumber}/{rouletteWheel.randomNumber - 3} split.");
                }
                if (rowNumber < 12)
                {
                    Console.WriteLine($"Those who bet on the {rouletteWheel.randomNumber}/{rouletteWheel.randomNumber + 3} split.");
                }
                Console.WriteLine($"Those who bet on the {rouletteWheel.randomNumber}/{rouletteWheel.randomNumber + 1} split.");
            }
        }
示例#9
0
        private void Corner(RouletteWheel rouletteWheel)
        {
            double hold      = rouletteWheel.randomNumber / 3d;
            double rowNumber = Math.Ceiling(hold);

            if (rouletteWheel.randomNumber % 3 == 0)
            {
                if (rowNumber > 1)
                {
                    Console.WriteLine($"Those who bet on the corner of {rouletteWheel.randomNumber - 4}/{rouletteWheel.randomNumber - 3}/{rouletteWheel.randomNumber - 1}/{rouletteWheel.randomNumber}.");
                }
                if (rowNumber < 12)
                {
                    Console.WriteLine($"Those who bet on the corner of {rouletteWheel.randomNumber - 1}/{rouletteWheel.randomNumber}/{rouletteWheel.randomNumber + 2}/{rouletteWheel.randomNumber + 3}.");
                }
            }
            else if (rouletteWheel.randomNumber % 3 == 2)
            {
                if (rowNumber > 1)
                {
                    Console.WriteLine($"Those who bet on the corner of {rouletteWheel.randomNumber - 4}/{rouletteWheel.randomNumber - 3}/{rouletteWheel.randomNumber - 1}/{rouletteWheel.randomNumber}.");
                    Console.WriteLine($"Those who bet on the corner of {rouletteWheel.randomNumber - 3}/{rouletteWheel.randomNumber - 2}/{rouletteWheel.randomNumber}/{rouletteWheel.randomNumber + 1}.");
                }
                if (rowNumber < 12)
                {
                    Console.WriteLine($"Those who bet on the corner of {rouletteWheel.randomNumber - 1}/{rouletteWheel.randomNumber}/{rouletteWheel.randomNumber + 2}/{rouletteWheel.randomNumber + 3}.");
                    Console.WriteLine($"Those who bet on the corner of {rouletteWheel.randomNumber + 1}/{rouletteWheel.randomNumber}/{rouletteWheel.randomNumber + 3}/{rouletteWheel.randomNumber + 4}.");
                }
            }
            else
            {
                if (rowNumber > 1)
                {
                    Console.WriteLine($"Those who bet on the corner of {rouletteWheel.randomNumber - 3}/{rouletteWheel.randomNumber - 2}/{rouletteWheel.randomNumber}/{rouletteWheel.randomNumber + 1}.");
                }
                if (rowNumber < 12)
                {
                    Console.WriteLine($"Those who bet on the corner of {rouletteWheel.randomNumber + 1}/{rouletteWheel.randomNumber}/{rouletteWheel.randomNumber + 3}/{rouletteWheel.randomNumber + 4}.");
                }
            }
        }
示例#10
0
 public void Analyze(RouletteWheel rouletteWheel)
 {
     if (rouletteWheel.randomNumber < 36)
     {
         Console.WriteLine("Winning bets are: ");
         IndividualNumbers(rouletteWheel);
         EvenOddNumbers(rouletteWheel);
         Colors(rouletteWheel);
         LowsHighs(rouletteWheel);
         Dozens(rouletteWheel);
         Columns(rouletteWheel);
         Streets(rouletteWheel);
         SixNumbers(rouletteWheel);
         Split(rouletteWheel);
         Corner(rouletteWheel);
     }
     else
     {
         Console.WriteLine("There are no winners.");
     }
 }
示例#11
0
 private void IndividualNumbers(RouletteWheel rouletteWheel)
 {
     Console.WriteLine($"Those who bet on {rouletteWheel.bin}.");
 }