mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2025-07-08 10:24:54 +08:00
@ -4,7 +4,7 @@
|
|||||||
* @return {number[][]}
|
* @return {number[][]}
|
||||||
*/
|
*/
|
||||||
function getPossibleMoves(chessboard, position) {
|
function getPossibleMoves(chessboard, position) {
|
||||||
// Generate all knight moves (event those that goes beyond the board).
|
// Generate all knight moves (even those that go beyond the board).
|
||||||
const possibleMoves = [
|
const possibleMoves = [
|
||||||
[position[0] - 1, position[1] - 2],
|
[position[0] - 1, position[1] - 2],
|
||||||
[position[0] - 2, position[1] - 1],
|
[position[0] - 2, position[1] - 1],
|
||||||
|
Reference in New Issue
Block a user