四人飞行棋代码JAVA 四人飞行棋代码实现

怎样用Java开发一个飞行棋游戏?楼主好,这个是类似的哈
import java.util.Scanner;
{
SnakeLadder3333333(String play, int sum) {
this.play = play;
this.sum = sum;
}
String play;
int sum = 0;
int i = 0;
public void add(SnakeLadder3333333 other) {
int i = (int) (Math.random() * (6 - 1) + 1);
sum = sum + i;
if ((sum16 || sum16)(sum38 || sum38)(sum72 || sum72)(sum83 || sum83)
(sum78 || sum78)(sum99 || sum99)(sum = 100)) {
System.out.println(play + "got " + i + " points on the die");
System.out.println(play + " got " + sum);
System.out.println(other.play + " got " + other.sum);
} else if (15sumsum17) {
System.out.println(play + "got " + i + " points on the die");
System.out.println(play + "is on a ladder");
sum = sum + 8;
System.out.println(play + " got " + sum);
System.out.println(other.play + " got " + other.sum);
} else if (37sumsum39) {
System.out.println(play + "got " + i + " points on the die");
System.out.println(play + "is on a ladder");
sum = sum + 26;
System.out.println(play + " got " + sum);
System.out.println(other.play + " got " + other.sum);
} else if (71sumsum73) {
System.out.println(play + "got " + i + " points on the die");
System.out.println(play + "is on a ladder");
sum = sum + 19;
System.out.println(play + " got " + sum);
System.out.println(other.play + " got " + other.sum);
} else if (82sumsum84) {
System.out.println(play + "got " + i + " points on the die");
System.out.println(play + "is on a snake");
sum = sum - 19;
System.out.println(play + " got " + sum);
System.out.println(other.play + " got " + other.sum);
} else if (77sumsum79) {
System.out.println(play + "got " + i + " points on the die");
System.out.println(play + "is on a snake");
sum = sum - 18;
System.out.println(play + " got " + sum);
System.out.println(other.play + " got " + other.sum);
} else if (98sumsum100) {
System.out.println(play + "got " + i + " points on the die");
System.out.println(play + "is on a snake");
sum = sum - 7;
System.out.println(play + " got " + sum);
System.out.println(other.play + " got " + other.sum);
} else if (sum = 100|| other.sum = 100) {
System.out.println(play + " got " + sum);
System.out.println(other.play + " got " + other.sum);
System.out.println(play + "got " + i + " points on the die");
System.out.println(play + " lost" + other.play + " Won");
}
}
public boolean live(SnakeLadder3333333 other) {
if (sum = 100 || other.sum = 100) {
System.out.println(play + " lost" + other.play + " Won");
return false;
}
return true;
}
public static void main(String[] args) {
String q, m;
int e, n;
@SuppressWarnings("resource")
Scanner scanner = new Scanner(System.in);
SnakeLadder3333333 p1 = new SnakeLadder3333333("Player a ", 0);
SnakeLadder3333333 p2 = new SnakeLadder3333333("Player b ", 0);
while (true) {
p1.add(p2);
System.out.print("Enter c to continue, s to stop: ");
q = scanner.next();
e = q.indexOf('s');
p2.live(p1);
if (e == 0) {
return;
} else {}
p2.add(p1);
System.out.print("Enter c to continue, s to stop: ");
m = scanner.next();
n = m.indexOf('s');
p1.live(p2);
if (n == 0) {
return;
} else {
}
}
}
}
骑士飞行棋的代码谁知道呀?骑士飞行棋游戏类java代码java代码package s1java.xmal1;import java.util.*;public class Game { Scanner input=new Scanner(System.in); Map map=new Map(); int playerPos1=0; int playerPos2=0; int pos; int shu; int no; int i=0;String[]goAndStop={"on","on"}; String[]playerName=new String[2];public void setRole(){boolean t69=false;int role=1;int role1;System.out.println("※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※");System.out.println("////");System.out.println("////");System.out.println("//骑士飞行棋//");System.out.println("////");System.out.println("////");System.out.println("※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※\n\n\n");System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~两 人 对 战~~~~~~~~~~~~~~~~~~~~~~~~~~~");do{t69=false;System.out.println("\n\t\t\t\t请选择角色:\n1:根号三(傲视群英)\t2:卜赞斌(忠义之士) \t3:罗 彭(唯娟独爱)\n4:刘 怡(测你单词)\t" +"5:李祝荣(女中豪杰)\t6:阎 龙(龙大公公)\n7:郝义森(好好学习)\t8:戴杰祺(策人专家)\t9: 杨 欢(六九稀花)");System.out.print("请选择玩家1的角色:\t");role=input.nextInt();role1=role;switch(role){case 1:playerName[0]="根号三(傲视群英)";break;case 2:playerName[0]="卜赞斌(忠义之士)";break;case 3:playerName[0]="罗 彭(唯娟独爱)";break;case 4:playerName[0]="刘 怡(测你单词)";break;case 5:playerName[0]="李祝荣(女中豪杰)";break;case 6:playerName[0]="阎 龙(龙大公公)";break;case 7:playerName[0]="郝义森(好好学习)";break;case 8:playerName[0]="戴杰祺(策人专家)";break;case 9:playerName[0]="杨 欢(六九稀花)";break;default:System.out.print("\n为T69争光!人人有责!请重新选择!");t69=true;}}while(t69);do{System.out.print("请选择玩家2的角色:\t");role=input.nextInt();if(role==role1){System.out.println("玩家2不能和玩家1的角色选一样!");}switch(role){case 1:playerName[1]="根号三(傲视群英)";break;case 2:playerName[1]="卜赞斌(忠义之士)";break;case 3:playerName[1]="罗 彭(唯娟独爱)";break;case 4:playerName[1]="刘 怡(测你单词)";break;case 5:playerName[1]="李祝荣(女中豪杰)";break;case 6:playerName[1]="阎 龙(龙大公公)";break;case 7:playerName[1]="郝义森(好好学习)";break;case 8:playerName[1]="戴杰祺(策人专家)";break;case 9:playerName[1]="杨 欢(六九稀花)";break;default:System.out.print("为T69争光!人人有责!请重新选择!");}}while(role==role1||role9||role=0);System.out.println("玩家1选择角色:\t"+playerName[0]);System.out.println("玩家2选择角色:\t"+playerName[1]);System.out.println("且看:\t\t"+playerName[0]+"←V S→"+playerName[1]+"\t\t的生死对决!");}public void play(){System.out.println("\n\n\n\n");System.out.println("\n\n*********************************************\n");System.out.println("游 戏 开 始\n");System.out.println("*********************************************\n\n");System.out.println("^_^"+playerName[0]+"的骑兵:兵");System.out.println("^_^"+playerName[1]+"的骑兵:卒\n");System.out.println("\n图例:\t¤:幸运转盘\t

推荐阅读