diff --git a/lib/koans/17_map_sets.ex b/lib/koans/10_map_sets.ex similarity index 85% rename from lib/koans/17_map_sets.ex rename to lib/koans/10_map_sets.ex index 41ed908..6777150 100644 --- a/lib/koans/17_map_sets.ex +++ b/lib/koans/10_map_sets.ex @@ -1,21 +1,27 @@ defmodule MapSets do use Koans - @intro "My name is Set, MapSet" + @intro "My name is Set, MapSet." @set MapSet.new([1, 2, 3, 4, 5]) - koan "Does this value exist in the map set?" do - assert MapSet.member?(@set, 3) == ___ - end - - koan "Multiply everything by 3 in my set" do + koan "I am merely another collection but, you can perform some operations on me" do new_set = MapSet.new(@set, fn x -> 3 * x end) assert MapSet.member?(new_set, 15) == ___ assert MapSet.member?(new_set, 1) == ___ end + koan "However, I do not allow duplication" do + new_set = MapSet.new([1, 1, 2, 3, 3, 3]) + + assert MapSet.size(new_set) == ___ + end + + koan "Does this value exist in the map set?" do + assert MapSet.member?(@set, 3) == ___ + end + koan "Add this value into a map set" do modified_set = MapSet.put(@set, 6) @@ -44,12 +50,6 @@ defmodule MapSets do assert MapSet.member?(intersection_set, 5) == ___ end - koan "Duplication is a no-no" do - new_set = MapSet.new([1, 1, 2, 3, 3]) - - assert MapSet.size(new_set) == ___ - end - koan "Unify my sets" do new_set = MapSet.union(@set, MapSet.new([1, 5, 6, 7])) diff --git a/lib/koans/10_structs.ex b/lib/koans/11_structs.ex similarity index 100% rename from lib/koans/10_structs.ex rename to lib/koans/11_structs.ex diff --git a/lib/koans/11_pattern_matching.ex b/lib/koans/12_pattern_matching.ex similarity index 100% rename from lib/koans/11_pattern_matching.ex rename to lib/koans/12_pattern_matching.ex diff --git a/lib/koans/12_functions.ex b/lib/koans/13_functions.ex similarity index 100% rename from lib/koans/12_functions.ex rename to lib/koans/13_functions.ex diff --git a/lib/koans/13_enums.ex b/lib/koans/14_enums.ex similarity index 100% rename from lib/koans/13_enums.ex rename to lib/koans/14_enums.ex diff --git a/lib/koans/14_processes.ex b/lib/koans/15_processes.ex similarity index 100% rename from lib/koans/14_processes.ex rename to lib/koans/15_processes.ex diff --git a/lib/koans/15_tasks.ex b/lib/koans/16_tasks.ex similarity index 100% rename from lib/koans/15_tasks.ex rename to lib/koans/16_tasks.ex diff --git a/lib/koans/16_agents.ex b/lib/koans/17_agents.ex similarity index 100% rename from lib/koans/16_agents.ex rename to lib/koans/17_agents.ex diff --git a/lib/koans/16_protocols.ex b/lib/koans/18_protocols.ex similarity index 100% rename from lib/koans/16_protocols.ex rename to lib/koans/18_protocols.ex diff --git a/lib/runner.ex b/lib/runner.ex index 35bab7c..ac87ae5 100644 --- a/lib/runner.ex +++ b/lib/runner.ex @@ -9,6 +9,7 @@ defmodule Runner do Lists, KeywordLists, Maps, + MapSets, Structs, PatternMatching, Functions, @@ -17,7 +18,6 @@ defmodule Runner do Tasks, Agents, Protocols, - MapSets, ] def koan?(koan), do: Enum.member?(@modules, koan)