AvengersAssemble

Series-Game-Fixed-For-Newbie

Oct 26th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.61 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace reminder
  8. {
  9.     class Program
  10.     {
  11.         public static void SeriesN(string series, int seriesNum, int answer)
  12.         {
  13.             Console.ForegroundColor = ConsoleColor.Blue;
  14.             Console.WriteLine("\nlevel {0}:\n", seriesNum);
  15.             Console.WriteLine(series + "\n");
  16.             Console.Write("what is the next number?  ");
  17.             int e = int.Parse(Console.ReadLine()); //בקשת המשך
  18.  
  19.             if (e == answer)
  20.             {
  21.                 Console.ForegroundColor = ConsoleColor.Magenta;//ניצחון
  22.                 Console.WriteLine("Good Job.\n");
  23.             }
  24.             else //e=!answer
  25.             {
  26.                 Console.ForegroundColor = ConsoleColor.White;  //הפסד
  27.                 Console.WriteLine("TRY YOUR LUCK IN THE NEXT LEVEL. THE CORRECT ANSWER IS {0} , {1}\n", series, answer);
  28.             }
  29.             Console.ResetColor();  //איפוס צבע
  30.             System.Threading.Thread.Sleep(500);
  31.             Console.WriteLine("\n*******************************************\n");
  32.             Console.ForegroundColor = ConsoleColor.Blue;
  33.         }
  34.         static void Main(string[] args)
  35.         {
  36.             Console.ForegroundColor = ConsoleColor.Green; //צבע פתיחה וגישה
  37.             Console.WriteLine("welcome serias games developed by Omer.");
  38.             Console.ForegroundColor = ConsoleColor.Cyan;  //הוראות צבע
  39.             Console.WriteLine("\nfor instractions press 1, don't want instractions press 0.");
  40.  
  41.             int instractions = int.Parse(Console.ReadLine());  //הוראות
  42.             if (instractions == 1)
  43.             {
  44.                 Console.WriteLine("hi, Welcome to serias games.");
  45.                 Console.WriteLine("you will recive some numbers, please try to guess the next one.");
  46.                 Console.WriteLine("HAVE FUN");
  47.                 Console.WriteLine("Just wait few seconds until the game begins.");
  48.             }
  49.             System.Threading.Thread.Sleep(10000);
  50.             Console.Clear();
  51.  
  52.             System.Threading.Thread.Sleep(1000);
  53.             SeriesN("1 , 2 , 3 , 4", 1, 5);
  54.             SeriesN("2 , 4 , 6 , 8", 2, 10);
  55.             SeriesN("4 , 8 , 16 , 32", 3, 64);
  56.             SeriesN("1 , 3 , 2 , 4 , 3", 4, 5);
  57.             SeriesN("10 , 100 , 1000 , 10000 , 100000", 5, 1000000);
  58.             SeriesN("11 , 9 , 7 , 5 , 3", 6, 1);
  59.             SeriesN("11 , 22 , 33 , 44 , 55", 7, 66);
  60.             SeriesN("15 , 30 , 45 , 60 , 75", 8, 90);
  61.         }
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment