package koma;
import java.util.Random;
public class pro {
String[] koma=new String[7];
int[] pos=new int[7];
String[] hand=new String[7];
int[] x=new int[10];
int[] y=new int[10];
int[] dy=new int[100];
int[] dx=new int[100];
int number_dir;
String mode;
int number_sel;
int[] koma_sel=new int[11];
int[][] pos_ch=new int[101][7];
int number_ch;
int[][] pos_chx=new int[101][7];
String[][] hand_chx=new String[101][7];
int number_chx;
int game;
public static void main(String[] args) {
pro t=new pro();
}
pro(){
mode="先手";
koma[1]="王";
koma[2]="歩";
koma[3]="歩";
koma[4]="王";
koma[5]="歩";
koma[6]="歩";
pos[1]=2;
pos[2]=1;
pos[3]=3;
pos[4]=8;
pos[5]=7;
pos[6]=9;
hand[1]="先手";
hand[2]="先手";
hand[3]="先手";
hand[4]="後手";
hand[5]="後手";
hand[6]="後手";
game=0;
while( game<50){
game=game+1;
step sub=new step();
sub.hand=hand;
sub.mode=mode;
sub.koma=koma;
sub.pos=pos;
sub.makedata();
hand=sub.hand;
mode=sub.mode;
pos=sub.pos;
if(mode.equals("先手勝利"))game=500;
if(mode.equals("後手勝利"))game=500;
paint();
}
}
void paint(){
String[] a=new String[10];
int s,sx;
for(s=1;s<10;s++){
a[s]="〇";
}
for(s=1;s<7;s++){
sx=pos[s];
if(sx>0)a[sx]=koma[s];
}
System.out.println(mode);
System.out.println(a[7]+a[8]+a[9]);
System.out.println(a[4]+a[5]+a[6]);
System.out.println(a[1]+a[2]+a[3]);
System.out.println("*********");
}
}
最終更新:2018年01月19日 13:02