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

PCE-JS is the web implementation of PCE written in Javascript

License

Notifications You must be signed in to change notification settings

playeChess/PCE-JS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

PCE-JS is the web implementation of PCE written in Javascript

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published