mirror of
https://github.com/danbee/chess
synced 2025-03-04 08:39:06 +00:00
Consistency
This commit is contained in:
parent
5fce02feb5
commit
49bba88f07
@ -4,10 +4,10 @@ defmodule Chess.Moves.Pieces.King do
|
|||||||
alias Chess.Moves.Generator
|
alias Chess.Moves.Generator
|
||||||
|
|
||||||
def moves(board, {file, rank}) do
|
def moves(board, {file, rank}) do
|
||||||
Generator.moves(board, {file, rank}, patterns())
|
Generator.moves(board, {file, rank}, pattern())
|
||||||
end
|
end
|
||||||
|
|
||||||
defp patterns do
|
defp pattern do
|
||||||
[{1, 1}, {1, 0}, {1, -1}, {0, -1}, {-1, -1}, {-1, 0}, {-1, 1}, {0, 1}]
|
[{1, 1}, {1, 0}, {1, -1}, {0, -1}, {-1, -1}, {-1, 0}, {-1, 1}, {0, 1}]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user