Check out online: http://www.hamdikavak.com/sims/segregation/
Cellular-based simulation of Schelling's segregation model. The model shows that small preferences for one type of neighbor lead to clusters of people of the same type. It also exemplifies how macro behavior arises from micro behavior. The code is written in JavaScript language.