Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. do
  2. {
  3.  
  4. Console.Write("Enter the name of Player 1: ");
  5. Player[0] = Console.ReadLine();
  6. Console.Write("Enter the name of Player 2: ");
  7. Player[1] = Console.ReadLine();
  8.  
  9. Random DiceRandom = new Random();
  10. DiceThrow[0] = DiceRandom.Next(1, 7);
  11.  
  12. int i = 0;
  13. while (i <= 1)
  14. {
  15. DiceThrow[0 + i] = DiceRandom.Next(1, 7);
  16. Console.ReadLine();
  17. Console.Write(Player[0 + i] + " rolled a " + DiceThrow[0 + i]);
  18. if (DiceThrow[0 + i] != 6) i++;
  19. }
  20.  
  21. Console.ReadLine();
  22. PlayerTotal[0] = DiceThrow[0];
  23. PlayerTotal[1] = DiceThrow[1];
  24.  
  25.  
  26. Console.ReadLine();
  27. Console.Write(Player[0] + " currently has " + PlayerTotal[0]);
  28. Console.ReadLine();
  29. Console.Write(Player[1] + " currently has " + PlayerTotal[1]);
  30. Console.ReadLine();
  31.  
  32. }
  33. while (PlayerTotal[0] == 20);
  34. while (PlayerTotal[1] == 20);
  35.  
  36. Console.Write("Enter the name of Player 1: ");
  37. Player[0] = Console.ReadLine();
  38. Console.Write("Enter the name of Player 2: ");
  39. Player[1] = Console.ReadLine();
  40.  
  41. Random DiceRandom = new Random();
  42.  
  43. do
  44. {
  45.  
  46. int i = 0;
  47. while (i <= 1)
  48. {
  49. int thisThrow = DiceRandom.Next(1, 6);
  50. DiceThrow[0 + i] += thisThrow;
  51. Console.ReadLine();
  52. Console.Write(Player[0 + i] + " rolled a " + thisThrow);
  53. if (thisThrow != 6) i++;
  54. }
  55.  
  56. Console.ReadLine();
  57. PlayerTotal[0] += DiceThrow[0];
  58. PlayerTotal[1] += DiceThrow[1];
  59.  
  60.  
  61. Console.ReadLine();
  62. Console.Write(Player[0] + " currently has " + PlayerTotal[0]);
  63. Console.ReadLine();
  64. Console.Write(Player[1] + " currently has " + PlayerTotal[1]);
  65. Console.ReadLine();
  66.  
  67. }
  68. while (PlayerTotal[0] < 20 && PlayerTotal[1] < 20);
  69.  
  70. PlayerTotal[0] = DiceThrow[0];
  71. PlayerTotal[1] = DiceThrow[1];
  72.  
  73. PlayerTotal[0] += DiceThrow[0];
  74. PlayerTotal[1] += DiceThrow[1];
  75.  
  76. do
  77. {
  78. // All your Dice throwing logic
  79. }
  80. while (PlayerTotal[0] != 20 && PlayerTotal[1] != 20);
  81.  
  82. int i = 0;
  83. while (i <= 1)
  84. {
  85. int thisThrow = DiceRandom.Next(1, 6);
  86. DiceThrow[0 + i] += thisThrow;
  87. Console.ReadLine();
  88. Console.Write(Player[0 + i] + " rolled a " + thisThrow);
  89. if (thisThrow != 6) i++;
  90. }
  91.  
  92. Console.ReadLine();
  93. PlayerTotal[0] += DiceThrow[0];
  94. PlayerTotal[1] += DiceThrow[1];
  95.  
  96.  
  97. Console.ReadLine();
  98. Console.Write(Player[0] + " currently has " + PlayerTotal[0]);
  99. Console.ReadLine();
  100. Console.Write(Player[1] + " currently has " + PlayerTotal[1]);
  101. Console.ReadLine();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement