-
Notifications
You must be signed in to change notification settings - Fork 0
/
Game of Life 5
48 lines (44 loc) · 1.91 KB
/
Game of Life 5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# -----------------------------------------------------------------------------
# LifeGame : Conway's Game of Life
# http://en.wikipedia.org/wiki/Conway's_Game_of_Life
#
# Description :
# - LifeGame is based on 2-state mineral agents: 'live' and 'dead'
# - 'live' agents generate a 'life' field on their 8 neighbouring cells
# - 'dead' and 'live' agents have a 'neighbour' sensor for this 'life' field
# -----------------------------------------------------------------------------
world 17 17 #FFF
mineral dead #FFF
var neighbour # default: InitValue=0 TimeStepValue=0
status neighbour < 4 live # 'dead' -> 'live' only when 'neighbour' == 3
status neighbour > 3 dead # status lines are evaluated in given order
status neighbour < 3 dead
sensor neighbour life 1 # 'life' field is scale by 1 and stored in 'neighbour'
mineral live #000
var life 2 # default: TimeStepValue=0
var neighbour # default: InitValue=0 TimeStepValue=0
status neighbour < 4 live # 'live' -> 'live' only when 'neighbour' == 2 or 3
status neighbour < 2 dead
status neighbour > 3 dead
field life -1
sensor neighbour life 1
# initial configuration for the pentadecathlon oscillator (period 15)
keys (-,dead) (+,live)
- - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
- - - - + + + - - - + + + - - - -
- - - - - - - - - - - - - - - - -
- - + - - - - + - + - - - - + - -
- - + - - - - + - + - - - - + - -
- - + - - - - + - + - - - - + - -
- - - - + + + - - - + + + - - - -
- - - - - - - - - - - - - - - - -
- - - - + + + - - - + + + - - - -
- - + - - - - + - + - - - - + - -
- - + - - - - + - + - - - - + - -
- - + - - - - + - + - - - - + - -
- - - - - - - - - - - - - - - - -
- - - - + + + - - - + + + - - - -
- - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
# -----------------------------------------------------------------------------