Guest User

Untitled

a guest
Nov 24th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 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 ConsoleApp117._11._2017_01
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. Random rnd = new Random();
  14.  
  15. int guess, aim, diff;
  16.  
  17.  
  18. aim = rnd.Next(0, 1000);
  19.  
  20.  
  21.  
  22. Console.WriteLine("Wilkommen zum revolutionären Ratespiel: Stephan's Ratespiel.");
  23.  
  24. do
  25. {
  26. guess = Convert.ToInt16(Console.ReadLine());
  27. Console.WriteLine("Deine Zahl ist: " + guess);
  28.  
  29. if (aim < guess)
  30. {
  31. diff = guess - aim;
  32. Console.WriteLine("Damit liegst du um zu hoch.");
  33.  
  34. }else if(aim > guess)
  35. {
  36. diff = aim - guess;
  37. Console.WriteLine("Damit liegst zu niedrig.");
  38. }
  39. else
  40. {
  41. Console.WriteLine("SUPER! Du hast es erraten!");
  42. }
  43.  
  44.  
  45. } while (guess != aim);
  46.  
  47.  
  48. }
  49. }
  50. }
Add Comment
Please, Sign In to add comment