publicclassCellextendsFrameimplementsRunnable{Threadrunner=newThread(this);//为类定义一个线程,在start中启用publicstaticintwidth=308;publicstaticintheight=255;intcellGrid[][]=null;inttempCellGrid[][]=null;intrule[][][][][][][][][];//判断规则,每次预先生成intsize=50;intdelay=500;doubleper=0.3;//起始时生存者占整