fork(1) download
  1. import java.util.ArrayList;
  2. import java.io.*;
  3. import java.util.Random;
  4.  
  5.  
  6. class Dumb{
  7.  
  8. private static final int HERO_POWERS_USED = 20;
  9. private static final int TIMES_TO_RUN = 10;
  10. private static final int MINIONS_ON_BOARD = 5;
  11.  
  12. public static void main(String[] args) {
  13.  
  14. Random generator = new Random(System.currentTimeMillis());
  15.  
  16. for(int j=0;j<TIMES_TO_RUN;j++)
  17. {
  18. // Starting values change for different starting values
  19. int oppHealth = 20;
  20. int health = 20;
  21. int armor = 0;
  22. int cardsInDeck = 10;
  23.  
  24. // Default values, probably don't need to change.
  25. int cardsDrawn = 0;
  26. int attack = 0;
  27. int target = 0;
  28. System.out.println("Trial " + j);
  29.  
  30. for(int i=0;i<HERO_POWERS_USED;i++)
  31. {
  32. int temp = generator.nextInt() % 9;
  33. switch(temp)
  34. {
  35. case 0:
  36. armor +=2;
  37. break;
  38. case 1:
  39. target = generator.nextInt() % (MINIONS_ON_BOARD + 2);
  40. if( target == 0)
  41. health = Math.min(30, health + 2);
  42. else if(target==1)
  43. oppHealth = Math.min(30, oppHealth + 2);
  44. else
  45. System.out.println("You healed a minion");
  46. break;
  47. case 2:
  48. oppHealth -= 2;
  49. break;
  50. case 3:
  51. System.out.println("You made a totem!");
  52. break;
  53. case 4:
  54. target = generator.nextInt() % (MINIONS_ON_BOARD + 2);
  55. if(target ==0)
  56. health -=1;
  57. else if(target==1)
  58. oppHealth -= 1;
  59. else
  60. System.out.println("Pinged a minion!");
  61. break;
  62. case 5:
  63. cardsDrawn++;
  64. health -= 2;
  65. cardsInDeck--;
  66. if(cardsInDeck<0)
  67. health = health + cardsInDeck;
  68. break;
  69. case 6:
  70. System.out.println("You made a dude!");
  71. break;
  72. case 7:
  73. armor++;
  74. attack++;
  75. break;
  76. case 8:
  77. System.out.println("You got a useless 1/1 weapon!");
  78. break;
  79.  
  80. }
  81.  
  82. }
  83. System.out.println("Your Health: " + health);
  84. System.out.println("Your Armor: " + armor);
  85. System.out.println("Your Attack: " + attack);
  86. System.out.println("Your Cards drawn: " + cardsDrawn);
  87. System.out.println("Opponent Health: " + oppHealth);
  88. }
  89.  
  90. }
  91.  
  92. }
Success #stdin #stdout 0.1s 320704KB
stdin
Standard input is empty
stdout
Trial 0
You made a dude!
You made a dude!
You made a dude!
You healed a minion
You made a totem!
You made a dude!
Your Health: 20
Your Armor: 5
Your Attack: 1
Your Cards drawn: 1
Opponent Health: 18
Trial 1
You made a totem!
You made a totem!
You made a dude!
You made a totem!
You made a dude!
Your Health: 15
Your Armor: 5
Your Attack: 1
Your Cards drawn: 2
Opponent Health: 16
Trial 2
You made a dude!
You made a totem!
You made a dude!
Your Health: 17
Your Armor: 5
Your Attack: 3
Your Cards drawn: 1
Opponent Health: 14
Trial 3
You made a totem!
You made a dude!
You got a useless 1/1 weapon!
Your Health: 18
Your Armor: 7
Your Attack: 1
Your Cards drawn: 1
Opponent Health: 16
Trial 4
You made a totem!
You made a dude!
Pinged a minion!
You got a useless 1/1 weapon!
You healed a minion
You healed a minion
You got a useless 1/1 weapon!
Your Health: 17
Your Armor: 2
Your Attack: 0
Your Cards drawn: 1
Opponent Health: 20
Trial 5
You made a dude!
You made a dude!
You made a dude!
You made a dude!
You made a dude!
You made a dude!
You healed a minion
You healed a minion
You healed a minion
Pinged a minion!
You made a dude!
Your Health: 20
Your Armor: 4
Your Attack: 0
Your Cards drawn: 0
Opponent Health: 18
Trial 6
You healed a minion
You made a totem!
You got a useless 1/1 weapon!
You made a dude!
You made a dude!
Your Health: 18
Your Armor: 2
Your Attack: 2
Your Cards drawn: 0
Opponent Health: 18
Trial 7
You healed a minion
You made a totem!
You made a totem!
You made a dude!
Your Health: 14
Your Armor: 5
Your Attack: 1
Your Cards drawn: 3
Opponent Health: 22
Trial 8
You made a totem!
You healed a minion
You got a useless 1/1 weapon!
You made a totem!
You made a dude!
You made a dude!
Your Health: 16
Your Armor: 4
Your Attack: 0
Your Cards drawn: 2
Opponent Health: 18
Trial 9
You healed a minion
You got a useless 1/1 weapon!
You made a totem!
Your Health: 20
Your Armor: 16
Your Attack: 2
Your Cards drawn: 0
Opponent Health: 20