import java.awt.*;
import java.awt.event.*;
class pro extends Frame{
String str1,str2,str3,str4;
int s,sx,number,n;
String[] name=new String[60];
int[] card=new int[17];
int[] point=new int[60];
int z1,h;
int p1;
Image[] img=new Image[60];
String file;
public static void main(String [] args) {
Frame f=new pro();
f.setTitle("名古屋");
f.setSize(500,500);
f.setBackground(Color.blue);
f.setVisible(true);
}
pro(){
for(s=1;s<58;s++){
file="pic/";
file=file+s;
file=file+".jpg";
img[s]= Toolkit.getDefaultToolkit().getImage(file);
}
makepoint();
makename();
select(number);
addWindowListener(new stopwin());
}
class stopwin extends WindowAdapter{
public void windowClosing(WindowEvent we){System.exit(0);}
}
public void paint(Graphics g){
int[] x=new int[17];
int[] y=new int[17];
x[1]=50;
x[2]=150;
x[3]=250;
x[4]=350;
x[5]=50;
x[6]=150;
x[7]=250;
x[8]=350;
x[9]=50;
x[10]=150;
x[11]=250;
x[12]=350;
x[13]=50;
x[14]=150;
x[15]=250;
x[16]=350;
y[1]=50;
y[2]=50;
y[3]=50;
y[4]=50;
y[5]=150;
y[6]=150;
y[7]=150;
y[8]=150;
y[9]=250;
y[10]=250;
y[11]=250;
y[12]=250;
y[13]=350;
y[14]=350;
y[15]=350;
y[16]=350;
for(s=1;s<17;s++){
sx=card[s];
g.drawImage(img[sx],x[s],y[s],100,100,this);
}
}
void select(int number){
int[] pos=new int[60];
int s,t,n1;
t=0;
s=0;
while(t<50){
n1=f(number);
if(pos[n1]<50)s=s+1;
if(pos[n1]<50)card[s]=n1;
if(pos[n1]<50)pos[n1]=100;
if(s>15)t=100;
}
}
int f(int number){
int f1;
f1=(int)(Math.random()*number)+1;
return f1;
}
void makename(){
str1="大矢真那, 小野晴香, 加藤るみ, 木﨑ゆりあ, 木下有希子, 桑原みずき, 須田亜香里, 高田志織, 出口陽, 中西優香, 平田璃香子, 平松可奈子, 松井珠理奈, 松井玲奈, 松下唯, 矢神久美";
str2="赤枝里々奈, 阿比留李帆, 石田安奈, 小木曽汐莉, 加藤智子, 後藤理沙子, 佐藤聖羅, 佐藤実絵子, 高柳明音, 秦佐和子, 古川愛李, 松本梨奈, 向田茉夏, 矢方美紀, 山田澪花, 若林倫香";
str3="磯原杏華, 上野圭澄, 梅本まどか, 金子栞, 木本花音, 小林亜実, 酒井萌衣, 柴田阿弥, 高木由麻奈, 竹内舞, 都築里佳, 中村優花, 原望奈美, 間野春香, 山下ゆかり, 山田恵里伽";
str4="井口栞里, 犬塚あさな, 今出舞, 内山命, 鬼頭桃菜, 小林絵未梨, 斉藤真木子, 松村香織, 水埜帆乃香";
String[] x1=str1.split(",");
sx=0;
for(s=0;s<x1.length;s++){
sx=sx+1;
name[sx]=x1[s].trim();
}
String[] x2=str2.split(",");
for(s=0;s<x2.length;s++){
sx=sx+1;
name[sx]=x2[s].trim();
}
String[] x3=str3.split(",");
for(s=0;s<x3.length;s++){
sx=sx+1;
name[sx]=x3[s].trim();
}
String[] x4=str4.split(",");
for(s=0;s<x4.length;s++){
sx=sx+1;
name[sx]=x4[s].trim();
}
number=sx;
}
void makepoint(){
point[1]=4;
point[2]=3;
point[3]=2;
point[4]=4;
point[5]=3;
point[6]=2;
point[7]=4;
point[8]=2;
point[9]=2;
point[10]=2;
point[11]=2;
point[12]=3;
point[13]=5;
point[14]=5;
point[15]=2;
point[16]=4;
point[17]=2;
point[18]=2;
point[19]=3;
point[20]=4;
point[21]=2;
point[22]=2;
point[23]=2;
point[24]=2;
point[25]=5;
point[26]=4;
point[27]=4;
point[28]=4;
point[29]=4;
point[30]=3;
point[31]=1;
point[32]=2;
point[33]=2;
point[34]=2;
point[35]=3;
point[36]=4;
point[37]=3;
point[38]=2;
point[39]=2;
point[40]=3;
point[41]=3;
point[42]=2;
point[43]=2;
point[44]=3;
point[45]=3;
point[46]=3;
point[47]=2;
point[48]=3;
point[49]=2;
point[50]=2;
point[51]=3;
point[52]=2;
point[53]=2;
point[54]=2;
point[55]=2;
point[56]=3;
point[57]=2;
}
}
最終更新:2011年09月23日 07:35