I've done some research on this site about this already, however, I'm having some trouble finding something I can use. I'm trying to create a similar program to pokemon, but much much simpler and text based. Currently I'm using arrays to store the Pokemon's stats. That's working great, but when I need to print the Pokemon's name I have to manually type it out. This has worked fine, but I want to have the player battle a random Pokemon. This is my current code:
public static void main(String[] args) {
//Declare the Pokemon to be used
int[] Player = {0, 0, 0, 0, 0, 0 };
int[] Blastoise = {79, 83, 100, 85, 105, 78 };
int[] Raichu = {60, 90, 55, 90, 80, 110};
int[][] Pokemon = new int[][] {Blastoise, Raichu, Player};
Scanner input = new Scanner(System.in);
startBattle(input, Pokemon)
}
public static String startBattle(Scanner input, int[][] Pokemon) {
System.out.println("A wild Pokemon appeared!");
int r = (int) (Math.random() * 1);
System.out.println("A wild " + **POKEMON NAME** + " appeared!");
System.out.print("What Pokemon do you choose? ");
String userPokemon = input.next();
return userPokemon;
}
Where it says POKEMON NAME is where I want to have the Pokemon's name be. I know it's super difficult to get the name of an array, or add a String to an int array (I would add the name to the list[0] spot). Is there any way I could at least associate a String with one of the lists so I could call the name of that randomly selected Pokemon? Thanks!