Giter VIP home page Giter VIP logo

deep-duck's Introduction

ExpiraBot Logo

Deep Duck

What?

Deep duck is an engine to evaluate and sugest moves for the duck chess variant.

Why?

When I found this game and played it online, I quickly discovered that I was pretty bad at it. Then I thought "Well, I will play against some bots and then come back here". To my surprise bots didn't existed yet, so I made my own.

Is it a good chess engine?

Yeah, it already is much better than me (not that hard), and it is already stronger than the stockfish engine used in Pychess. Here you can see two games played between Duck Chess and Fairy Stockfish.

SPOILER ALERT: Deep duck won both!

As white

see more

As black

see more

Nice, how it works?

This was implemented in Rust using the old fashioned way:

  • Taking inspiration on Deep Blue, its grandfather

  • Testing (almost) every move possible

  • Repeat this process for you and for your enemy some times

  • Then use a hand crafted evaluation to see if the outcome looks like a good position for you or not

If you are interestd in more details, here we go:

  • I am using Negamax with alpha-beta pruning and a simple move ordering.

  • To represent the board I am using the mailbox aproach, were I have an 64 sized array of pieces or empty squares. The other aproach usually involves some bitwise wizardry.

  • For performance reasons I just test 3 duck positions: the previous position of the moved piece, the position blocking the piece we think the enemy wants to move, the position we think the enemy wants to put the duck. That misses some cases were the duck can block two pieces the same time, but in general seems a very usefull heuristics.

How can I use this?

In the future you will play it here, but it is not working yet.

In the meantime you can compile and run the CLI, then put in the FEN of your chess position. The engine will show the position and say the best the best movement it finds.

To help you with the FEN stuff use this nice editor from pychess, then copy and paste the FEN code. Here is an example of how you can use Deep Duck to evaluate a position for your game.

How can I compile it?

You will need Cargo. If you don't have it installed just run the following command on your terminal (check out here for more info):

  curl https://sh.rustup.rs -sSf | sh

Then run this in your terminal:

    cargo run --release

It is important to use the --release, because chess engine is a very time consuming task and every optimization is wellcome.

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.