Skip to content

mrdavidoneill/chess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chess

My implementation of chess
Reacts to all current rules of chess, including en-passant, castling, 50 move rule, threefold repetition draw rule etc.

Can import FEN to start from a specific position.

FEN format starting position:
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

It also has a very basic AI which you can play against. Currently it just chooses a random legal move.

Prerequisites

I used pygame 1.9.6 and Python 3.7

Instructions

Run main.py to play both sides
python run.py

Run main.py with argument of 'ai' to against ai
python run.py ai

Run main.py with FEN as command line argument to play from FEN position eg:
python run.py "r1bqkb1r/pp3ppp/2np1n2/4p1B1/3NP3/2N5/PPP2PPP/R2QKB1R w KQkq e6 1 7"

Run main.py with both ai and FEN as command line arguments to play from FEN position against computer eg:
python run.py ai "1k1r4/pp1b1R2/3q2pp/4p3/2B5/4Q3/PPP2B2/2K5 b - -"

About

My take on a chess game using pygame

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages