Full Chess Game with AI in 5k of Javascript(p4wn.sourceforge.net)
p4wn.sourceforge.net
Full Chess Game with AI in 5k of Javascript
http://p4wn.sourceforge.net/5k/
13 comments
Terrible interface, terrible AI.
It plays too fast and loses quickly, is there a way to increase the search depth?
As I commented below, the source is unreadable, but I don't think it's using minimax. The algorithm simply seems to be don't leave pieces undefended and try to attack opponent's pieces. It didn't see my mate-in-two where the first move was a knight sacrifice.
I like the idea but it has some problems.
I played 2 games and in both of them it left pieces undefended. And when delivered checkmate he ate my defended queen with king :)
They obfuscate the source with one-letter variable names and no indentation to keep the size down, which is pretty silly. It wouldn't be any less impressive if it were 10k and readable.
Found this through their web site on SF.net:
http://p4wn.sourceforge.net/main-branch/
http://p4wn.sourceforge.net/main-branch/0_6_3.js
http://p4wn.sourceforge.net/main-branch/
http://p4wn.sourceforge.net/main-branch/0_6_3.js
I wasn't trying too hard, but I was up two pawns until I walked into a dumb checkmate. It's been way too long since I played chess...
[deleted]
I checkmated your 5k. Come back later with more code and we will play again.
It's pretty good.