Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Shortcut boolean operations

  • Loading branch information...
commit 0f865f33b46231fd1f230188e4c7015ab10abfee 1 parent 4698988
Andrey Paramonov authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/life.erl
View
2  src/life.erl
@@ -9,7 +9,7 @@ neighbours({X, Y}) ->
next_step(Cells) ->
Nbs = flatmap(fun neighbours/1, to_list(Cells)),
NewCells = [C || {C, N} <- frequencies(Nbs),
- (N == 3) or ((N == 2) and is_element(C, Cells))],
+ (N == 3) orelse ((N == 2) andalso is_element(C, Cells))],
from_list(NewCells).
frequencies(List) -> frequencies(List, []).
Please sign in to comment.
Something went wrong with that request. Please try again.