let name = "Le Cerveau de Brian"
-type t = Off | Dying | On
+type t = Off | On | Dying
let neighbours = [(-1, -1); (-1, 0); (-1, 1); (0, -1); (0, 1); (1, -1); (1, 0); (1, 1)]
| Off ->
let n = List.length (List.filter (( = ) On) l) in
if n = 2 then On else Off
- | Dying -> Off
| On -> Dying
+ | Dying -> Off
let default = Off
let prev = function
- | Off -> On
- | Dying -> Off
- | On -> Dying
-
-let next = function
| Off -> Dying
- | Dying -> On
| On -> Off
+ | Dying -> On
+
+let next = function
+ | Off -> On
+ | On -> Dying
+ | Dying -> Off
let color = function
| Off -> ('\x00', '\x00', '\x1F')
- | Dying -> ('\x00', '\x00', '\xFF')
| On -> ('\xFF', '\xFF', '\xFF')
+ | Dying -> ('\x00', '\x00', '\xFF')