Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace SlotMachine
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = 1;
- int lenght = 31; //19
- int height = 14;
- for (int col = 1; col <= height; col++)
- {
- for (int row = 1; row <= lenght; row++)
- {
- Random random = new Random();
- int randomNumber = random.Next(1, 6);
- if ((row > 1 && row < lenght) && (col == 1 || col == 9 || col == 14))
- {
- Console.Write("-");
- continue;
- }
- if (((row == 1 || row == lenght) && col == 9)||
- ((row == 1 || row == lenght) && col == 1)||
- ((row == 1 | row == lenght) && col == 14))
- {
- Console.Write("+");
- continue;
- }
- if ((row == 1 || row == lenght) && (col > 1 || col >= 8))
- {
- Console.Write("|");
- continue;
- }
- if (row == 9 && (col == 2 || col <= 9) || row == 16 && (col == 2 || col <= 9) || row == 23 && (col == 2 || col <= 9))
- {
- Console.Write("|");
- continue;
- }
- if ((row == 2 && col == 4 || row <= 31 && col == 4)||
- (row == 2 && col == 6 || row <= 31 && col == 6)||
- (row == 2 && col == 8 || row <= 31 && col == 8)||
- (row == 2 && col == 2) || (row <= 31 && col == 2))
- {
- Console.Write("=");
- continue;
- }
- if (row == 3 && col == 3)
- {
- if (randomNumber == 1)
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.Write("Cherry");
- Console.ResetColor();
- }
- else if (randomNumber == 2)
- {
- Console.ForegroundColor = ConsoleColor.DarkMagenta;
- Console.Write("Grapes");
- Console.ResetColor();
- }
- else if (randomNumber == 3)
- {
- Console.ForegroundColor = ConsoleColor.DarkYellow;
- Console.Write("Orange");
- Console.ResetColor();
- }
- else if (randomNumber == 4)
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write("Lemon ");
- Console.ResetColor();
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Green;
- Console.Write("Bonus ");
- Console.ResetColor();
- }
- row += 5;
- continue;
- }
- if (row == 3 && col == 5)
- {
- if (randomNumber == 1)
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.Write("Cherry");
- Console.ResetColor();
- }
- else if (randomNumber == 2)
- {
- Console.ForegroundColor = ConsoleColor.DarkMagenta;
- Console.Write("Grapes");
- Console.ResetColor();
- }
- else if (randomNumber == 3)
- {
- Console.ForegroundColor = ConsoleColor.DarkYellow;
- Console.Write("Orange");
- Console.ResetColor();
- }
- else if (randomNumber == 4)
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write("Lemon ");
- Console.ResetColor();
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Green;
- Console.Write("Bonus ");
- Console.ResetColor();
- }
- row += 5;
- continue;
- }
- if (row == 3 && col == 7)
- {
- if (randomNumber == 1)
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.Write("Cherry");
- Console.ResetColor();
- }
- else if (randomNumber == 2)
- {
- Console.ForegroundColor = ConsoleColor.DarkMagenta;
- Console.Write("Grapes");
- Console.ResetColor();
- }
- else if (randomNumber == 3)
- {
- Console.ForegroundColor = ConsoleColor.DarkYellow;
- Console.Write("Orange");
- Console.ResetColor();
- }
- else if (randomNumber == 4)
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write("Lemon ");
- Console.ResetColor();
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Green;
- Console.Write("Bonus ");
- Console.ResetColor();
- }
- row += 5;
- continue;
- }
- if (row == 10 && col == 3)
- {
- if (randomNumber == 1)
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.Write("Cherry");
- Console.ResetColor();
- }
- else if (randomNumber == 2)
- {
- Console.ForegroundColor = ConsoleColor.DarkMagenta;
- Console.Write("Grapes");
- Console.ResetColor();
- }
- else if (randomNumber == 3)
- {
- Console.ForegroundColor = ConsoleColor.DarkYellow;
- Console.Write("Orange");
- Console.ResetColor();
- }
- else if (randomNumber == 4)
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write("Lemon ");
- Console.ResetColor();
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Green;
- Console.Write("Bonus ");
- Console.ResetColor();
- }
- row += 5;
- continue;
- }
- if (row == 10 && col == 5)
- {
- if (randomNumber == 1)
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.Write("Cherry");
- Console.ResetColor();
- }
- else if (randomNumber == 2)
- {
- Console.ForegroundColor = ConsoleColor.DarkMagenta;
- Console.Write("Grapes");
- Console.ResetColor();
- }
- else if (randomNumber == 3)
- {
- Console.ForegroundColor = ConsoleColor.DarkYellow;
- Console.Write("Orange");
- Console.ResetColor();
- }
- else if (randomNumber == 4)
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write("Lemon ");
- Console.ResetColor();
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Green;
- Console.Write("Bonus ");
- Console.ResetColor();
- }
- row += 5;
- continue;
- }
- if (row == 10 && col == 7)
- {
- if (randomNumber == 1)
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.Write("Cherry");
- Console.ResetColor();
- }
- else if (randomNumber == 2)
- {
- Console.ForegroundColor = ConsoleColor.DarkMagenta;
- Console.Write("Grapes");
- Console.ResetColor();
- }
- else if (randomNumber == 3)
- {
- Console.ForegroundColor = ConsoleColor.DarkYellow;
- Console.Write("Orange");
- Console.ResetColor();
- }
- else if (randomNumber == 4)
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write("Lemon ");
- Console.ResetColor();
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Green;
- Console.Write("Bonus ");
- Console.ResetColor();
- }
- row += 5;
- continue;
- }
- if (row == 17 && col == 3)
- {
- if (randomNumber == 1)
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.Write("Cherry");
- Console.ResetColor();
- }
- else if (randomNumber == 2)
- {
- Console.ForegroundColor = ConsoleColor.DarkMagenta;
- Console.Write("Grapes");
- Console.ResetColor();
- }
- else if (randomNumber == 3)
- {
- Console.ForegroundColor = ConsoleColor.DarkYellow;
- Console.Write("Orange");
- Console.ResetColor();
- }
- else if (randomNumber == 4)
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write("Lemon ");
- Console.ResetColor();
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Green;
- Console.Write("Bonus ");
- Console.ResetColor();
- }
- row += 5;
- continue;
- }
- if (row == 17 && col == 5)
- {
- if (randomNumber == 1)
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.Write("Cherry");
- Console.ResetColor();
- }
- else if (randomNumber == 2)
- {
- Console.ForegroundColor = ConsoleColor.DarkMagenta;
- Console.Write("Grapes");
- Console.ResetColor();
- }
- else if (randomNumber == 3)
- {
- Console.ForegroundColor = ConsoleColor.DarkYellow;
- Console.Write("Orange");
- Console.ResetColor();
- }
- else if (randomNumber == 4)
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write("Lemon ");
- Console.ResetColor();
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Green;
- Console.Write("Bonus ");
- Console.ResetColor();
- }
- row += 5;
- continue;
- }
- if (row == 17 && col == 7)
- {
- if (randomNumber == 1)
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.Write("Cherry");
- Console.ResetColor();
- }
- else if (randomNumber == 2)
- {
- Console.ForegroundColor = ConsoleColor.DarkMagenta;
- Console.Write("Grapes");
- Console.ResetColor();
- }
- else if (randomNumber == 3)
- {
- Console.ForegroundColor = ConsoleColor.DarkYellow;
- Console.Write("Orange");
- Console.ResetColor();
- }
- else if (randomNumber == 4)
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write("Lemon ");
- Console.ResetColor();
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Green;
- Console.Write("Bonus ");
- Console.ResetColor();
- }
- row += 5;
- continue;
- }
- if (row == 24 && col == 3)
- {
- if (randomNumber == 1)
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.Write("Cherry");
- Console.ResetColor();
- }
- else if (randomNumber == 2)
- {
- Console.ForegroundColor = ConsoleColor.DarkMagenta;
- Console.Write("Grapes");
- Console.ResetColor();
- }
- else if (randomNumber == 3)
- {
- Console.ForegroundColor = ConsoleColor.DarkYellow;
- Console.Write("Orange");
- Console.ResetColor();
- }
- else if (randomNumber == 4)
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write("Lemon ");
- Console.ResetColor();
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Green;
- Console.Write("Bonus ");
- Console.ResetColor();
- }
- row += 5;
- continue;
- }
- if (row == 24 && col == 5)
- {
- if (randomNumber == 1)
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.Write("Cherry");
- Console.ResetColor();
- }
- else if (randomNumber == 2)
- {
- Console.ForegroundColor = ConsoleColor.DarkMagenta;
- Console.Write("Grapes");
- Console.ResetColor();
- }
- else if (randomNumber == 3)
- {
- Console.ForegroundColor = ConsoleColor.DarkYellow;
- Console.Write("Orange");
- Console.ResetColor();
- }
- else if (randomNumber == 4)
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write("Lemon ");
- Console.ResetColor();
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Green;
- Console.Write("Bonus ");
- Console.ResetColor();
- }
- row += 5;
- continue;
- }
- if (row == 24 && col == 7)
- {
- if (randomNumber == 1)
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.Write("Cherry");
- Console.ResetColor();
- }
- else if (randomNumber == 2)
- {
- Console.ForegroundColor = ConsoleColor.DarkMagenta;
- Console.Write("Grapes");
- Console.ResetColor();
- }
- else if (randomNumber == 3)
- {
- Console.ForegroundColor = ConsoleColor.DarkYellow;
- Console.Write("Orange");
- Console.ResetColor();
- }
- else if (randomNumber == 4)
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write("Lemon ");
- Console.ResetColor();
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Green;
- Console.Write("Bonus ");
- Console.ResetColor();
- }
- row += 5;
- continue;
- }
- // 1-Cherry
- // 2-Grapes
- // 3-Orange
- // 4-Lemon
- // 5-Bonus
- Console.Write(" ");
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement