Permalink
Browse files

correctly working parllel implementation

  • Loading branch information...
1 parent 2542cda commit 0fdc304deda5671ad344a4106c171acd012dad8b @martinrehfeld committed Jun 3, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 apps/countdown/src/cd_solver.erl
@@ -68,7 +68,10 @@ combine(A, Target, Operators, Numbers, NumberOfSolutions) ->
end,
F = fun (Index, Solutions, Array) ->
- array:set(Index, Solutions, Array)
+ ExistingSolutions = array:get(Index, Array),
+ MergedSolutions =
+ dict:merge(fun(_K, V1, _V2) -> V1 end, ExistingSolutions, Solutions),
+ array:set(Index, MergedSolutions, Array)
end,
FK =

0 comments on commit 0fdc304

Please sign in to comment.