Write a function that takes a chess position as a tuple (such as
[:A 4]). If there were a knight there, where would it be able to move? Have the function return a collection of all possible moves for that knight. Assume there are no other pieces on the board. Be sure the knight doesn't leave the board.
(knight-move [:D 3]) ;=> [[:B 2] [:C 1] [:B 4] [:C 5] [:E 5] [:F 4] [:E 1] [:F 2]] (knight-move [:A 1]) ;=> [[:B 3] [:C 2]]
Please submit your solutions as comments on this gist.
To subscribe: https://purelyfunctional.tv/newsletter/