Guest User

Untitled

a guest
Jan 21st, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. package com.alex;
  2.  
  3. import java.util.Random;
  4.  
  5. public class GWClassGenerator {
  6.  
  7. private String[] classes = { "Elementalist", "Thief", "Warrior", "Guardian", "Ranger", "Necromancer" };
  8. private String[] races = { "Sylvari", "Norn", "Charr", "Asura", "Human" };
  9. private Random random = new Random();
  10.  
  11. public void run(){
  12. System.out.println("Your randomized GW2 combination is a " + randomClass(races) + " " + randomRace(classes));
  13. }
  14.  
  15. public String randomClass(String[] array){
  16. int a = random.nextInt(array.length);
  17. return array[a];
  18. }
  19.  
  20. public String randomRace(String[] array){
  21. int a = random.nextInt(array.length);
  22. return array[a];
  23. }
  24.  
  25. public static void main(String[] args){
  26. GWClassGenerator app = new GWClassGenerator();
  27. app.run();
  28. }
  29.  
  30. public String[] getClasses() {
  31. return classes;
  32. }
  33.  
  34. public String[] getRaces() {
  35. return races;
  36. }
  37. }
Add Comment
Please, Sign In to add comment