Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.97 KB | None | 0 0
  1. /*static int[] elso_sor = new int[8] { 1, 2, 3, 4, 5, 6, 7, 8 };
  2. static int[] masodik_sor = new int[8] { 9, 10, 11, 12, 13, 14, 15, 16 };
  3. static int[] harmadik_sor = new int[8] { 17, 18, 19, 20, 21, 22, 23, 24 };
  4. static int[] negyedik_sor = new int[8] { 17, 18, 19, 20, 21, 22, 23, 24 };*/
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.IO;
  11.  
  12. namespace ConsoleApp2
  13. {
  14. class Program
  15. {
  16. static int vajonezjoe = 0;
  17. static int jelenleg = 30;
  18. static int[] history = new int[10] { 30, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
  19. static int hovamegyunk = 0;
  20. static int[,] tabla = new int[4, 8] { { 1, 2, 3, 4, 5, 6, 7, 8 }, { 9, 10, 11, 12, 13, 14, 15, 16 }, { 17, 18, 19, 20, 21, 22, 23, 24 }, { 25, 26, 27, 28, 29, 30, 31, 32 } };
  21. private static void Main()
  22. {
  23. Design();
  24. Tabla_Kiiratasa();
  25. Varakoztatas();
  26. }
  27. #region Dizánj
  28. static void Design()
  29. {
  30. Console.Title = "Vadász Dénes Programozói Verseny immune.space";
  31. Console.ForegroundColor = ConsoleColor.Green;
  32. Console.BackgroundColor = ConsoleColor.Black;
  33. }
  34. #endregion
  35. #region Várakoztatás
  36. static void Varakoztatas()
  37. {
  38. Console.ReadKey();
  39. Environment.Exit(0x00);
  40. }
  41. #endregion
  42. static void Tabla_Kiiratasa()
  43. {
  44. for (int i = 0; i < tabla.GetLength(0); i++)
  45. {
  46. if (i > 0)
  47. {
  48. Console.Write("\n\n");
  49. }
  50. for (int j = 0; j < tabla.GetLength(1); j++)
  51. {
  52. if (tabla[i, j] != 30)
  53. {
  54. Console.Write("\t" + tabla[i, j]);
  55. }
  56. else if (tabla[i, j] == 30)
  57. {
  58. Console.ForegroundColor = ConsoleColor.Red;
  59. Console.Write("\t" + tabla[i, j]);
  60. Console.ForegroundColor = ConsoleColor.Green;
  61. }
  62. }
  63. }
  64. Hova_Akarunk_Menni();
  65. }
  66. static void Hova_Akarunk_Menni()
  67. {
  68. Console.Write("\n\nAdja meg a mező számát amire lépni akar: ");
  69. hovamegyunk = Convert.ToInt32(Console.ReadLine());
  70. vajonezjoe = jelenleg - hovamegyunk;
  71. if (jelenleg == 1 && jelenleg == 9 && jelenleg == 17 && jelenleg == 25)//balszel
  72. {
  73. if (vajonezjoe != 7 && vajonezjoe != 8)
  74. {
  75. Console.Write(vajonezjoe);
  76. Console.Write("\n\nAnyád picsája it's a trap5");
  77. Hova_Akarunk_Menni();
  78. }
  79. }
  80. if (jelenleg == 8 && jelenleg == 16 && jelenleg == 24 && jelenleg == 32)//jobbszel
  81. {
  82. if (vajonezjoe != 8 && vajonezjoe != 9)
  83. {
  84. Console.Write(vajonezjoe);
  85. Console.Write("\n\nAnyád picsája it's a trap6");
  86. Hova_Akarunk_Menni();
  87. }
  88. }
  89. if (vajonezjoe != 7 && vajonezjoe != 8 && vajonezjoe != 9)
  90. {
  91. Console.Write(vajonezjoe);
  92. Console.Write("\n\nAnyád picsája it's a trap1");
  93. Hova_Akarunk_Menni();
  94. }
  95. if (hovamegyunk > jelenleg)
  96. {
  97. Console.Write("\n\nAnyád picsája it's a trap2");
  98. Hova_Akarunk_Menni();
  99. }
  100. if (hovamegyunk == 12 || hovamegyunk == 4 || hovamegyunk == 7)
  101. {
  102. Console.Write("\n\nAnyád picsája it's a trap3");
  103. Hova_Akarunk_Menni();
  104. }
  105. //Console.Clear();
  106. for (int i = 0; i < tabla.GetLength(0); i++)
  107. {
  108. if (i > 0)
  109. {
  110. Console.Write("\n\n");
  111. }
  112. for (int j = 0; j < tabla.GetLength(1); j++)
  113. {
  114. if (tabla[i, j] != hovamegyunk)
  115. {
  116. Console.Write("\t" + tabla[i, j]);
  117. }
  118. else if (tabla[i, j] == hovamegyunk)
  119. {
  120. Console.ForegroundColor = ConsoleColor.Red;
  121. Console.Write("\t" + tabla[i, j]);
  122. Console.ForegroundColor = ConsoleColor.Green;
  123. }
  124. }
  125. }
  126. if (hovamegyunk == 2)
  127. {
  128. Varakoztatas();
  129. }
  130. else
  131. {
  132. jelenleg = hovamegyunk;
  133. Console.Write(" " + vajonezjoe);
  134. Hova_Akarunk_Menni();
  135.  
  136. }
  137. }
  138. }
  139. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement