I'm about 1850 in Lichess blitz, and it played at the level of an earnest 12 year old, which is actually meant as a compliment. It got crazy with its kingside pawns in the opening (no book knowledge), lost material pretty steadily and was checkmated down a queen, bishop and two pawns by move 25.
But it developed some pieces sensibly, made obvious recaptures and was not reckless about king safety. It avoided pointless toggling moves and suicidal piece jettisoning.
You've earned the right to be a proud papa on this one.
Anti-computer tactics in chess: https://en.wikipedia.org/wiki/Anti-computer_tactics
EDIT: GothamChess used a similar system to defeat a bot: https://www.youtube.com/watch?v=l5MD6hn5PgI (from 1:59)
Your comment reminded me of one of my favorite scenes from the great movie, Big Daddy.
The "How it works" link says it looks ahead 4 moves, that's probably 2 ply.
Can you say what the lookahead is like? Is it a version of minimax?
I lost every game. The kids were something like 10 years old. Admittedly, I know little more than the rules, but I expected to at least give one or two of them trouble by playing logical. Not so...
They had the best time, seeing in how many moves they could beat me. In my last game I tried an unusual (okay, stupid) opening hoping to at least break any pattern they have, but that just made me lose even faster. Be weary of 12-year-olds if they're playing in a chess club!
Not sure if I agree completly, but since you can win in under 10 moves simply focusing on an attack in the king I know what he means (wasn't quite a fools mate, but couldn't protect the Kings side)
I think that a 12 year old would play Mord reckless and would make more obvious mistakes. I think this is at the level oft a self taught novice that only played against another self taught novice (funny enough I was thinking of when I player chess against my friends when I was 12...) good times
It seems like there's broad agreement on skill level.
I expected it to play like Ed's Chess on DOS, which I always had trouble beating. IIRC that engine looks 3-4 moves ahead usually, but 6-7 moves ahead when it needs to. No idea how big the equivalent JS would be.
In GOFAI (https://en.wikipedia.org/wiki/Symbolic_artificial_intelligen...) there's a clear pattern where "intelligence" in abstract strategy games represents, in part, being able to prune game trees well without having to search them exhaustively. In some cases that means having a good evaluation function for positions, and in other cases having a cleverer search strategy in another way.
Thinking about this made me realize that it's not just impressive that this program plays decently while being tiny, but especially that it plays decently and quickly while being tiny.
Haven't done any more digging into this but it did give me something to ponder about.
Yeah I wonder if there are subfields of chess programing that optimize for that, something like "quality of engine per unit code size".
“We describe the combination of two search methods used to solve Nine Men’s Morris. An improved retrograde analysis algorithm computed endgame databases comprising about 10¹⁰ states. An 18-ply alpha-beta search then used these databases to prove that the value of the initial position is a draw”
So they built a database containing all all 7,673,759,269 possible positions in the endgame phase (i.e. after all stones are on the board), and then did a full-depth search for the “place stones” phase.
Paper is from 1996, so one might think current hardware could do a full search, but they show (page 10/110) a position with “White to move and win. Mill closure in 187 plies.”
So, I don’t think this game is small enough to search the full tree. They made it small by first creating an endgame database with 7,673,759,269 endgames, but that database requires over a gigabyte of data (“The hash function we decided to use maps the 7,673,759,269 states into a range of 9,074,932,579 indices.”)
"NB: if puzzled by a pawn move, please check for en passant before reporting a bug"
Even on reddit, when you get a high ranked comment, you will often get the same reply over and over again, even though a similar response is already the highest ranked reply to yours. There are people who just want to blurt out their opinion regardless of whether it's original or not..
I can't remember who I stole "the internet is write only" but it's felt very true as audience size exploded.
Perhaps the worst part is that it's self reinforcing in either direction, and few people ever leave the agora unless they delve into niche subjects, so they bring the agora mentality with them.
I think this is the key point. As with most issues on the internet, it's mostly an issue of scale. I assume these problematic users are actually only a very small fraction overall, but as the overall size grows, so does the number of people who belong at the very edge of the bell curve in terms of "normal" behavior.
With scale, any rare issue becomes common enough to be annoying.
When I finally beat it, it seemed to let me fork it's pieces in the corner, and then in endgame, it knows nothing about the positional strategy to avoid forks or mating combinations, since it only has 4 move lookahead. It let me material with king and rook even though it had a knight that could have interfered.
This code must be pretty compact even if expanded to readable form? Is there a repo anywhere with this type of chess engine explained and expanded to human readable commented code?
The slightly older C version: https://nanochess.org/chess1.html
The author wrote a book commenting and explaining the C version, it's 170 pages long! https://nanochess.org/chess3.html#book
Edit: MicroMax is a close competitor that also has very good explanations on their website https://home.hccnet.nl/h.g.muller/max-src2.html .
If you fancy learning more about the game take a look at tactics, and maybe try a tactics trainer. The next level of play is about understanding things like forks and discovered attacks where you aren't assuming that the other player is just going to make huge blunders that give you pieces.
In an effort to guestimate its strength a little more accurately, I had it play the first 4 levels of bots on lichess.org. It comfortably beat the level 3 (1400) bot and got crushed by the level 4 (1700) bot. Combined with beating me 3-1, I would estimate its lichess equivalent Elo rating to be somewhere in the 1400-1500 range.
I can reliably beat the 1100 bot and lose to the 1400 bot so they at least seem to be in the ballpark of matching my rating on the site for my hardware though.
I may say its chess.com rating might be around 600-700.
Seems like it only really looks out one move ahead, taking whatever has the most value, otherwise protecting.
Thanks for sharing!
...now imagine what you could do with 2048 bytes!
Beware, it plays at grandmaster strength!
Regardless, this is so cool.
Still looks a bit weird on my iPad (huge black pawns), but easier to beat because it’s easier to see the board.
1 e4 e5
2 Nf3 f6
3 Nxe5 fxe5
4 Qh5+ Ke7
5 Qxe5+ Kf7
6 Bc4+ Kg6
7 Qf5+ Kh6
8 h4 d6
9 d4+ g5
10 hxg5+ Kg7
Loved the pixel art and all too, lulls you in. It is a little hard to tell from the pieces alone which they are.
Because it doesn't have depth it can be tricked with tactics setups (forks, discoveries etc).
But this is overall an amazing accomplishment. I've played several good games with it so far.
In particular the pawns and bishops are way too similar, especially black.
I've been able to grab a few of its pawns early in the game. (I think its weakness is it assigns a low priority to protecting pawns. Or maybe it isn't able to look ahead far enough to see that I've got two attacks on the pawns instead of one.) It also didn't seem to be able to anticipate a "discovered check." It's good at setting up forks -- although at least once it forked me and then when I'd moved my King, didn't take the other piece!
And by blundered, I don't mean "made a bad move that I was able to take advantage of", I mean literally placed their rook infront of my pawn kind of blunder.
Second game I got threefold while down a rook in a completely lost position (which I'll blame in part on the graphics, but was mostly me blundering).
Graphics are horrible though, very easy to confuse bishops and knights.
Of course I would say I lost the first game because of graphics and being hard to tell pawns from bishops, but it definitely wrecked me on the first try. Second try it blundered much more.
But that’s the problem with solved games: You compete on the familiarity with and memorization of established patterns.
Somewhat amusingly, in the game I played, it went all in pushing the flank pawns, also a tendency favored by top Chess engines :)
very very impressive
The human genome is about 6.4 billion base pairs, where each base pair is represented by the letters: Adenine (A), Thymine (T), Cytosine (C), and Guanine (G), i.e. 2-bits. 6,4 billion is then 6.4E9*2 = 1.28E10 bits = 1.28E10/8 bytes = 1600 MB. Or 800 MB if you count the bases as pairs of two.
Polychaos dubium's DNA is over 200 times as long as human DNA.
Thanks for doing the calculus however given that less than 1% of DNA actually has a coding role then it means that a human can be usefully encoded in 8MB.
But I hate the graphic, lost several games due to me confusing pieces.
I used to play some when I was as kid, and some more when the kids were small. Has no idea of my rating.
If I remove the games I lost due to me confusing pieces I am up 5-1 and 1 draw.
I think I have found out its weaknesses.
1. In situation with pending exchange of several piece the
4 ply algorithm can't check the exchange-chain to its end and therefore makes mistakes.
2. Don't care very much for its pawns, in 2 endgames I was up 2 pawns that I was enabled to promote.
3 As other has pointed out, weak at defending the king in the beginning. 2 wins to what I call "extended" fools mate.