import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Random;
// The main method must be in a class named "Main".
class Main {
public static void main(String[] args) {
Random rand = new Random();
String[] pokeEncounter = {"Charmeleon","bulbasour","flabele","primeape","litwick"};
String[] world = {"Farmers land","Dark cave","mt summit","Snowy city","mountains"};
int indexworld = rand.nextInt(world.length);
int indexpoke = rand.nextInt(pokeEncounter.length);
String pokedata = pokeEncounter[indexpoke];
String worlddata = world[indexworld];
System.out.println("You are exploring the "+worlddata);
System.out.println("You ecnountered a "+pokedata);
int battle = rand.nextInt(3);
if(battle == 2){
System.out.println("You caught "+pokedata);
}else if(battle == 1){
System.out.println("Oh no the "+pokedata+" got away");
}
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: