-
-
Save petros/a6115fd860bd793a07c9e4552b9df0e2 to your computer and use it in GitHub Desktop.
Chessboard - Elixir - Exercism
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Chessboard do | |
@spec rank_range :: Range.t() | |
def rank_range, do: 1..8 | |
@spec file_range :: Range.t() | |
def file_range, do: ?A..?H | |
@spec ranks :: list(integer()) | |
def ranks, do: Enum.to_list(rank_range()) | |
@spec files :: list(String.t()) | |
def files, do: Enum.map(file_range(), &<<&1>>) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment