Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Latest commit

 

History

History
80 lines (50 loc) · 1.67 KB

README.md

File metadata and controls

80 lines (50 loc) · 1.67 KB

PCE-JS

PCE-JS is a chess engine for playeChess

User functions

PCE.status()

Description

Gets the status of the game

Returns

status_id
  • Type: int
  • Description: The status id (0 -> game ongoing; 1 -> draw; 2 -> win)
  • Optionnal: No
detail_id
  • Type: int
  • Description: Only for status_id=1 (0: stalemate; 1: insufficient material; 2: 50 moves rule; 3: threefold repetition) and status_id=2 (0: white, 1: black)
  • Optionnal: Yes

PCE.getMoves(start_pos)

Description

Gets all possible moves for a piece

Arguments

start_pos
  • Type: array[int]
  • Description: The coordiates of the piece to get moves for
  • Optionnal: No

Returns

moves
  • Type: array[array[array[int]]
  • Description: All the possible moves (returned as an array of [[start_x, start_y], [end_x, end_y]])
  • Optionnal: No

PCE.move(start_pos, end_pos)

Description

Moves a piece from start_pos to end_pos

Arguments

start_pos
  • Type: array[int]
  • Description: The start coordinates
  • Optionnal: No
end_pos
  • Type: array[int]
  • Description: The end coordinates
  • Optionnal: No

TODO

  • Enums
    • status_id
    • detail_id (status_id=1)
    • detail_id (status_id=2)