アットウィキロゴ

AAAおおおい

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 p1,p2;
for(s=100;s<500;s++){
p1=cprice[s]/10;
p2=ki(s)/10;
g.setColor(Color.red);
g.fillRect(100+s,600-p2,1,p2);
g.setColor(Color.blue);
g.fillRect(100+s,600-p1,1,p1);
}

}

int ki(int s){
int sx,p1;
int maxp,minp;
maxp=-999;
minp=999999;
for(sx=s-26;sx<s+1;sx++){
if(cprice[sx]>maxp)maxp=cprice[sx];
if(cprice[sx]<minp)minp=cprice[sx];
}
p1=(maxp+minp)/2;
return p1;
}



}
最終更新:2011年04月17日 14:19