Skip to content

Tiny chess AI made as part of Sebastian Lague's competition, ranked 117th/624: https://youtu.be/iScy18pVR58

License

Notifications You must be signed in to change notification settings

m0hossam/tiny-chess-duck

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TinyChessDuck: A 969 Tokens C# Chess Bot

  • This is a chess bot I wrote in a single 969-tokens C# file as part of youtuber Sebastian Lague's Chess Coding Challenge.
  • The challenge was: Given a chess framework, implement a chess AI under the limit of 1024 tokens only to battle it out against other participants' bots.
  • Overall, I enjoyed participating very much, I learned a lot about chess programming, search algorithms and evaluation heuristics, and my bot did surprisingly well in the tournament (see results).

Table of Contents

Objective

The objective of this challenge was to implement strong chess search and evaluation algorithms in a maximum of 1024 tokens of code, without the overhead of writing an entire chess framework. This limit was (probably) enforced for 2 reasons:

  • Preventing participants from copying code from famous open source chess engines (for example: Stockfish)
  • Encouraging participants to come up with creative ways of writing tiny chess AI algorithms, for example:
    • Designing compression/encoding algorithms for big amounts of values like piece square tables
    • Choosing between multiple search extension algorithms, pruning techniques and evaluation parameters (you can't fit'em all in 1024 tokens!)

I learned a lot about chess AI programming and I got a chance to apply my problem-solving techniques to overcome the token-limit problem, like:

The AI

Most chess bots consist of a Search function and an Evaluation function.

Results

My bot ranked 117th out of 624 bots, sadly - but understandably - it wasn't mentioned in Sebastian's results video. Here is a screenshot from the video:
Bot Rank

Tournament games played by all bots were published to this repo, I wrote a simple Python script to extract my bot's 64 games out of all games and analyze basic stats like wins/losses and color. Here are the results: bot results

Try It

  • If you just want to play against the bot, download and run the executable from here
  • If you want to run the project in your IDE, you must have .NET 6.0, download the source code and open Chess-Challenge.sln

Credits

About

Tiny chess AI made as part of Sebastian Lague's competition, ranked 117th/624: https://youtu.be/iScy18pVR58

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 99.8%
  • GLSL 0.2%