lesson 5
This commit is contained in:
@@ -110,7 +110,7 @@ defmodule Numbers do
|
||||
end
|
||||
|
||||
koan "I want the first and last in the range" do
|
||||
first..last = Range.new(1, 10)
|
||||
first..last//_ = Range.new(1, 10)
|
||||
|
||||
assert first == 1
|
||||
assert last == 10
|
||||
|
@@ -5,15 +5,15 @@ defmodule Tuples do
|
||||
@intro "Tuples"
|
||||
|
||||
koan "Tuples can contain different things" do
|
||||
assert {:a, 1, "hi"} == ___
|
||||
assert {:a, 1, "hi"} == {:a, 1, "hi"}
|
||||
end
|
||||
|
||||
koan "Tuples have a size" do
|
||||
assert tuple_size({:a, :b, :c}) == ___
|
||||
assert tuple_size({:a, :b, :c}) == 3
|
||||
end
|
||||
|
||||
koan "You can pull out individual elements" do
|
||||
assert elem({:a, "hi"}, 1) == ___
|
||||
assert elem({:a, "hi"}, 1) == "hi"
|
||||
end
|
||||
|
||||
koan "You can change individual elements of a tuple" do
|
||||
|
Reference in New Issue
Block a user