Code Monkey home page Code Monkey logo

chess-ai's Introduction

Unicode chess game

Chess game coded in Python

Rules

Check

  • When a king is under immediate attack

Checkmate

  • When a king is in check and there is no legal moves to get out of the check

Pawn promotion

  • When a pawn advances to its eight rank, as part of the move
  • Is currently exchanged for a queen

Castling

  • Neither the king nor the rook has previously moved during the game
  • there are no pieces between the king and the rook
  • the king is not in check, and will not pass through or land on any square attacked by an enemy piece
  • (castling is permitted if the rook is under attack)

En passant

  • When a pawn makes a two-step advance from its starting position and there is an opponent's pawn on a square next ot the destination square on an adjacent file, then the opponent's pawn can capture it, moving to the square the pawn passed over. This can only be done on the very next turn, otherwise the right to do so is forfeited

Draw Conditions

  • Stalemate: if the player on turn that has no legal moves, but is not in check
  • Fifty-move rule

Scoring

TODO

chess-ai's People

Contributors

johannpistorius avatar

Watchers

 avatar

chess-ai's Issues

Add functionality to draw games

Difference from check:

  • King can no longer move, but is not directly attacked
  • No other pieces can move

Fifty-move rule

  • The fifty-move rule in chess states that a player can claim a draw if no capture has been made and no pawn has been moved in the last fifty moves (for this purpose a "move" consists of a player completing a turn followed by the opponent completing a turn).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.