+ 1
How to move checker pieces to other empty adjacent cells with JavaScript?
I have managed to built a checker board with the logic in this code and also the logic to highlight a piece selected by a user. Now I am trying to move a selected piece to a target box with the code in this link https://www.sololearn.com/en/compiler-playground/Wqj1xZCyq6s5 How do I complete the code to move the pieces around, Thank You
1 Resposta
+ 2
I guess you'd have to check if the player's move is valid, then delete the piece from the old position and update it to the new position. If it captures another player's piece, you'll have to remove that one.
I'm not sure if the sign up and possibly gambling aspect are allowed under the terms and conditions of Sololearn.