import java.awt.*;
import java.awt.event.*;
class game extends Frame{
int[] code=new int[10000];
int[] year=new int[10000];
int[] month=new int[10000];
int[] day=new int[10000];
int[] oprice=new int[10000];
int[] hprice=new int[10000];
int[] lprice=new int[10000];
int[] cprice=new int[10000];
int[] rprice=new int[10000];
int[] volume=new int[10000];
int tsecode[]=new int[10000];
int tsenumber;
int datanumber;
int ph,pl,pc,po;
int s,c,sx;
int h;
int stock;
int money;
int n,p;
String file;
public static void main(String [] args) {
Frame f=new game();
f.setTitle("game");
f.setSize(700,700);
f.setBackground(Color.yellow);
f.setVisible(true);
}
game(){
getcode gc=new getcode();
gc.makedata();
tsecode=gc.tsecode;
tsenumber=gc.tsenumber;
c=500;
file="data/"+tsecode[c]+".txt";
tsedata cd=new tsedata();
cd.makedata(file);
datanumber=cd.datanumber;
hprice=cd.hprice;
lprice=cd.lprice;
oprice=cd.oprice;
cprice=cd.cprice;
rprice=cd.rprice;
year=cd.year;
month=cd.month;
day=cd.day;
volume=cd.volume;
addWindowListener(new stopwin());
}
class stopwin extends WindowAdapter{
public void windowClosing(WindowEvent we){System.exit(0);}
}
public void paint(Graphics g){
int pc,p2;
for(s=100;s<500;s++){
pc=cprice[s]/10;
p=avg(s)/10;
g.setColor(Color.red);
g.fillRect(100+s,600-p,1,p);
g.setColor(Color.blue);
g.fillRect(100+s,600-pc,1,pc);
}
}
int avg(int s){
int sx,p1;
p1=0;
for(sx=s-19;sx<s+1;sx++){
p1=p1+cprice[sx];
}
p1=p1/20;
return p1;
}
}
最終更新:2011年04月17日 14:03