任何人都可以幫我嗎? 我們的老師給了我們一個關於「生命的遊戲」的任務,他實際上給了我們 我們可以使用的方法,但我真的不知道如何開始! 他要求我們使用3類:類小細胞,類ruleand類自動機(和主菜)java中的元胞自動機
package jeu_de_vie;
public class Cellule {
private int state; // should be equal to 0 (if alive) or 1 (if dead)
public Cellule(int state) { // constructor
this.state = state;
}
public void SetEtat(int state){}
public void Calculate_future_state(Cellule Cg, Cellule Cd,Regle R){} // to calculate the next state
public boolean Equals (Cellule A,Cellule B){} // to verify if the cellular are equal
}
」應該等於0(如果存活)或1(如果死了)「聽起來像一個布爾值可能更合適(或枚舉)。 –