I received the following feedback to my answer to the High Score problem:
Use Map.update instead of Map.put + Map.get in update_score to update scores in a single call. For the updating function, define an anonymous function using fn or the & operator shorthand.
However, my code uses elixir's syntax sugar for updating the map as see here
def update_score(scores, name, score) do
if Map.has_key?(scores, name) do
%{scores | name => score + scores[name]}
else
add_player(scores, name, score)
end
end
I received the following feedback to my answer to the High Score problem:
Use Map.update instead of Map.put + Map.get in update_score to update scores in a single call. For the updating function, define an anonymous function using fn or the & operator shorthand.
However, my code uses elixir's syntax sugar for updating the map as see here