Advertisement
Guest User

Untitled

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