mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-12-27 15:41:16 +08:00
commit
13dab5d4b0
@ -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],
|
||||||
|
Loading…
Reference in New Issue
Block a user