Automated Board Gaming
The CHESS ROBOT began as a college project and is an IOT project showcasing the integration between web interface and physical mechanical devices. While the project is still being developed, the web portion is currently available as an open-source distribution.
A typical chess board comprises of 64 squares, labeled from A1 to H8. The movement of pieces on the board can be indicated by their corresponding square names. For instance, a pawn can move one step horizontally from A2 to A3. The chess board is made up of six different types of pieces: pawn, knight, queen, bishop, king, and rook. Each of these pieces moves differently, either in the same or in different directions. Their movements can be classified into three main categories: horizontal, vertical, and diagonal. Additionally, there is an extra move type called the L movement, which refers to the movement of the knight that involves two and a half steps.
Yet to be written .
Game consist of 3 configuration array :
- Chess coin properties ( coin name , initial position ,etc )
- Chess rules
- Chess movement
- Direction of movement
The given array is comprised of two jagged arrays, where array[0] is for white pieces, and array[1] is for black pieces. Each of these arrays contains 16 elements, i.e., array[0/1][0] to array[1/0][15], representing the 16 pieces of each team. Each of these elements contains the properties of a piece as follows:
- Move the piece from one square to another.
- Proceed to step 2.
- The drop() function creates an array called piece_status and proceeds to step 3 to set the prop-img.
- The piece_status array is passed as a parameter to the getMovement() function, which returns an array of possible chess movements. Proceed to step 4.
- The piece_status array and the output of the getMovement() function are passed as parameters to the checkRules() function. This function validates the rules and returns either true or false. If the returned parameter is true, proceed to step 5, else proceed to step 6. [checkRules(piece_status, getPieceMovement(piece_status))]
- If the returned parameter is true, move the chess piece to the destination using the movePieces() function, which takes two parameters as arguments. After the movement, proceed to step 7. [movePieces(piece_drop_pos, chess_piece, piece_status);]
- If the returned parameter is false, discard the move.
- The movePieces() function moves the pieces to the appropriate place and, if necessary, removes pieces from the game. If the pieces do not replace each other, proceed to step 9, else proceed to step 8.
- The showOutPiece() function is called, and the inactive pieces are displayed in a separate section. Proceed to step 9.
- The process ends.