// // ライフゲームエディタJava版第2回 // // 2000/ 6/20 宍戸 輝光 // import java.awt.*; import java.awt.event.*; class CLdat2 { // データクラス private byte lifes[][],blifes[][]; // セル配列 private int width,height; // 大きさ保存用変数 private int rules[]={-1,-1,0,1,-1,-1,-1,-1,-1}; CLdat2(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 byte getLife(int x,int y) { return lifes[x][y]; } public void setLife(int x,int y,byte val) { lifes[x][y]=val; } public void setRules(int rul[]) { rules=rul; } public int[] getRules() { return rules; } public void next() { // 1ステップ進める int i,j,k,l,n,x,y; for (i=0;i