How to make a solvable slide puzzle in HTML?

It was only for up key press, you need to add for others yourself.

One more thing you can remove first two lines from each if else condition. If you’re calling getPos() each time.

1 Like