Advertisement
Guest User

java

a guest
Apr 30th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. String [] Cards = new String[49];
  2. int[] Picked = new int[8];
  3. String Option;
  4. int Rand;
  5. int state;
  6. int hue;
  7.  
  8.  
  9. Cards[1] = "Zap";
  10. Cards[2] = "Minions";
  11. Cards[3] = "Hog Rider";
  12. Cards[4] = "Elixir Collector";
  13. Cards[5] = "Fireball";
  14. Cards[6] = "Cannon";
  15. Cards[7] = "Goblins";
  16. Cards[8] = "Spear Goblins";
  17. Cards[9] = "Valkyrie";
  18. Cards[10] = "Goblin Hut";
  19. Cards[11] = "Giant";
  20. Cards[12] = "Archers";
  21. Cards[13] = "Bomber";
  22. Cards[14] = "Musketeer";
  23. Cards[15] = "Mini P.E.K.K.A";
  24. Cards[16] = "Witch";
  25. Cards[17] = "Skeleton Army";
  26. Cards[18] = "Baby Dragon";
  27. Cards[19] = "Prince";
  28. Cards[20] = "Goblin Barrel";
  29. Cards[21] = "Lightning";
  30. Cards[22] = "Knight";
  31. Cards[23] = "Arrows";
  32. Cards[24] = "Skeletons";
  33. Cards[25] = "Bomb Tower";
  34. Cards[26] = "Tombstone";
  35. Cards[27] = "Balloon";
  36. Cards[28] = "Giant Skeleton";
  37. Cards[29] = "Barbarians";
  38. Cards[30] = "Barbarian Hut";
  39. Cards[31] = "Rocket";
  40. Cards[32] = "X-Bow";
  41. Cards[33] = "Rage";
  42. Cards[34] = "Minion Horde";
  43. Cards[35] = "Tesla";
  44. Cards[36] = "Inferno Tower";
  45. Cards[37] = "Freeze";
  46. Cards[38] = "Wizard";
  47. Cards[39] = "Mirror";
  48. Cards[40] = "Poison";
  49. Cards[41] = "Mortar";
  50. Cards[42] = "Royal Giant";
  51. Cards[43] = "Three Musketeers";
  52. Cards[44] = "P.E.K.K.A";
  53. Cards[45] = "Ice Wizard";
  54. Cards[46] = "Golem";
  55. Cards[47] = "Princess";
  56. Cards[48] = "Dark Prince";
  57.  
  58. hue = 0;
  59.  
  60. while(hue == 0){
  61.  
  62. for (int x = 0; x < 8; x++){//for x = 0; x < 8
  63. state = 0;
  64. while(state == 0){ //while state=0
  65. Rand = (int) (Math.random()*48 + 1);
  66. for (int y = 0; y < 8; y++){ //for x = 0; x < 8
  67. if (Rand == Picked[y]){//rand ==picked
  68. break;
  69. } // rand ==picked
  70. if (y == 7){//y==7
  71. Picked[x] = Rand;
  72. state = 1;
  73.  
  74. }//y==7
  75.  
  76. }//for x = 0 ; x <8
  77. }//while state = 0
  78. }// for x = 0; x < 8
  79.  
  80. panelCards.setVisible(true);
  81.  
  82. card1.setText("" +Cards[Picked[0]]);
  83. card2.setText("" +Cards[Picked[1]]);
  84. card3.setText("" +Cards[Picked[2]]);
  85. card4.setText("" +Cards[Picked[3]]);
  86. card5.setText("" +Cards[Picked[4]]);
  87. card6.setText("" +Cards[Picked[5]]);
  88. card7.setText("" +Cards[Picked[6]]);
  89. card8.setText("" +Cards[Picked[7]]);
  90.  
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement