Skip to content

Commit 19e3d89

Browse files
Change string category to atom
Co-authored-by: Angelika Tyborska <[email protected]>
1 parent 43049e3 commit 19e3d89

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed
Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
defmodule Yacht do
2+
@type category ::
3+
:ones
4+
| :twos
5+
| :threes
6+
| :fours
7+
| :fives
8+
| :sixes
9+
| :full_house
10+
| :four_of_a_kind
11+
| :little_straight
12+
| :big_straight
13+
| :choice
14+
| :yacht
15+
216
@doc """
317
Calculate the score of 5 dice using the given category's scoring method.
418
"""
5-
@spec score(category :: String.t(), dice :: [integer]) :: integer
6-
def score(category, dice) do
19+
@spec score(category :: category(), dice :: [integer]) :: integer
720
end
821
end

0 commit comments

Comments
 (0)