Notice: add_custom_background is deprecated since version 3.4! Use add_theme_support( 'custom-background', $args ) instead. in D:\InetPub\vhosts\roomsel-83.package\\wwwroot\wp-includes\functions.php on line 2839
Chess Game « Travis V. Anderson

Engineer by day, Superhero by night — Amazing all the time

RSS LinkedIn Twitter YouTube Design Exploration RSS

For my optimization class last semester, I built an entire chess game using HTML and JavaScript. I also wrote an artificial intelligence algorithm to play as a computer player. My algorithm has about 20 different parameters it uses to score each move and decide which move it should take. For my optimization class project, I then wrote a real-value genetic algorithm with to optimize these 20 parameters to find the “best” settings for the computer player.

My algorithm here only does a two-ply (easy setting) or a three-ply (hard setting) search. With more computing power, this could be increased to improve the “skill” of my computer player. I ran my genetic optimization algorithm on the two-ply search, and that alone took a pretty significant amount of computing time:

Total Generations: 31
Total Players: 128
Games Played: 1,832
Turns Taken: 637,900
Processing Time: 3,830 core-hours (160 continuous days)

There are still a few small bugs that need to worked out (castling sometimes doesn’t work properly, en passant isn’t possible, and a stalemate is treated as a checkmate). But overall, it’s been a fun project to work on!

Click here to play a live demo!

(Of course, this game is fastest in Chrome, and awfully slow in Internet Explorer.

Written by Travis Anderson on May 8th, 2011 , Optimization, Software Development Tags: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>