Advertisement
KirillYash2

6

Jan 24th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 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 ConsoleApp5
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string zag = "лампочка";
  14. Console.Write("Привет, отгадай загадку.\nВесит груша нельзя скушать:");
  15. for (int i = 0; i <= 2; i++)
  16. {
  17. string otvet = Console.ReadLine();
  18. if (otvet == zag)
  19. {
  20. Console.WriteLine("Вы выиграли, для выхода из консоли нажмите любую кнопку");
  21. for (int x = 66; x < 71; x++)
  22. {
  23. for (int y = 0; y < 10; y++)
  24. {
  25. Console.SetCursorPosition(x, y);
  26. Console.Write("#");
  27. }
  28. }
  29. for (int x = 65; x < 72; x++)
  30. {
  31. for (int y = 2; y < 10; y++)
  32. {
  33. Console.SetCursorPosition(x, y);
  34. Console.Write("#");
  35. }
  36. }
  37. for (int x = 63; x < 74; x++)
  38. {
  39. for (int y = 3; y < 9; y++)
  40. {
  41. Console.ForegroundColor = ConsoleColor.Yellow;
  42. Console.SetCursorPosition(x, y);
  43. Console.Write("#");
  44. Console.ForegroundColor = ConsoleColor.Gray;
  45. }
  46. }
  47. break;
  48. }
  49. else
  50. {
  51. Console.Write(" У вас осталось {0} попытки, попробуйте еще раз:", 2 - i);
  52. }
  53.  
  54. if(otvet == "подсказка" || i==2)
  55. {
  56. Console.WriteLine("\nЭто лампочка), для выхода из консоли нажмите любую кнопку");
  57. for (int x = 66; x < 71; x++)
  58. {
  59. for (int y = 0; y < 10; y++)
  60. {
  61. Console.SetCursorPosition(x, y);
  62. Console.Write("#");
  63. }
  64. }
  65. for (int x = 65; x < 72; x++)
  66. {
  67. for (int y = 2; y < 10; y++)
  68. {
  69. Console.SetCursorPosition(x, y);
  70. Console.Write("#");
  71. }
  72. }
  73. for (int x = 63; x < 74; x++)
  74. {
  75. for (int y = 3; y < 9; y++)
  76. {
  77. Console.ForegroundColor = ConsoleColor.Yellow;
  78. Console.SetCursorPosition(x, y);
  79. Console.Write("#");
  80. Console.ForegroundColor = ConsoleColor.Gray;
  81. }
  82. }
  83. Console.ReadKey();
  84. break;
  85. }
  86. }
  87. Console.ReadKey();
  88. }
  89. }
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement