// // ライフゲームエディタJava版第3回 // // 2000/ 6/23-2001/ 2/19 宍戸 輝光 // import java.awt.*; import java.awt.event.*; class CLdat3 { // データクラス private byte lifes[],blifes[]; // セル配列 private int width,height,step,nlife; // 大きさ保存用変数 private int rules[]={-1,-1,0,1,-1,-1,-1,-1,-1}; CLdat3(int w,int h) { // コンストラクタ width=w; height=h; // 指定された大きさでセル配列確保 lifes=new byte[width*height]; blifes=new byte[width*height]; } public int getWidth() { return width; } public int getHeight() { return height; } public int getStep() { return step; } public int getNlife() { return nlife; } public byte getLife(int x,int y) { return lifes[x+y*width]; } public void setLife(int x,int y,byte val) { lifes[x+y*width]=val; nlife=0; for (int i=0;i