My attempt at programming a chess engine from scratch
Enter python environment
source /workspaces/ChessDex/.venv/bin/activate
. .venv/bin/activateStart the local web UI (board in the browser, JSON API on port 8765):
source .venv/bin/activate
python src/play_ui.py
# or: python src/main.pyOpen http://127.0.0.1:8765/ — click squares to move, choose mode (human/human, vs engine, engine/engine), toggle Show engine best move, undo, etc. Terminal-only play: python src/play_solo.py.
Hosted demo (after deploy): https://chessdex.onrender.com — also embedded at dextercarpenter.github.io/chessdex.
pytest -vfrom pathlib import Path
from models.bitboard import Board
PATH_TO = Path(__file__).parent / "path" / "to"
board = Board().from_pgn(PATH_TO / "easyM2.pgn")