jauggy / balance_algorithm

0 stars 0 forks source link

Add helper function to check if team_groups has parties #4

Closed jauggy closed 4 months ago

jauggy commented 4 months ago

After calling BalanceLib.create_balance there is a map returned. This map has key team_groups

This will look like

    assert result.team_groups ==  %{
               1 => [
                 %{count: 1, group_rating: 6, members: ["Noob2"], ratings: [6]},
                 %{count: 1, group_rating: 8, members: ["Pro1"], ratings: [8]}
               ],
               2 => [
                 %{count: 1, group_rating: 5, members: ["Noob1"], ratings: [5]},
                 %{count: 1, group_rating: 17, members: ["Noob3"], ratings: [17]}
               ]
             }

If count is greater than 1 then we have parties

jauggy commented 4 months ago

I think we can enumerate as follows:

Enum.each(%{a: 1, b: 2, c: 3}, fn {k, v} ->
  IO.puts("#{k} --> #{v}")
end)