2. Examining the Rule (continued)
18 |
else if (no:ctrl==down:ctrl && ctrl>1) |
19 |
ctrl--; |
Lines 18 and 19 are the second option of the IF statement when the first part is not proven true. Line 18 says that if the NO:CTRL equals the DOWN:CTRL, and CE (shown with a C in the table below) has a value greater than 1, then execute the statement in line 19. The TOP:CTRL is shown in the image below. It is the top neighbor (shown with an X). The image below is the table that explains the neighbors for this particular rule.
In this rule, each field has 7 neighbors. In the CA space window, click on File ->> Modify Template. Look at the portion of the window that appears labled Neighbor Positions. The C is considered a particular field and the X are the neighbors of that particular field. The field directly above the C is called the NO:CTRL. The field directly above the NO:CTRL is called TOP:CTRL. The names are user defined. Below is a table showing the names of each of the neighbors in this rule.
|
TOP:CTRL |
|
NE:CTRL |
NO:CTRL |
NW:CTRL |
EA:CTRL |
CE
|
WE:CTRL |
|
SO:CTRL |
|
|