无法解析为

时间:2017-11-17 05:24:43

标签: simulator

好吧,所以我花了一段时间试图编写一个口袋妖怪战斗模拟器,但由于某种原因,它继续说,在各种口袋妖怪未解决的类型的情况下。

package Desktop;
import java.util.*;
import java.io.*;

public class battle
{
  public static void main()throws IOException
  {
   Scanner in = new Scanner(System.in);
   BufferedReader br = new BufferedReader (new InputStreamReader(System.in));

System.out.println("Welcome to the Pokemon Battle Simulator!\nGet ready to BATTLE!");
System.out.println("1. Venasaur\n2. Charizard\n3. Blastoise\n4. Feraligatr\n5. Typhlosion\n6. Mewtwo\n7. Blaziken\n8. Swampert\n9. Sceptile\n10. Haxorus\n11. Hydreigon\n12. Tyranitar\n13. Metagross\n14. Garchomp\n15. Aggron\n16. Xerneas\n17. Heracross\n18. Conkeldurr");
System.out.println("\n\nPlayer 1, choose your Pokemon(number)");
int p1 = in.nextInt();
Pokemon P1 = null;

  switch(p1)
{
  case 1: P1 = new Venasaur();break;
  case 2: P1 = new Charizard();break;
  case 3: P1 = new Blastoise();break;
  case 4: P1 = new Feraligatr();break;
  case 5: P1 = new Typhlosion();break;
  case 6: P1 = new Mewtwo();break;
  case 7: P1 = new Blaziken();break;
  case 8: P1 = new Swampert();break;
  case 9: P1 = new Sceptile();break;
  case 10: P1 = new Haxorus();break;
  case 11: P1 = new Hydreigon();break;
  case 12: P1 = new Tyranitar();break;
  case 13: P1 = new Metagross();break;
  case 14: P1 = new Garchomp();break;
  case 15: P1 = new Aggron();break;
  case 16: P1 = new Xerneas();break;
  case 17: P1 = new Heracross();break;
  case 18: P1 = new Conkeldurr();break;

  default:System.out.println("Wrong input! Please choose again");System.exit(0);break;
}

0 个答案:

没有答案