Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.55 KB | None | 0 0
  1. using System;
  2.  
  3. namespace SlotMachine
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9.  
  10.  
  11. int n = 1;
  12.  
  13. int lenght = 31; //19
  14. int height = 14;
  15.  
  16. for (int col = 1; col <= height; col++)
  17. {
  18.  
  19. for (int row = 1; row <= lenght; row++)
  20. {
  21. Random random = new Random();
  22. int randomNumber = random.Next(1, 6);
  23.  
  24. if ((row > 1 && row < lenght) && (col == 1 || col == 9 || col == 14))
  25. {
  26. Console.Write("-");
  27. continue;
  28. }
  29. if (((row == 1 || row == lenght) && col == 9)||
  30. ((row == 1 || row == lenght) && col == 1)||
  31. ((row == 1 | row == lenght) && col == 14))
  32. {
  33. Console.Write("+");
  34. continue;
  35. }
  36.  
  37. if ((row == 1 || row == lenght) && (col > 1 || col >= 8))
  38. {
  39. Console.Write("|");
  40. continue;
  41. }
  42.  
  43. if (row == 9 && (col == 2 || col <= 9) || row == 16 && (col == 2 || col <= 9) || row == 23 && (col == 2 || col <= 9))
  44. {
  45. Console.Write("|");
  46. continue;
  47. }
  48. if ((row == 2 && col == 4 || row <= 31 && col == 4)||
  49. (row == 2 && col == 6 || row <= 31 && col == 6)||
  50. (row == 2 && col == 8 || row <= 31 && col == 8)||
  51. (row == 2 && col == 2) || (row <= 31 && col == 2))
  52. {
  53. Console.Write("=");
  54. continue;
  55. }
  56.  
  57. if (row == 3 && col == 3)
  58. {
  59. if (randomNumber == 1)
  60. {
  61. Console.ForegroundColor = ConsoleColor.Red;
  62. Console.Write("Cherry");
  63. Console.ResetColor();
  64. }
  65. else if (randomNumber == 2)
  66. {
  67. Console.ForegroundColor = ConsoleColor.DarkMagenta;
  68. Console.Write("Grapes");
  69. Console.ResetColor();
  70. }
  71. else if (randomNumber == 3)
  72. {
  73. Console.ForegroundColor = ConsoleColor.DarkYellow;
  74. Console.Write("Orange");
  75. Console.ResetColor();
  76. }
  77. else if (randomNumber == 4)
  78. {
  79. Console.ForegroundColor = ConsoleColor.Yellow;
  80. Console.Write("Lemon ");
  81. Console.ResetColor();
  82. }
  83. else
  84. {
  85. Console.ForegroundColor = ConsoleColor.Green;
  86. Console.Write("Bonus ");
  87. Console.ResetColor();
  88. }
  89. row += 5;
  90. continue;
  91. }
  92. if (row == 3 && col == 5)
  93. {
  94. if (randomNumber == 1)
  95. {
  96. Console.ForegroundColor = ConsoleColor.Red;
  97. Console.Write("Cherry");
  98. Console.ResetColor();
  99. }
  100. else if (randomNumber == 2)
  101. {
  102. Console.ForegroundColor = ConsoleColor.DarkMagenta;
  103. Console.Write("Grapes");
  104. Console.ResetColor();
  105. }
  106. else if (randomNumber == 3)
  107. {
  108. Console.ForegroundColor = ConsoleColor.DarkYellow;
  109. Console.Write("Orange");
  110. Console.ResetColor();
  111. }
  112. else if (randomNumber == 4)
  113. {
  114. Console.ForegroundColor = ConsoleColor.Yellow;
  115. Console.Write("Lemon ");
  116. Console.ResetColor();
  117. }
  118. else
  119. {
  120. Console.ForegroundColor = ConsoleColor.Green;
  121. Console.Write("Bonus ");
  122. Console.ResetColor();
  123. }
  124. row += 5;
  125. continue;
  126. }
  127. if (row == 3 && col == 7)
  128. {
  129. if (randomNumber == 1)
  130. {
  131. Console.ForegroundColor = ConsoleColor.Red;
  132. Console.Write("Cherry");
  133. Console.ResetColor();
  134. }
  135. else if (randomNumber == 2)
  136. {
  137. Console.ForegroundColor = ConsoleColor.DarkMagenta;
  138. Console.Write("Grapes");
  139. Console.ResetColor();
  140. }
  141. else if (randomNumber == 3)
  142. {
  143. Console.ForegroundColor = ConsoleColor.DarkYellow;
  144. Console.Write("Orange");
  145. Console.ResetColor();
  146. }
  147. else if (randomNumber == 4)
  148. {
  149. Console.ForegroundColor = ConsoleColor.Yellow;
  150. Console.Write("Lemon ");
  151. Console.ResetColor();
  152. }
  153. else
  154. {
  155. Console.ForegroundColor = ConsoleColor.Green;
  156. Console.Write("Bonus ");
  157. Console.ResetColor();
  158. }
  159. row += 5;
  160. continue;
  161. }
  162. if (row == 10 && col == 3)
  163. {
  164. if (randomNumber == 1)
  165. {
  166. Console.ForegroundColor = ConsoleColor.Red;
  167. Console.Write("Cherry");
  168. Console.ResetColor();
  169. }
  170. else if (randomNumber == 2)
  171. {
  172. Console.ForegroundColor = ConsoleColor.DarkMagenta;
  173. Console.Write("Grapes");
  174. Console.ResetColor();
  175. }
  176. else if (randomNumber == 3)
  177. {
  178. Console.ForegroundColor = ConsoleColor.DarkYellow;
  179. Console.Write("Orange");
  180. Console.ResetColor();
  181. }
  182. else if (randomNumber == 4)
  183. {
  184. Console.ForegroundColor = ConsoleColor.Yellow;
  185. Console.Write("Lemon ");
  186. Console.ResetColor();
  187. }
  188. else
  189. {
  190. Console.ForegroundColor = ConsoleColor.Green;
  191. Console.Write("Bonus ");
  192. Console.ResetColor();
  193. }
  194. row += 5;
  195. continue;
  196. }
  197. if (row == 10 && col == 5)
  198. {
  199. if (randomNumber == 1)
  200. {
  201. Console.ForegroundColor = ConsoleColor.Red;
  202. Console.Write("Cherry");
  203. Console.ResetColor();
  204. }
  205. else if (randomNumber == 2)
  206. {
  207. Console.ForegroundColor = ConsoleColor.DarkMagenta;
  208. Console.Write("Grapes");
  209. Console.ResetColor();
  210. }
  211. else if (randomNumber == 3)
  212. {
  213. Console.ForegroundColor = ConsoleColor.DarkYellow;
  214. Console.Write("Orange");
  215. Console.ResetColor();
  216. }
  217. else if (randomNumber == 4)
  218. {
  219. Console.ForegroundColor = ConsoleColor.Yellow;
  220. Console.Write("Lemon ");
  221. Console.ResetColor();
  222. }
  223. else
  224. {
  225. Console.ForegroundColor = ConsoleColor.Green;
  226. Console.Write("Bonus ");
  227. Console.ResetColor();
  228. }
  229. row += 5;
  230. continue;
  231. }
  232. if (row == 10 && col == 7)
  233. {
  234. if (randomNumber == 1)
  235. {
  236. Console.ForegroundColor = ConsoleColor.Red;
  237. Console.Write("Cherry");
  238. Console.ResetColor();
  239. }
  240. else if (randomNumber == 2)
  241. {
  242. Console.ForegroundColor = ConsoleColor.DarkMagenta;
  243. Console.Write("Grapes");
  244. Console.ResetColor();
  245. }
  246. else if (randomNumber == 3)
  247. {
  248. Console.ForegroundColor = ConsoleColor.DarkYellow;
  249. Console.Write("Orange");
  250. Console.ResetColor();
  251. }
  252. else if (randomNumber == 4)
  253. {
  254. Console.ForegroundColor = ConsoleColor.Yellow;
  255. Console.Write("Lemon ");
  256. Console.ResetColor();
  257. }
  258. else
  259. {
  260. Console.ForegroundColor = ConsoleColor.Green;
  261. Console.Write("Bonus ");
  262. Console.ResetColor();
  263. }
  264. row += 5;
  265. continue;
  266. }
  267. if (row == 17 && col == 3)
  268. {
  269. if (randomNumber == 1)
  270. {
  271. Console.ForegroundColor = ConsoleColor.Red;
  272. Console.Write("Cherry");
  273. Console.ResetColor();
  274. }
  275. else if (randomNumber == 2)
  276. {
  277. Console.ForegroundColor = ConsoleColor.DarkMagenta;
  278. Console.Write("Grapes");
  279. Console.ResetColor();
  280. }
  281. else if (randomNumber == 3)
  282. {
  283. Console.ForegroundColor = ConsoleColor.DarkYellow;
  284. Console.Write("Orange");
  285. Console.ResetColor();
  286. }
  287. else if (randomNumber == 4)
  288. {
  289. Console.ForegroundColor = ConsoleColor.Yellow;
  290. Console.Write("Lemon ");
  291. Console.ResetColor();
  292. }
  293. else
  294. {
  295. Console.ForegroundColor = ConsoleColor.Green;
  296. Console.Write("Bonus ");
  297. Console.ResetColor();
  298. }
  299. row += 5;
  300. continue;
  301. }
  302. if (row == 17 && col == 5)
  303. {
  304. if (randomNumber == 1)
  305. {
  306. Console.ForegroundColor = ConsoleColor.Red;
  307. Console.Write("Cherry");
  308. Console.ResetColor();
  309. }
  310. else if (randomNumber == 2)
  311. {
  312. Console.ForegroundColor = ConsoleColor.DarkMagenta;
  313. Console.Write("Grapes");
  314. Console.ResetColor();
  315. }
  316. else if (randomNumber == 3)
  317. {
  318. Console.ForegroundColor = ConsoleColor.DarkYellow;
  319. Console.Write("Orange");
  320. Console.ResetColor();
  321. }
  322. else if (randomNumber == 4)
  323. {
  324. Console.ForegroundColor = ConsoleColor.Yellow;
  325. Console.Write("Lemon ");
  326. Console.ResetColor();
  327. }
  328. else
  329. {
  330. Console.ForegroundColor = ConsoleColor.Green;
  331. Console.Write("Bonus ");
  332. Console.ResetColor();
  333. }
  334. row += 5;
  335. continue;
  336. }
  337. if (row == 17 && col == 7)
  338. {
  339. if (randomNumber == 1)
  340. {
  341. Console.ForegroundColor = ConsoleColor.Red;
  342. Console.Write("Cherry");
  343. Console.ResetColor();
  344. }
  345. else if (randomNumber == 2)
  346. {
  347. Console.ForegroundColor = ConsoleColor.DarkMagenta;
  348. Console.Write("Grapes");
  349. Console.ResetColor();
  350. }
  351. else if (randomNumber == 3)
  352. {
  353. Console.ForegroundColor = ConsoleColor.DarkYellow;
  354. Console.Write("Orange");
  355. Console.ResetColor();
  356. }
  357. else if (randomNumber == 4)
  358. {
  359. Console.ForegroundColor = ConsoleColor.Yellow;
  360. Console.Write("Lemon ");
  361. Console.ResetColor();
  362. }
  363. else
  364. {
  365. Console.ForegroundColor = ConsoleColor.Green;
  366. Console.Write("Bonus ");
  367. Console.ResetColor();
  368. }
  369. row += 5;
  370. continue;
  371. }
  372. if (row == 24 && col == 3)
  373. {
  374. if (randomNumber == 1)
  375. {
  376. Console.ForegroundColor = ConsoleColor.Red;
  377. Console.Write("Cherry");
  378. Console.ResetColor();
  379. }
  380. else if (randomNumber == 2)
  381. {
  382. Console.ForegroundColor = ConsoleColor.DarkMagenta;
  383. Console.Write("Grapes");
  384. Console.ResetColor();
  385. }
  386. else if (randomNumber == 3)
  387. {
  388. Console.ForegroundColor = ConsoleColor.DarkYellow;
  389. Console.Write("Orange");
  390. Console.ResetColor();
  391. }
  392. else if (randomNumber == 4)
  393. {
  394. Console.ForegroundColor = ConsoleColor.Yellow;
  395. Console.Write("Lemon ");
  396. Console.ResetColor();
  397. }
  398. else
  399. {
  400. Console.ForegroundColor = ConsoleColor.Green;
  401. Console.Write("Bonus ");
  402. Console.ResetColor();
  403. }
  404. row += 5;
  405. continue;
  406. }
  407. if (row == 24 && col == 5)
  408. {
  409. if (randomNumber == 1)
  410. {
  411. Console.ForegroundColor = ConsoleColor.Red;
  412. Console.Write("Cherry");
  413. Console.ResetColor();
  414. }
  415. else if (randomNumber == 2)
  416. {
  417. Console.ForegroundColor = ConsoleColor.DarkMagenta;
  418. Console.Write("Grapes");
  419. Console.ResetColor();
  420. }
  421. else if (randomNumber == 3)
  422. {
  423. Console.ForegroundColor = ConsoleColor.DarkYellow;
  424. Console.Write("Orange");
  425. Console.ResetColor();
  426. }
  427. else if (randomNumber == 4)
  428. {
  429. Console.ForegroundColor = ConsoleColor.Yellow;
  430. Console.Write("Lemon ");
  431. Console.ResetColor();
  432. }
  433. else
  434. {
  435. Console.ForegroundColor = ConsoleColor.Green;
  436. Console.Write("Bonus ");
  437. Console.ResetColor();
  438. }
  439. row += 5;
  440. continue;
  441. }
  442. if (row == 24 && col == 7)
  443. {
  444. if (randomNumber == 1)
  445. {
  446. Console.ForegroundColor = ConsoleColor.Red;
  447. Console.Write("Cherry");
  448. Console.ResetColor();
  449. }
  450. else if (randomNumber == 2)
  451. {
  452. Console.ForegroundColor = ConsoleColor.DarkMagenta;
  453. Console.Write("Grapes");
  454. Console.ResetColor();
  455. }
  456. else if (randomNumber == 3)
  457. {
  458. Console.ForegroundColor = ConsoleColor.DarkYellow;
  459. Console.Write("Orange");
  460. Console.ResetColor();
  461. }
  462. else if (randomNumber == 4)
  463. {
  464. Console.ForegroundColor = ConsoleColor.Yellow;
  465. Console.Write("Lemon ");
  466. Console.ResetColor();
  467. }
  468. else
  469. {
  470. Console.ForegroundColor = ConsoleColor.Green;
  471. Console.Write("Bonus ");
  472. Console.ResetColor();
  473. }
  474. row += 5;
  475. continue;
  476. }
  477. // 1-Cherry
  478. // 2-Grapes
  479. // 3-Orange
  480. // 4-Lemon
  481. // 5-Bonus
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488. Console.Write(" ");
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495. }
  496. Console.WriteLine();
  497.  
  498.  
  499.  
  500.  
  501. }
  502.  
  503.  
  504.  
  505. }
  506. }
  507. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement