Permalink
Browse files

Shortcut boolean operations

  • Loading branch information...
1 parent 4698988 commit 0f865f33b46231fd1f230188e4c7015ab10abfee Andrey Paramonov committed Dec 12, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/life.erl
View
@@ -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, []).

0 comments on commit 0f865f3

Please sign in to comment.