2014-12-11 Lab

posted Dec 11, 2014, 4:53 AM by Samuel Konstantinovich   [ updated Dec 12, 2014, 4:53 AM ]
Goal: Cellular Automata

HW: Complete conways game of life

Regarding yesterday's lab:

If you think about your code using big ideas, and write functions to do those ideas, you will meet with more success.

Most of your cellular automata can be written in the following way using 'big ideas':

to go
  ask patches
  [   pickNextColor   ]
  ask patches
  [   changeColor   ]
end

OR in this specific case, since color is dependent on neighbor counts:

to go
  ask patches
  [   countNeighbors   ]
  ask patches
  [   changeColor   ]
end

PickColor will be different for different automata, but the separation of deciding what you want to be, and the changing into that new state must be clear. 
Comments