|
BFOIT
Introduction
Arrays The Game of Life |
|
In this lesson, you will learn
The "Game of Life" is played on a grid. The squares of the grid are called cells. A cell that is alive is colored in. The rules for Life are simple. They are:
A cell's neighbors are the eight cells which surround it (to its north, northeast, east, etc...).
| Game of Life Applet |
Here is a Java applet. Draw some patterns by clicking the left mouse button on squares to bring them to life. Then click on the [Step] button to watch what happens as the rules are applied in one cycle of Life.
| New TurtleTalk Procedures Used In This Lesson | |||
| Name | Input | Description | Example |
| ARRAY | size | Outputs an array of size members, each of which is initially an empty sentence. Size must be a positive integer. | MAKE "nums ARRAY 5 |
| FLOOR | number | Outputs the largest integer (closest to positive infinity) that is not greater than number. | FLOOR 12.875 |
| SETITEM |
index array value |
Replaces the indexth member of array with value. | SETITEM 2 :nums "two |