コード例 #1
0
ファイル: Form1.cs プロジェクト: calebthompson/School
 private void Form1_Load(object sender, EventArgs e)
 {
     bmp = new Bitmap(gridBox.Width, gridBox.Height);
     gpx = Graphics.FromImage(bmp);
     gridBox.Image = bmp;
     // Initialize the CA here.
     langtons = new LangtonsLoop.Rule();
     theCA = new World(gridBox.Width / DIVISOR, gridBox.Height / DIVISOR, langtons);
     updateGraphics();
     gridBox.Refresh();
     Console.WriteLine("The CA has been created.");
 }
コード例 #2
0
ファイル: Cell.cs プロジェクト: calebthompson/School
 public Cell(World world, CellState initialState, Rule rule)
 {
     this.world = world;
     this.currentState = initialState;
     this.rule = rule;
 }
コード例 #3
0
ファイル: Form1.cs プロジェクト: calebthompson/School
 private void resetButton_Click(object sender, EventArgs e)
 {
     theCA = new World(gridBox.Width / DIVISOR, gridBox.Height / DIVISOR, langtons);
     updateGraphics();
     gridBox.Refresh();
 }