Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.alex;
- import java.util.Random;
- public class GWClassGenerator {
- private String[] classes = { "Elementalist", "Thief", "Warrior", "Guardian", "Ranger", "Necromancer" };
- private String[] races = { "Sylvari", "Norn", "Charr", "Asura", "Human" };
- private Random random = new Random();
- public void run(){
- System.out.println("Your randomized GW2 combination is a " + randomClass(races) + " " + randomRace(classes));
- }
- public String randomClass(String[] array){
- int a = random.nextInt(array.length);
- return array[a];
- }
- public String randomRace(String[] array){
- int a = random.nextInt(array.length);
- return array[a];
- }
- public static void main(String[] args){
- GWClassGenerator app = new GWClassGenerator();
- app.run();
- }
- public String[] getClasses() {
- return classes;
- }
- public String[] getRaces() {
- return races;
- }
- }
Add Comment
Please, Sign In to add comment