Ejemplo n.º 1
0
 public void EvenOddWin(SpinTheWheel spin, EvenOdd evenOdd, Board[] rouletteBoard)
 {
     if (rouletteBoard[spin.winningNumber].number == evenOdd.evenOddChoice)
     {
         Console.WriteLine("You Won!");
     }
     else
     {
         Console.WriteLine("You did not win.");
     }
 }
Ejemplo n.º 2
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();
            }
        }
Ejemplo n.º 3
0
        public void NewGame(Random random, decimal money)
        {
            ConsoleKeyInfo cki;

            // Prevent example from ending if CTL+C is pressed.
            do
            {
                Menu.ClearForFeedback();
                Console.WriteLine(" Where will you place your bet?");
                Console.Write("  " +
                              "1: 1 #                   " +
                              "\t2: Between #'s         " +
                              "\t3: 6 #'s               " +
                              "\t4: 12 #'s              " +
                              "");
                Console.WriteLine("");
                Console.Write("  " +
                              "5: 3 # Street            " +
                              "\t6: Low/High #'s        " +
                              "\t7: Even or Odd #'s     " +
                              "\t8: Red or BLack");
                Console.WriteLine("\n Press Esc to Exit\n");
                Console.Write("$");

                cki = Console.ReadKey();
                if (cki.Key == ConsoleKey.D1)
                {
                    var pick = new PickNum();
                    money += pick.UserLoop(random, money);
                }
                else if (cki.Key == ConsoleKey.D2)
                {
                    var between = new BetweenNum();
                    money += between.UserLoop(random, money);
                }
                else if (cki.Key == ConsoleKey.D3)
                {
                    var six = new SixNum();
                    money += six.UserLoop(random, money);
                }
                else if (cki.Key == ConsoleKey.D4)
                {
                    var columns = new TwelveNum();
                    money += columns.UserLoop(random, money);
                }
                else if (cki.Key == ConsoleKey.D5)
                {
                    var three = new ThreeNum();
                    money += three.UserLoop(random, money);
                }
                else if (cki.Key == ConsoleKey.D6)
                {
                    var half = new HalfNum();
                    money += half.UserLoop(random, money);
                }
                else if (cki.Key == ConsoleKey.D7)
                {
                    var even = new EvenOdd();
                    money += even.UserLoop(random, money);
                }
                else if (cki.Key == ConsoleKey.D8)
                {
                    var red = new RedBlack();
                    money += red.UserLoop(random, money);
                }
                else
                {
                    Menu.UserFeedback("Invalid input.. \n Try again..");
                    continue;
                }

                Menu.AfterInput();
            } while (money != 100 || cki.Key != ConsoleKey.Escape);
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            var               rouletteBoard = RouletteBoard.CreateBoard();
            NumberBet         number        = new NumberBet();
            EvenOdd           evenOdd       = new EvenOdd();
            Colors            color         = new Colors();
            HighLow           highLow       = new HighLow();
            Dozens            dozen         = new Dozens();
            Columns           column        = new Columns();
            Streets           street        = new Streets();
            Random            rand          = new Random();
            DisplayWinner     winner        = new DisplayWinner();
            SpinTheWheel      wheel         = new SpinTheWheel();
            UserBet           bet           = new UserBet();
            DisplayBetOutcome result        = new DisplayBetOutcome();

            bet.DisplayTypeOfBet();
            bet.TypeOfBet();
            if (bet.userSelect == 1)
            {
                wheel.Spin(rand);
                winner.DisplayResult(wheel, rouletteBoard);
                result.IndividualNumberWin(wheel, number, rouletteBoard);
            }
            else if (bet.userSelect == 2)
            {
                wheel.Spin(rand);
                winner.DisplayResult(wheel, rouletteBoard);
                result.EvenOddWin(wheel, evenOdd, rouletteBoard);
            }
            else if (bet.userSelect == 3)
            {
                wheel.Spin(rand);
                winner.DisplayResult(wheel, rouletteBoard);
                result.RedBlackWin(wheel, color, rouletteBoard);
            }
            else if (bet.userSelect == 4)
            {
                wheel.Spin(rand);
                winner.DisplayResult(wheel, rouletteBoard);
                result.LowHighWin(wheel, highLow, rouletteBoard);
            }
            else if (bet.userSelect == 5)
            {
                wheel.Spin(rand);
                winner.DisplayResult(wheel, rouletteBoard);
                result.DozensWin(wheel, dozen, rouletteBoard);
            }
            else if (bet.userSelect == 6)
            {
                wheel.Spin(rand);
                winner.DisplayResult(wheel, rouletteBoard);
                result.ColumnsWin(wheel, column, rouletteBoard);
            }
            else if (bet.userSelect == 7)
            {
                wheel.Spin(rand);
                winner.DisplayResult(wheel, rouletteBoard);
                result.StreetWin(wheel, street, rouletteBoard);
            }
        }
Ejemplo n.º 5
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;
                }
            }
        }
Ejemplo n.º 6
0
        public void Run()
        {
            Table table = new Table();

            table.Coloring();
            Numbers   numbers    = new Numbers();
            EvenOdd   evenOdd    = new EvenOdd();
            RedBlack  redsBlacks = new RedBlack();
            HighLow   highLow    = new HighLow();
            Dozens    dozens     = new Dozens();
            Column    column     = new Column();
            Street    street     = new Street();
            SixNumber sixNumber  = new SixNumber();
            Split     split      = new Split();
            Corner    corner     = new Corner();

            ConsoleKeyInfo cki;

            Console.WriteLine("\nHow would you like to bet: ");
            Console.WriteLine("\n1. Straight Bet\t2. Evens/Odds\t3. Reds/Blacks\t4. Lows/Highs\t5. Dozens\n\n" +
                              "6. Columns\t7. Street\t8. 6 Numbers\t9. Split\t0. Corner");

            for (int i = 0; i < 10; i++)
            {
                cki = Console.ReadKey(true);
                switch (cki.Key)
                {
                case ConsoleKey.D1:
                    numbers.WinOne();
                    break;

                case ConsoleKey.D2:
                    Console.WriteLine("\nE: Even\t\tO: Odd");
                    cki = Console.ReadKey(true);
                    if (cki.Key == ConsoleKey.E)
                    {
                        evenOdd.WinOne();
                    }
                    else if (cki.Key == ConsoleKey.O)
                    {
                        evenOdd.WinTwo();
                    }
                    else
                    {
                        Console.WriteLine("Invalid Input");
                    }
                    break;

                case ConsoleKey.D3:
                    Console.WriteLine("\nPick a color\n");
                    Console.WriteLine("R: Red\t\tB: Black");
                    cki = Console.ReadKey(true);
                    if (cki.Key == ConsoleKey.R)
                    {
                        redsBlacks.WinOne();
                    }
                    else if (cki.Key == ConsoleKey.B)
                    {
                        redsBlacks.WinTwo();
                    }
                    else
                    {
                        Console.WriteLine("Invalid Input");
                    }
                    break;

                case ConsoleKey.D4:
                    Console.WriteLine("\nL: 1-18\t\tH: 19-36");
                    cki = Console.ReadKey(true);
                    if (cki.Key == ConsoleKey.L)
                    {
                        highLow.WinOne();
                    }
                    else if (cki.Key == ConsoleKey.H)
                    {
                        highLow.WinTwo();
                    }
                    else
                    {
                        Console.WriteLine("Invalid Input");
                    }
                    break;

                case ConsoleKey.D5:
                    Console.WriteLine("\nF: 1-12\tS: 13-24\tT: 25-36");
                    cki = Console.ReadKey(true);
                    if (cki.Key == ConsoleKey.F)
                    {
                        dozens.WinOne();
                    }
                    else if (cki.Key == ConsoleKey.S)
                    {
                        dozens.WinTwo();
                    }
                    else if (cki.Key == ConsoleKey.T)
                    {
                        dozens.WinThree();
                    }
                    else
                    {
                        Console.WriteLine("Invalid Input");
                    }
                    break;

                case ConsoleKey.D6:
                    column.WinOne();
                    break;

                case ConsoleKey.D7:
                    street.WinOne();
                    break;

                case ConsoleKey.D8:
                    sixNumber.WinOne();
                    break;

                case ConsoleKey.D9:
                    split.WinOne();
                    break;

                case ConsoleKey.D0:
                    corner.WinOne();
                    break;
                }
            }
        }