Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Game
- {
- class Program
- {
- static void Main(string[] args)
- {
- double money = 100; // това са пари, които ще ги взимаме от Main метода!!
- int numbersBet = 0;
- double moneyForBet = 0;
- int number = 0;
- int[] number0_36 = new int[37];
- int r = 0;
- double[] betNumber0_36 = new double[37];
- bool winOrNo = false;
- bool YNA = false;
- bool RTY = false;
- while (true)
- {
- Console.WriteLine("What will you bet on?");
- Console.Write("|For numbers, press 1| ");
- Console.Write("|For sectors, press 2| ");
- Console.Write("|For quiting the game, press 3| \n");
- int n = int.Parse(Console.ReadLine()); // избираш на какво да залагаш дали на числа или на сектори!!
- if (n == 1)
- {
- while (true)
- {
- YNA = false;
- Console.WriteLine("How much money you bet on a number?");
- Console.WriteLine("The game has accepted bets from:");
- Console.WriteLine("|0.1| |0.2| |0.5| |1.0| |5.0| |10|");
- moneyForBet = double.Parse(Console.ReadLine()); // избираш с колко ще залагаш на число!!
- if (moneyForBet != 0.1 && moneyForBet != 0.2 && moneyForBet != 0.5 && moneyForBet != 1
- && moneyForBet != 5 && moneyForBet != 10)
- {
- Console.WriteLine("The game does not work with that amount");
- Console.WriteLine("Please enter new bet\n");
- continue;
- }
- if (moneyForBet > money)
- {
- Console.WriteLine("You don't have enough money");
- while (true)
- {
- Console.WriteLine("You want to make a new bet |Y| or quit this game |N|");
- string continueYN = Console.ReadLine();
- if (continueYN == "Y")
- {
- break;
- }
- else if (continueYN == "N")
- {
- Console.WriteLine("Thanks for playing!");
- return;
- }
- else
- {
- Console.WriteLine("Invalid command");
- continue;
- }
- }
- }
- while (true)
- {
- Console.WriteLine("What number do you want to bet on?");
- number = int.Parse(Console.ReadLine()); // числото на което изкаш да залагаш!!
- number0_36[r] = number;
- if (number > 36 || number < 0)
- {
- Console.WriteLine("Invalid number");
- Console.WriteLine("You can only bet from [0-36] !!");
- continue;
- }
- else
- {
- break;
- }
- }
- while (true)
- {
- Console.WriteLine("How many times you bet on that number?");
- numbersBet = int.Parse(Console.ReadLine()); // колко пъти искаш да заложиш на това число!!
- if (numbersBet * moneyForBet > money)
- {
- Console.WriteLine("You don't have enough money");
- while (true)
- {
- Console.WriteLine("You want to make a new times bet |Y| or quit this game |N|");
- string continueYN = Console.ReadLine();
- if (continueYN == "Y")
- {
- break;
- }
- else if (continueYN == "N")
- {
- Console.WriteLine("Thanks for playing!");
- return;
- }
- else
- {
- Console.WriteLine("Invalid command");
- continue;
- }
- }
- }
- else
- {
- break;
- }
- }
- money -= numbersBet * moneyForBet;
- betNumber0_36[r] = numbersBet * moneyForBet;
- int g = 0;
- while (g == 0)
- {
- Console.WriteLine("Do you want to bet on another number or start spining?");
- Console.WriteLine("|Y| |N|");
- string anotherBet = Console.ReadLine(); // дали искаш да залагаш на други числа!!
- if (anotherBet == "Y")
- {
- r++;
- YNA = true;
- break;
- }
- else if (anotherBet != "N")
- {
- Console.WriteLine("Invalid command");
- continue;
- }
- else
- {
- Console.WriteLine("Your bet is accepted");
- g++;
- }
- }
- if (YNA)
- {
- continue;
- }
- Random rnd = new Random();
- int numberInTheRoulette = rnd.Next(37);
- Console.WriteLine($"The number is {numberInTheRoulette}!!");
- for (int i = 0; i <= r; i++)
- {
- if (number0_36[r] == numberInTheRoulette)
- {
- Console.WriteLine("You win congratulations!");
- money += betNumber0_36[r] * 36;
- Console.WriteLine($"Your profit is {betNumber0_36[r] * 36} lv!!");
- winOrNo = true;
- }
- }
- if (!winOrNo)
- {
- Console.WriteLine("No luck next time D:");
- }
- winOrNo = false;
- while (true)
- {
- Console.WriteLine("Do you wana play agin? |Y| or |N|");
- string YN = Console.ReadLine();
- if (YN == "Y")
- {
- RTY = true;
- break;
- }
- if (YN == "N")
- {
- Console.WriteLine("Thanks for playing!");
- return;
- }
- else
- {
- Console.WriteLine("invalid command!");
- }
- }
- if (RTY)
- {
- RTY = false;
- break;
- }
- }
- }
- else if (n == 2)
- {
- }
- else if (n == 3)
- {
- Console.WriteLine("Thanks for playing!");
- return;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement