projects
/
cells.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
86662d1
)
Bug dans le jeu de la vie
author
Amélia Coutard-Sander
<git@ameliathe1st.gay>
Thu, 12 Dec 2024 23:22:10 +0000
(
00:22
+0100)
committer
Amélia Coutard-Sander
<git@ameliathe1st.gay>
Thu, 12 Dec 2024 23:22:10 +0000
(
00:22
+0100)
automata/automata/life.ml
patch
|
blob
|
history
diff --git
a/automata/automata/life.ml
b/automata/automata/life.ml
index 570ca4b851d3d6f5a771355e009e30a29609b395..69267bf4fd9f1f43dae7da9efb24e72bf7ff65c6 100644
(file)
--- a/
automata/automata/life.ml
+++ b/
automata/automata/life.ml
@@
-21,7
+21,7
@@
let neighbours = [(-1, -1); (-1, 0); (-1, 1); (0, -1); (0, 1); (1, -1); (1, 0);
let transition l c =
let n = List.length (List.filter (( = ) Alive) l) in
- if n <
= 2 || n >= 4
then Dead else if n == 3 then Alive else c
+ if n <
2 || n > 3
then Dead else if n == 3 then Alive else c
let default = Dead