Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. using System;
  2. using System.Windows.Forms;
  3.  
  4.  
  5. class Elite
  6. {
  7. public static void Main(string[] args)
  8. {
  9. Console.WriteLine("NIcK DIsabatO's /<-3R33+ NuMber GuessInG PrOGraM CHOOse a nuMber FrOM
  10.  
  11. 1-30");
  12.  
  13. for (;;)
  14. {
  15.  
  16. Console.Write("A=? ");
  17.  
  18. string guess = Console.ReadLine();
  19. Random myRandom = new Random();
  20. int ntg = myRandom.Next(1, 30);
  21. bool check = false;
  22. int result;
  23.  
  24.  
  25. if (int.TryParse(guess, out result ) == ntg)
  26. {
  27. MessageBox.Show("YES! NIcK's tIcaLc.OrG passwOrd Is **********");
  28. Environment.Exit(0);
  29. }
  30.  
  31.  
  32. if (int.TryParse(guess, out result) > 30 || int.Parse(guess) < 1)
  33. {
  34. Console.WriteLine("Out OF ranGe!");
  35. check = true;
  36. }
  37.  
  38. if (int.TryParse(guess, out result) != ntg & check != true)
  39. Console.WriteLine("NO, tHat's nOt It");
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement