Advertisement
Guest User

RussianRoulette

a guest
Apr 27th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.00 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 RussianRoulette1
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args){
  12. String UserChoice = "", Move = "", Strategy = "";
  13. int Chamber1 = 0;
  14. int Chamber2 = 0;
  15. int Chamber3 = 0;
  16. int Chamber4 = 0;
  17. int Chamber5 = 0;
  18. int Chamber6 = 0;
  19. Random ai = new Random();
  20. int AI, AI2;
  21. int Health = 1;
  22. int survives = 0;
  23. int luck;
  24. int sentence;
  25. int pl1 = 0;
  26. int pl2 = 0;
  27. int pl1s = 0;
  28. int pl2s = 0;
  29. Boolean playing = true, start = false, Action = false, exit = false;
  30.  
  31. while (playing == true){
  32. Chamber1 = 0;
  33. Chamber2 = 0;
  34. Chamber3 = 0;
  35. Chamber4 = 0;
  36. Chamber5 = 0;
  37. Chamber6 = 0;
  38. UserChoice = "";
  39. Move = "";
  40. Action = false;
  41. start = false;
  42. if (Health == 1) {
  43. AI = ai.Next(1, 6);
  44. while (start == false) {
  45. Console.WriteLine("\nPLAYER1. \nThere are 6 chambers. \nHow many do you want to fill with bullets? \nThe oppurtunities are:\n1, 2, 3, 4, 5 \n----SCORE---- \nPLAYER1 WINS: {0} SURVIVES: {1} \nPLAYER2 WINS: {2} SURVIVES: {3}", pl1, pl1s, pl2, pl2s);
  46. Console.WriteLine("");
  47. Move = (Console.ReadLine());
  48. Move.ToLower();
  49. switch (Move){
  50. case "1":
  51. Chamber1 = 1;
  52. Console.WriteLine("\nYou are putting a bullet in the chambers.");
  53. System.Threading.Thread.Sleep(5000);
  54. Console.WriteLine("\nYou have put 1 bullet in the chambers.");
  55. start = true;
  56. break;
  57. case "2":
  58. Chamber1 = 1;
  59. Chamber2 = 1;
  60. Console.WriteLine("\nYou are putting 2 bullets in the chambers.");
  61. System.Threading.Thread.Sleep(5000);
  62. Console.WriteLine("\nYou have put 2 bullets in the chambers.");
  63. start = true;
  64. break;
  65. case "3":
  66. Chamber1 = 1;
  67. Chamber2 = 1;
  68. Chamber3 = 1;
  69. Console.WriteLine("\nYou are putting 3 bullets in the chambers.");
  70. System.Threading.Thread.Sleep(5000);
  71. Console.WriteLine("\nYou have put 3 bullets in the chambers.");
  72. start = true;
  73. break;
  74. case "4":
  75. Chamber1 = 1;
  76. Chamber2 = 1;
  77. Chamber3 = 1;
  78. Chamber4 = 1;
  79. Console.WriteLine("\nYou are putting 4 bullets in the chambers.");
  80. System.Threading.Thread.Sleep(5000);
  81. Console.WriteLine("\nYou have put 4 bullets in the chambers.");
  82. start = true;
  83. break;
  84. case "5":
  85. Chamber1 = 1;
  86. Chamber2 = 1;
  87. Chamber3 = 1;
  88. Chamber4 = 1;
  89. Chamber5 = 1;
  90. Console.WriteLine("\nYou are putting 5 bullets in the chambers.");
  91. System.Threading.Thread.Sleep(5000);
  92. Console.WriteLine("\nYou have put 5 bullets in the chambers.");
  93. start = true;
  94. break;
  95. default:
  96. Console.WriteLine("\nThis is not a oppertunity?");
  97. break;
  98. }
  99. }
  100. while (Action == false) {
  101. Console.WriteLine("\nThere are 2 oppertunities now. \nTry your luck or return to the start of the game.\nTo try your luck type: try \nTo return to the start of the game type: return");
  102. UserChoice = (Console.ReadLine());
  103. UserChoice.ToLower();
  104. switch (UserChoice) {
  105. case "return":
  106. Action = true;
  107. continue;
  108. case "try":
  109. Console.WriteLine("\nYou pulled the tricker.");
  110. Action = true;
  111. break;
  112. default:
  113. Console.WriteLine("\nWhat do you want to do? ,{0}, is not a oppertunity", UserChoice);
  114. break;
  115.  
  116. }
  117. }
  118. if (AI == 1 && Chamber1 == 1 || AI == 2 && Chamber2 == 1 || AI == 3 && Chamber3 == 1 || AI == 4 && Chamber4 == 1 || AI == 5 && Chamber5 == 1 || AI == 6 && Chamber6 == 1){
  119. luck = ai.Next(1,30);
  120. if (luck == 30)
  121. {
  122. System.Threading.Thread.Sleep(2000);
  123. Console.WriteLine("\nPff PLAYER1 got lucky there was a bullet in the chamber.\nBut the gun was made in China so the tricker broke.");
  124. survives = survives + 1;
  125. continue;
  126. }
  127. else if (luck < 30) {
  128. System.Threading.Thread.Sleep(2000);
  129. sentence = ai.Next(1, 4);
  130. if (sentence == 1){
  131. Console.WriteLine("\nThe bullet crushed the skull from Player1.");
  132. }else if (sentence == 2){
  133. Console.WriteLine("\nThe bullet kiled also someone behind PLAYER1.");
  134. }else if (sentence == 3){
  135. Console.WriteLine("\nPLAYER1 killed his self silly sod.");
  136. }else if (sentence == 4) {
  137. Console.WriteLine("\nWhen the bullet hits the brain of PLAYER1, PLAYER1'S brain exploded.");
  138. }
  139. Console.WriteLine("\nPLAYER1 DIED, PLAYER2 WINS");
  140. pl2 = pl2 + 1;
  141. }
  142. }
  143. if (AI == 1 && Chamber1 == 0 || AI == 2 && Chamber2 == 0 || AI == 3 && Chamber3 == 0 || AI == 4 && Chamber4 == 0 || AI == 5 && Chamber5 == 0 || AI == 6 && Chamber6 == 0) {
  144. System.Threading.Thread.Sleep(2000);
  145. Console.WriteLine("\nPff you got lucky.");
  146. pl1s = pl1s + 1;
  147. }
  148. luck = 0;
  149. Chamber1 = 0;
  150. Chamber2 = 0;
  151. Chamber3 = 0;
  152. Chamber4 = 0;
  153. Chamber5 = 0;
  154. Chamber6 = 0;
  155. sentence = 0;
  156. UserChoice = "";
  157. Move = "";
  158. Action = false;
  159. start = false;
  160. AI2 = ai.Next(1, 6);
  161. while (start == false)
  162. {
  163. Console.WriteLine("\nPLAYER2. \nThere are 6 chambers. \nHow many do you want to fill with bullets? \nThe oppurtunities are:\n1, 2, 3, 4, 5 \n----SCORE---- \nPLAYER1 WINS: {0} SURVIVES: {1} \nPLAYER2 WINS: {2} SURVIVES: {3}", pl1, pl1s, pl2, pl2s);
  164. Console.WriteLine("");
  165. Move = (Console.ReadLine());
  166. Move.ToLower();
  167. switch (Move)
  168. {
  169. case "1":
  170. Chamber1 = 1;
  171. Console.WriteLine("\nPLAYER2 is putting a bullet in the chambers.");
  172. System.Threading.Thread.Sleep(5000);
  173. Console.WriteLine("\nPLAYER2 has put 1 bullet in the chambers.");
  174. start = true;
  175. break;
  176. case "2":
  177. Chamber1 = 1;
  178. Chamber2 = 1;
  179. Console.WriteLine("\nPLAYER2 is putting 2 bullets in the chambers.");
  180. System.Threading.Thread.Sleep(5000);
  181. Console.WriteLine("\nPLAYER2 has put 2 bullets in the chambers.");
  182. start = true;
  183. break;
  184. case "3":
  185. Chamber1 = 1;
  186. Chamber2 = 1;
  187. Chamber3 = 1;
  188. Console.WriteLine("\nPLAYER2 is putting 3 bullets in the chambers.");
  189. System.Threading.Thread.Sleep(5000);
  190. Console.WriteLine("\nPLAYER2 has put 3 bullets in the chambers.");
  191. start = true;
  192. break;
  193. case "4":
  194. Chamber1 = 1;
  195. Chamber2 = 1;
  196. Chamber3 = 1;
  197. Chamber4 = 1;
  198. Console.WriteLine("\nPLAYER2 is putting 4 bullets in the chambers.");
  199. System.Threading.Thread.Sleep(5000);
  200. Console.WriteLine("\nPLAYER2 has put 4 bullets in the chambers.");
  201. start = true;
  202. break;
  203. case "5":
  204. Chamber1 = 1;
  205. Chamber2 = 1;
  206. Chamber3 = 1;
  207. Chamber4 = 1;
  208. Chamber5 = 1;
  209. Console.WriteLine("\nPLAYER2 is putting 5 bullets in the chambers.");
  210. System.Threading.Thread.Sleep(5000);
  211. Console.WriteLine("\nPLAYER2 has put 5 bullets in the chambers.");
  212. start = true;
  213. break;
  214. default:
  215. Console.WriteLine("\nThis is not a oppertunity.");
  216. break;
  217. }
  218. }
  219. while (Action == false)
  220. {
  221. Console.WriteLine("\nThere are 2 oppertunities now. \nTry your luck or return to the start of the game.\nTo try your luck type: try \nTo return to the start of the game type: return");
  222. UserChoice = (Console.ReadLine());
  223. UserChoice.ToLower();
  224. switch (UserChoice)
  225. {
  226. case "return":
  227. Action = true;
  228. continue;
  229. case "try":
  230. Console.WriteLine("\nPLAYER2 pulled the tricker.");
  231. Action = true;
  232. break;
  233. default:
  234. Console.WriteLine("\nWhat do you want to do? ,{0}, is not a oppertunity", UserChoice);
  235. break;
  236.  
  237. }
  238. }
  239. if (AI2 == 1 && Chamber1 == 1 || AI2 == 2 && Chamber2 == 1 || AI2 == 3 && Chamber3 == 1 || AI2 == 4 && Chamber4 == 1 || AI2 == 5 && Chamber5 == 1 || AI2 == 6 && Chamber6 == 1)
  240. {
  241. luck = ai.Next(1, 30);
  242. if (luck == 30)
  243. {
  244. System.Threading.Thread.Sleep(2000);
  245. Console.WriteLine("\nPff PLAYER2 got lucky there was a bullet in the chamber.\nBut the gun was made in China so the tricker broke.");
  246. survives = survives + 1;
  247. continue;
  248. }
  249. else if (luck < 30)
  250. {
  251. System.Threading.Thread.Sleep(2000);
  252. sentence = ai.Next(1, 4);
  253. if (sentence == 1)
  254. {
  255. Console.WriteLine("\nThe bullet crushed the skull from Player2.");
  256. }
  257. else if (sentence == 2)
  258. {
  259. Console.WriteLine("\nThe bullet kiled also someone behind PLAYER2.");
  260. }
  261. else if (sentence == 3)
  262. {
  263. Console.WriteLine("\nPLAYER2 killed his self silly sod.");
  264. }
  265. else if (sentence == 4)
  266. {
  267. Console.WriteLine("\nWhen the bullet hits the brain of PLAYER2, PLAYER2'S brain exploded.");
  268. }
  269. Console.WriteLine("\nPLAYER2 DIED, PLAYER1 WINS");
  270. pl1 = pl1 + 1;
  271. }
  272. }
  273. if (AI == 1 && Chamber1 == 0 || AI == 2 && Chamber2 == 0 || AI == 3 && Chamber3 == 0 || AI == 4 && Chamber4 == 0 || AI == 5 && Chamber5 == 0 || AI == 6 && Chamber6 == 0)
  274. {
  275. System.Threading.Thread.Sleep(2000);
  276. Console.WriteLine("\nPff PLAYER2 got lucky.");
  277. pl2s = pl2s + 1;
  278. }
  279. if (pl1 == 10 || pl2 == 10) {
  280. if (pl1 == 10) {
  281. Console.WriteLine("\nPLAYER1 WINS");
  282. Health = 0;
  283. continue;
  284. }else if (pl2 == 10) {
  285. Console.WriteLine("\nPLAYER2 WINS");
  286. Health = 0;
  287. continue;
  288. }
  289. }
  290. } // health
  291. }
  292. }
  293. }
  294.  
  295. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement