...

Computer chess challenge

Write a chess program as fast as you can!

About

The Computer Chess Challenge is a programming challenge where you try to write a chess program in as little time as possible. The inspiration for the challenge was a tweet by @lisperati, where he asked programmers to estimate how long it would take to implement chess:

Well, how long does it take? Let's find out!

Crack open your favourite editor, start the clock and write a command-line chess program for two players. When you've implemented all the requirements, stop the clock and note your time. That's it!

When you're done, you can share the result!

Requirements

Gameplay

  • The game should support two human players. When it's a player's turn to move, the game displays a text input prompt.
  • A player moves a piece by entering a move in algebraic notation. Captures and checkmate can be omitted.
  • The game is over when a player checkmates the other player, or when a stalemate is detected (which counts as a draw).
  • Detecting draw conditions other than stalemate (dead positions, threefold repetition, fifty-move rule, etc) is optional.
  • A player can concede at any time.

Chess rules

All the rules of chess should be implemented. Aside from the basic moves, don't forget to support these special moves as well:

Results

Want to share the result of the challenge? Input your details here and we'll put you in the list of participants!

How did it go? How long did it take? Was it all smooth sailing, or did you thrash wildly until inspiration struck at the last minute? Let us know in the "Comments" field!

Tip: If you've recorded or streamed yourself doing the challenge, you can leave the URL of your channel in the "Website link" field.

* Required field

Participants

chreke