Advertisement
Guest User

Untitled

a guest
Mar 19th, 2017
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.13 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 BlackJack
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int dealersScore = 0, Current = 0, End=1, rand;
  14. string randomizedCard, Dealer, Choice;
  15.  
  16. List<string> Bank = new List<string>()
  17. { "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  18. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  19. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  20. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  21. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  22. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  23. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  24. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  25. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  26. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  27. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  28. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  29. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  30. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  31. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  32. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  33. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  34. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  35. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  36. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  37. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  38. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  39. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  40. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  41. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  42. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  43. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  44. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  45. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  46. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  47. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  48. "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
  49. };
  50.  
  51. Random x = new Random();
  52.  
  53. while (End == 1) {
  54.  
  55. Choice = Console.ReadLine();
  56. if (Choice == "")
  57. {
  58. Current = x.Next(417);
  59. int playersScore = 0;
  60. int Player=0;
  61. if (Bank[Current] == "2")
  62. {
  63. playersScore += 2;
  64.  
  65. Console.WriteLine("You earn 2. Now you have: ", playersScore.ToString());
  66. Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
  67.  
  68. }
  69. else if (Bank[Current] == "3")
  70. {
  71. playersScore += 3;
  72. Console.WriteLine("You earn 3. Now you have: ", playersScore);
  73. Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
  74.  
  75. }
  76. else if (Bank[Current] == "4")
  77. {
  78. playersScore += 4;
  79. Console.WriteLine("You earn 4. Now you have: ", playersScore);
  80. Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
  81.  
  82. }
  83. else if (Bank[Current] == "5")
  84. {
  85. playersScore += 5;
  86. Console.WriteLine("You earn 5. Now you have: ", playersScore);
  87. Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
  88.  
  89. }
  90. else if (Bank[Current] == "6")
  91. {
  92. playersScore += 6;
  93. Console.WriteLine("You earn 6. Now you have: ", playersScore);
  94. Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
  95.  
  96. }
  97. else if (Bank[Current] == "7")
  98. {
  99. playersScore += 7;
  100. Console.WriteLine("You earn 7. Now you have: ", playersScore);
  101. Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
  102.  
  103. }
  104. else if (Bank[Current] == "8")
  105. {
  106. playersScore += 8;
  107. Console.WriteLine("You earn 8. Now you have: ", playersScore);
  108. Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
  109.  
  110. }
  111. else if (Bank[Current] == "9")
  112. {
  113. playersScore += 9;
  114. Console.WriteLine("You earn 9. Now you have: ", playersScore);
  115. Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
  116.  
  117. }
  118. else if (Bank[Current] == "10")
  119. {
  120. playersScore += 10;
  121. Console.WriteLine("You earn 10. Now you have: ", playersScore);
  122. Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
  123.  
  124. }
  125. else if (Bank[Current] == "J")
  126. {
  127. playersScore += 10;
  128. Console.WriteLine("You earn J. Now you have: ", playersScore);
  129. Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
  130.  
  131. }
  132. else if (Bank[Current] == "Q")
  133. {
  134. playersScore += 10;
  135. Console.WriteLine("You earn Q. Now you have: ");
  136. Player = playersScore + Player;
  137. Console.Write(Player);
  138. Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
  139.  
  140. }
  141. else if (Bank[Current] == "K")
  142. {
  143. playersScore += 10;
  144. Console.WriteLine("You earn K. Now you have: ", playersScore);
  145. Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
  146.  
  147. }
  148. else if (Bank[Current] == "A")
  149. {
  150. if (playersScore + 11 > 21)
  151. {
  152. playersScore += 1;
  153. Console.WriteLine("You earn A. Now you have: ", playersScore, "(soft)");
  154. Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
  155.  
  156. }
  157. else playersScore += 11;
  158. Console.WriteLine("You earn A. Now you have: ", playersScore);
  159. Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
  160.  
  161. }
  162.  
  163. }
  164. }
  165.  
  166.  
  167.  
  168.  
  169.  
  170. }
  171. }
  172. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement