Is your feature request related to a problem? Please describe. 💡
The puzzles page would allow a user to practice random puzzles with varying ELO ratings. The basic functionality including but not limited to:
- whenever the user visits the page, a random chess puzzle is generated for them to solve
- a chessboard would be displaying for acting as an interface
- an error would pop up indicating a wrong move at every turn should a user do so
- a verdict would be given if the user has been able to successfully solve it
- two buttons for navigating to the
next random puzzle as well as to the previous puzzle
- the previous button would be disabled when a user first visits or refreshes
- on clicking
previous and next consecutively shouldn't display a random puzzle but the one that has been visited before
Describe the solution you'd like ✨
The puzzles component will consist of the following elements:
- The chessboard
- use
react-chessground for the UI, chess.js for the logic and chessblunders for the API
- The previous and the next button
- In order to access the specific puzzle, maintain a state for all the visited puzzle ids until the next exit or refresh
Describe alternatives you've considered 🌟
Haven't considered any other alternatives but open to suggestions ☺️
Additional context 📝
For the API, create a new service class called PuzzleService and save it inside the client/src/services folder named puzzle.service.js. The class should contain a method called getPuzzle(<optional id argument>) which calls the following endpoint - https://chessblunders.org/api/blunder/get, method=POST and body includes -
For further references regarding the implementation, you could check game.js and game.controller.js except the logic would be handled on the client-side!
Is your feature request related to a problem? Please describe. 💡
The puzzles page would allow a user to practice random puzzles with varying ELO ratings. The basic functionality including but not limited to:
nextrandom puzzle as well as to thepreviouspuzzlepreviousandnextconsecutively shouldn't display a random puzzle but the one that has been visited beforeDescribe the solution you'd like ✨
The puzzles component will consist of the following elements:
react-chessgroundfor the UI,chess.jsfor the logic and chessblunders for the APIDescribe alternatives you've considered 🌟☺️
Haven't considered any other alternatives but open to suggestions
Additional context 📝
For the API, create a new service class called PuzzleService and save it inside the
client/src/servicesfolder namedpuzzle.service.js. The class should contain a method calledgetPuzzle(<optional id argument>)which calls the following endpoint -https://chessblunders.org/api/blunder/get, method=POST and body includes -{ "type": "explore" }For further references regarding the implementation, you could check
game.jsandgame.controller.jsexcept the logic would be handled on the client-side!