Ejemplo n.º 1
0
 public void DozensWin(SpinTheWheel spin, Dozens dozen, Board[] rouletteBoard)
 {
     if (((rouletteBoard[spin.winningNumber].number > 0) && (rouletteBoard[spin.winningNumber].number <= 12) && (dozen.dozenChoice == 1)))
     {
         Console.WriteLine("You Won!");
     }
     else if (((rouletteBoard[spin.winningNumber].number >= 13) && (rouletteBoard[spin.winningNumber].number <= 24) && (dozen.dozenChoice == 2)))
     {
         Console.WriteLine("You Won!");
     }
     else if (((rouletteBoard[spin.winningNumber].number >= 25) && (rouletteBoard[spin.winningNumber].number <= 36) && (dozen.dozenChoice == 3)))
     {
         Console.WriteLine("You Won!");
     }
     else
     {
         Console.WriteLine("You did not win.");
     }
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("EX 8A - C# - Roulette");
            Console.WriteLine("David Perez - 08/22/2020\n");

            int    luckyColorIndex = Wheel.ColorIndex();
            string luckyColor      = Wheel.NumberColors[luckyColorIndex];
            string luckyNumber     = Wheel.GetNumber(luckyColor);

            Console.WriteLine($"Your ball landed in {luckyColor}: {luckyNumber}.");
            Console.WriteLine($"Evens or Odds bet: {EvensOdds.PlayEvensOdds(luckyNumber)}!");
            Console.WriteLine($"Reds or Blacks bet: {RedsBlacks.PlayRedsBlacks(luckyColor)}!");
            Console.WriteLine($"Lows or Highs bet: {LowsHighs.PlayLowHighs(luckyNumber)}!");
            Console.WriteLine($"Dozens bet: {Dozens.PlayDozens(luckyNumber)}!");
            Console.WriteLine($"Columns bet: {Columns.PlayColumns(luckyNumber)}!");
            Console.WriteLine($"Streets bet: {Streets.PlayStreets(luckyNumber)}!");
            Console.WriteLine($"6 Numbers bet: {SixNumbers.PlaySixNumbers(luckyNumber)}!");
            Console.WriteLine($"Split bet: {Split.PlaySplits(luckyNumber)}!");
            Console.WriteLine($"Corner bet: {Corner.PlayCorners(luckyNumber)}");
        }
Ejemplo n.º 3
0
        //Weather weather;
        public void Play()
        {
            bool   play;
            string playAgain;

            //Moved this to the opening screen in program.
            //weather = new Weather();
            //weather.SetRealWeatherAsync();

            while (play = true && Player.money > 0)
            {
                Console.Clear();
                DisplayTable();
                WriteText.WriteLine("");
                WriteText.WriteLine("");
                WriteText.WriteLine("");

                //Console.WriteLine("The Temperture today is {0} degrees and {1} today.", weather.Temperature, weather.WeatherEffect);
                WriteText.WriteLine($"Choose a number cooresponding to the bet you'd like to make\n" +
                                    $"1: bet on a number(1/36 odds)\t 2: Even or Odds(1/2 odds)\t 3: Red or Black(1/2 odds)\n" +
                                    $"4: Lows or Highs(1/2 odds)\t 5: Dozens(1/3 odds)\t 6: Column bet(1/3 odds)\n" +
                                    $"7: Street(1/12 odds)\t 8: six-line(1/6 odds)\t 9: Split(1/18 odds)\n" +
                                    $"10: Corner bet(1/9 odds)", ConsoleColor.Green);
                int chosenBet = Int32.Parse(Console.ReadLine());
                if (chosenBet > 10)
                {
                    throw new IndexOutOfRangeException("You chose a number that does not correspond with any of the bets.");
                }
                if (chosenBet == 1)
                {
                    Number number = new Number();
                    number.NumbersBet(Spin());
                }
                if (chosenBet == 2)
                {
                    EvenOrOdd evenorodd = new EvenOrOdd();
                    evenorodd.EvenOrOddBet(Spin());
                }
                if (chosenBet == 3)
                {
                    RedOrBlack redorblack = new RedOrBlack();
                    redorblack.RedOrBlackBet(Spin());
                }
                if (chosenBet == 4)
                {
                    LowsHighs loworhigh = new LowsHighs();
                    loworhigh.LowOrHighBet(Spin());
                }
                if (chosenBet == 5)
                {
                    Dozens dozens = new Dozens();
                    dozens.DozensBet(Spin());
                }
                if (chosenBet == 6)
                {
                    Columns columns = new Columns();
                    columns.ColumnBet(Spin());
                }
                if (chosenBet == 7)
                {
                    Street street = new Street();
                    street.StreetBet(Spin());
                }
                if (chosenBet == 8)
                {
                    SixLine sixLine = new SixLine();
                    sixLine.SixLineBet(Spin());
                }
                if (chosenBet == 9)
                {
                    Split split = new Split();
                    split.SplitBet(Spin());
                }
                if (chosenBet == 10)
                {
                    Corner corner = new Corner();
                    corner.CornerBet(Spin());
                }
                if (Player.money == 0)
                {
                    play = false;
                    WriteText.WriteLine("Thank you for playing. Good bye.", ConsoleColor.Red);
                    Console.ReadKey();
                }
                if (Player.money > 0)
                {
                    WriteText.WriteLine("Would you like to play again (yes/no): ", ConsoleColor.Red);
                    playAgain = Console.ReadLine();
                    playAgain.ToLower();
                    if (playAgain == "yes")
                    {
                        play = true;
                        Random random = new Random();
                        int    phrase = random.Next(1, 3);
                        if (phrase == 1)
                        {
                            WriteText.WriteLine("You'll certainly win more this time!", ConsoleColor.Red);
                        }
                        if (phrase == 2)
                        {
                            WriteText.WriteLine("Ah you like to live life on the edge. Fantastic lets play again!", ConsoleColor.Red);
                        }
                        if (phrase == 3)
                        {
                            WriteText.WriteLine("Luck is for the unskilled. You must be a very lucky person.", ConsoleColor.Red);
                        }
                    }
                    else if (playAgain == "no")
                    {
                        play = false;
                        WriteText.WriteLine("Thank you for playing. Good bye.", ConsoleColor.Red);
                        Console.ReadKey();
                    }
                }
            }
        }
Ejemplo n.º 4
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.º 5
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.º 6
0
        static void Main(string[] args)
        {
            int Funds = 500;

            do
            {
Start:
                Console.WriteLine($"You have ${Funds}.");

                Console.WriteLine("Place your bet!");

                Console.WriteLine("[1 for Numbers]-[2 for Evens/Odds]-[3 for Reds/Blacks]-[4 for Lows/Highs]-[5 for Dozens]\n" +
                                  "[6 for Columns]-[7 for Street]-[8 for 6 Numbers]-[9 for Split]-[10 for Corner]-[0 to Quit]");
                string UserInput = Console.ReadLine();

                if (UserInput == "1")
                {
                    Console.WriteLine("The payout is 35:1.");
                    Numbers n = new Numbers();
                    Funds = n.NumbersBet(Funds);
                }
                if (UserInput == "2")
                {
                    Console.WriteLine("The payout is 1:1.");
                    EvensOdds e = new EvensOdds();
                    Funds = e.EvensOddsBet(Funds);
                }
                if (UserInput == "3")
                {
                    Console.WriteLine("The payout is 1:1.");
                    RedsBlacks r = new RedsBlacks();
                    Funds = r.RedsBlacksBet(Funds);
                }
                if (UserInput == "4")
                {
                    Console.WriteLine("The payout is 1:1.");
                    LowsHighs l = new LowsHighs();
                    Funds = l.LowsHighsBet(Funds);
                }
                if (UserInput == "5")
                {
                    Console.WriteLine("The payout is 2:1.");
                    Dozens d = new Dozens();
                    Funds = d.DozensBet(Funds);
                }
                if (UserInput == "6")
                {
                    Console.WriteLine("The payout is 2:1.");
                    Columns c = new Columns();
                    Funds = c.ColumnsBet(Funds);
                }
                if (UserInput == "7")
                {
                    Console.WriteLine("The payout is 11:1.");
                    Street s = new Street();
                    Funds = s.StreetBet(Funds);
                }
                if (UserInput == "8")
                {
                    Console.WriteLine("The payout is 5:1.");
                    SixNumbers s = new SixNumbers();
                    Funds = s.SixNumbersBet(Funds);
                }
                if (UserInput == "9")
                {
                    Console.WriteLine("The payout is 17:1.");
                    Split s = new Split();
                    Funds = s.SplitBet(Funds);
                }
                if (UserInput == "10")
                {
                    Console.WriteLine("The payout is 8:1.");
                    Corner c = new Corner();
                    Funds = c.CornerBet(Funds);
                }
                if (UserInput == "0")
                {
                    Console.WriteLine("Thanks for playing!");
                    Environment.Exit(0);
                }
                else
                {
                    if (Funds == 0)
                    {
                        Console.WriteLine("No money!? You don't have to go home, but you can't stay here...");
                        Environment.Exit(0);
                    }
                    goto Start;
                }
            }while (Funds >= 1);
        }
Ejemplo n.º 7
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.º 8
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;
                }
            }
        }