Skip to content

Commit

Permalink
Use foreach where I care about the side-effect instead of the return …
Browse files Browse the repository at this point in the history
…value
  • Loading branch information
Andreas Pauley committed Sep 21, 2011
1 parent c1c9049 commit 232ffe4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sudoku.erl
Expand Up @@ -188,7 +188,7 @@ values_length({S, Values}) ->
solve_all(GridList) -> solve_all(GridList) ->
PidGrids = [{spawn(fun server/0), Grid} PidGrids = [{spawn(fun server/0), Grid}
|| Grid <- GridList], || Grid <- GridList],
[send_puzzle(PG) || PG <- PidGrids], lists:foreach(fun send_puzzle/1, PidGrids),
[receive_solution(V) || V <- PidGrids]. [receive_solution(V) || V <- PidGrids].


send_puzzle({Pid, Grid}) -> Pid ! {self(), solve, Grid}. send_puzzle({Pid, Grid}) -> Pid ! {self(), solve, Grid}.
Expand Down

0 comments on commit 232ffe4

Please sign in to comment.