예제 #1
0
        }//works

        public void IsLowHighWin(SpinWheel spinWheel, LowHigh lowHighBet, Board[,] rouletteBoard)
        {
            if (rouletteBoard[spinWheel.winningColumn, spinWheel.winningRow].number > 18 &&
                rouletteBoard[spinWheel.winningColumn, spinWheel.winningRow].number <= 36 &&
                lowHighBet.high == true)
            {
                Console.WriteLine("Your high bet won");
            }
            else if (rouletteBoard[spinWheel.winningColumn, spinWheel.winningRow].number >= 1 &&
                     rouletteBoard[spinWheel.winningColumn, spinWheel.winningRow].number <= 18 &&
                     lowHighBet.high == false)
            {
                Console.WriteLine("Your low bet won");
            }
            else
            {
                Console.WriteLine("Your low high bet did not win");
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: zmil44/Roulette
        static void Main(string[] args)
        {
            var                        rouletteBoard              = CreateBoard();
            Random                     rng                        = new Random();
            GetBet                     getBet                     = new GetBet();
            SpecificNumberBet          specificNumberBet          = new SpecificNumberBet();
            EvenOrOdd                  evenOrOddBet               = new EvenOrOdd();
            ColorBet                   colorBet                   = new ColorBet();
            LowHigh                    lowHighBet                 = new LowHigh();
            Dozen                      dozenBet                   = new Dozen();
            Columns                    columnBet                  = new Columns();
            Rows                       rowBet                     = new Rows();
            DoubleRows                 doubleRowBet               = new DoubleRows();
            Split                      splitBet                   = new Split();
            Corner                     cornerBet                  = new Corner();
            SpinWheel                  spinWheel                  = new SpinWheel(rng);
            DetermineWin               determineWin               = new DetermineWin();
            DisplayPossibleWinningBets displayPossibleWinningBets = new DisplayPossibleWinningBets();
            DisplayWinningBin          displayWinningBin          = new DisplayWinningBin();
            int                        categoryChoice;

            //for (int i = 0; i < 100; i++)
            //{
            //    doubleRowBet.row1= 1;
            //    doubleRowBet.row2 = 2;
            //    spinWheel.Spin();
            //    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
            //    determineWin.IsDoubleRowsWin(spinWheel, doubleRowBet);
            //    Console.ReadLine();
            //    Console.Clear();
            //}
            do
            {
                DisplayBoard(rouletteBoard);
                getBet.DisplayPossibleBets();
                categoryChoice = getBet.GetBetCategoryChoice();
                switch (categoryChoice)
                {
                case 0:
                {
                    break;
                }

                case 1:
                {
                    specificNumberBet.numberBettingOn = getBet.GetNumberBet();
                    spinWheel.Spin();
                    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
                    determineWin.IsSpecificNumberWin(spinWheel, specificNumberBet, rouletteBoard);
                    displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard);
                    break;
                }

                case 2:
                {
                    colorBet.colorBettingOn = getBet.GetColorBet();
                    spinWheel.Spin();
                    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
                    determineWin.IsRedBlackWin(spinWheel, colorBet, rouletteBoard);
                    displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard);
                    break;
                }

                case 3:
                {
                    evenOrOddBet.evenOrOdd = getBet.EvensOdds();
                    spinWheel.Spin();
                    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
                    determineWin.IsEvenOddsWin(spinWheel, evenOrOddBet, rouletteBoard);
                    displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard);
                    break;
                }

                case 4:
                {
                    lowHighBet.high = getBet.LowHighBet();
                    spinWheel.Spin();
                    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
                    determineWin.IsLowHighWin(spinWheel, lowHighBet, rouletteBoard);
                    displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard);
                    break;
                }

                case 5:
                {
                    dozenBet.dozen = getBet.DozensBet();
                    spinWheel.Spin();
                    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
                    determineWin.IsDozensWin(spinWheel, rouletteBoard, dozenBet);
                    displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard);
                    break;
                }

                case 6:
                {
                    columnBet.column = getBet.ColumnBet();
                    spinWheel.Spin();
                    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
                    determineWin.IsColumnsWin(spinWheel, columnBet);
                    displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard);
                    break;
                }

                case 7:
                {
                    rowBet.row = getBet.RowBet();
                    spinWheel.Spin();
                    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
                    determineWin.IsRowWin(spinWheel, rowBet);
                    displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard);
                    break;
                }

                case 8:
                {
                    getBet.DoubleRowBet(doubleRowBet);
                    spinWheel.Spin();
                    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
                    determineWin.IsDoubleRowsWin(spinWheel, doubleRowBet);
                    displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard);
                    break;
                }

                case 9:
                {
                    getBet.SplitBet(splitBet);
                    spinWheel.Spin();
                    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
                    determineWin.IsSplitWin(spinWheel, splitBet, rouletteBoard);
                    displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard);
                    break;
                }

                case 10:
                {
                    getBet.CornerBet(cornerBet);
                    spinWheel.Spin();
                    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
                    determineWin.IsCornerWin(spinWheel, cornerBet, rouletteBoard);
                    displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard);
                    break;
                }
                }
                Console.WriteLine("Hit enter to continue");
                Console.ReadLine();
                Console.Clear();
            } while (categoryChoice != 0);
        }
예제 #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to Digital Roulette.");
            Console.WriteLine("If you don't know how to play start by making a selection below and rules will be explained as you go.");

            while (true)
            {
                Console.WriteLine("Please select a number in acordance to the type of bet you would like to place.");
                Console.WriteLine(@"
                1. Single Number
                2. Even or Odd Number
                3. Red or Black Numbers
                4. Low or High Numbers
                5. Groups of 12 Numbers
                6. Column of Numbers
                7. Street of Numbers
                8. Groups of 6 Numbers
                9. Split, any 2 contiguous Numbers
                10. Corner, any intersection of 4 contiguous Numbers" @);

                int type = Convert.ToInt32(Console.ReadLine());

                if (type == 1)
                {
                    Number num = new Number();
                    num.One();
                }
                else if (type == 2)
                {
                    EvenOdd evenOdd = new EvenOdd();
                    evenOdd.EvOd();
                }
                else if (type == 3)
                {
                    RedBlack redBlack = new RedBlack();
                    redBlack.Color();
                }
                else if (type == 4)
                {
                    LowHigh lowHigh = new LowHigh();
                    lowHigh.loHi();
                }
                else if (type == 5)
                {
                    Dozens dozens = new Dozens();
                    dozens.Doz();
                }
                else if (type == 6)
                {
                    Columns columns = new Columns();
                    columns.Col();
                }
                else if (type == 7)
                {
                    Street street = new Street();
                    street.St();
                }
                else if (type == 8)
                {
                    HalfDozen halfDozen = new HalfDozen();
                    halfDozen.Half();
                }
                else if (type == 9)
                {
                    Split split = new Split();
                    split.Twos();
                }
                else if (type == 10)
                {
                    Corner corner = new Corner();
                    corner.Fours();
                }

                Console.WriteLine("Would you like to make another bet?         (y/n)");
                string replay = Console.ReadLine();

                if (replay == "n")
                {
                    Console.WriteLine("Thank you for playing.");
                    break;
                }

                Console.Clear();
            }
        }
예제 #4
0
        //Program p = new Program();
        public void playerMenu()
        {
            userPot = 5000;
            while (playAgain == true)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("1) Bet on a number");
                Console.WriteLine("2) Bet on EVENZ or ODDZ");
                Console.WriteLine("3) Bet on RED or BLACK");
                Console.WriteLine("4) Bet on LOWZ or HIGHZ");
                Console.WriteLine("5) Bet on DOZENZ");
                Console.WriteLine("6) Bet on COLUMNZ");
                Console.WriteLine("7) Bet on STREETZ");
                Console.WriteLine("8) Bet on SETS of SIX");
                Console.WriteLine("9) Bet on CORNERZ");
                Console.WriteLine("10)Bet on Zeros");
                Console.ForegroundColor = ConsoleColor.White;

                int i = int.Parse(Console.ReadLine());
                switch (i)
                {
                case 1:
                    Number n = new Number(this);
                    n.NumberBet();
                    break;

                case 2:
                    EvenOdd e = new EvenOdd(this);
                    e.EvenOrOddBet();
                    break;

                case 3:
                    RedBlack r = new RedBlack(this);
                    r.RedOrBlackbet();
                    break;

                case 4:
                    LowHigh l = new LowHigh(this);
                    l.LowOrHighBet();
                    break;

                case 5:
                    Dozens d = new Dozens(this);
                    d.DozensBet();
                    break;

                case 6:
                    Columns c = new Columns(this);
                    c.ColumnsBet();
                    break;

                case 7:
                    Streets s = new Streets(this);
                    s.StreetsBet();
                    break;

                case 8:
                    Sixes x = new Sixes(this);
                    x.SetsOfSixBet();
                    break;

                case 9:
                    Corners a = new Corners(this);
                    a.ConersBet();
                    break;

                case 10:
                    Zero z = new Zero(this);
                    z.Zeros();
                    break;

                default:
                    Console.WriteLine("Please enter a valid bet");
                    break;
                }
                Console.WriteLine("Do you want to Bet again? y/n");
                var userInput = Console.ReadLine();
                if (userInput == "y")
                {
                    playAgain = true;
                }
                else if (userInput == "n")
                {
                    playAgain = false;
                }
            }
        }