Skip to content

Commit e73ca35

Browse files
authored
Update README.md
1 parent 192b2d1 commit e73ca35

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ Below is an example of the GameOfLife rules json file:
1212
{
1313
"deathValues" : [1, 4],
1414
"survivialValues": [2, 3],
15-
"populationValues": [3]
15+
"populationValues": [3],
16+
"neighborPadding" : 1
1617
}
1718
```
1819
Cells will die when they have less than or equal to ```deathValues[0]``` neighbors, and more than or equal to ```deathValues[1]```.
1920
Cells will survive for the next iteration if the amount of neighbors they have equals any of the survivialValues. An empty cell will become populated if the amount of neighbors it has equals any of the population values.\
20-
Note that neighbors is equal to the 8 surrounding cells.
21+
To update the amount of cels in each direction you want to check for neighbors, update ```neighborPadding```. In the case of Conway's Game of Life, a padding of 1 checks the 8 surrounding cells.
2122

2223
### Applying a Custom Rule Set
2324
In the ``Rules`` class, change the line ```InputStream ruleFile = GraphicsManager.class.getResourceAsStream("/rules/GameOfLife_rules.json");``` to load the json file you just wrote: ```InputStream ruleFile = GraphicsManager.class.getResourceAsStream("/rules/MY_NEW_RULES.json");```

0 commit comments

Comments
 (0)