News for hackers. Stuff that matters.
Re:Micro-Max, a 133-line Chess Source by tromp on Wednesday September 22, 2021 @05:26PM (#28622050)
An interesting long running (2009-2021) discussion between H.G. Muller, author of Micro-Nax, and Oscar Toledo Gutiérrez, author of competing minimal chess program (and IOCCC winner [1]) nanochess, may be found on the chess programming forum [2].

[1] https://en.wikipedia.org/wiki/International_Obfuscated_C_Cod...

[2] http://talkchess.com/forum3/viewtopic.php?f=7&t=26622

Re:Micro-Max, a 133-line Chess Source by femto113 on Wednesday September 22, 2021 @07:42PM (#28623467)
> Except for under-promotions ... since the program is unlikely to ever find itself in a situation where it would be useful to play one.

Not my proudest moment but I did cheese out a tie in an otherwise lost game in jr. high by moving into what would be a stalemate if opp naively queened his pawn. It was extra ugly because he moved, picked up his previously captured queen from the side of the board, put it down, but didn't take his hand off of the queen before realizing the mistake (literally any other piece would have given him a clear win). Had to get a ruling on whether he was committed, judge decided it was too late because he'd taken his hand off the pawn (I have no idea what the official rule is in this scenario). I still regret not just resigning, but 12 year old me could be a jerk sometimes.

Re:Micro-Max, a 133-line Chess Source by cmeacham98 on Wednesday September 22, 2021 @08:32PM (#28623870)
The judge is right for the wrong reason:

https://chess.stackexchange.com/questions/32495/is-there-a-t...

The promotion is committed as soon as the new piece touches the promotion square.

Re:Micro-Max, a 133-line Chess Source by Aditya_Garg on Thursday September 23, 2021 @12:38AM (#28625258)
Don’t feel too bad. Learning how to watch for stalemate tricks when you’re winning is a very important chess lesson. Look up Eric Rosen stalemate traps on YouTube. This is an IM who regularly tricks GMs into stalemate. The GMs are not mad at him, only themselves for falling for it.
Re:Micro-Max, a 133-line Chess Source by Bootvis on Thursday September 23, 2021 @05:20AM (#28626934)
Swindling is part of the game at all levels. Personally, I feel good about it even at 35 as long as I followed the rules.

I remember a kid changing the colour of his bishop by 'misplacing' it on a different colour square to get the same colour in a bishop-pawn endgame. That was not OK.

Re:Micro-Max, a 133-line Chess Source by TheOtherHobbes on Wednesday September 22, 2021 @06:45PM (#28623010)
A reminder that in 1982 you could buy "1K ZX Chess" for the Sinclair ZX81.

It ran in 672 bytes of Z80 machine code, including graphics.

(Unfortunately a few features had to be left out. But still.)

Re:Micro-Max, a 133-line Chess Source by classichasclass on Wednesday September 22, 2021 @11:29PM (#28624939)
Re:Micro-Max, a 133-line Chess Source by spicybright on Wednesday September 22, 2021 @05:27PM (#28622074)
I didn't think this was much, just some kind of chess rules engine, but this program also implements an AI opponent to play against.

That's insanely impressive!

Re:Micro-Max, a 133-line Chess Source by actually_a_dog on Wednesday September 22, 2021 @05:46PM (#28622316)
Not just “an” AI opponent, either, but a fairly sophisticated one.

https://www.chessprogramming.org/Alpha-Beta

https://www.chessprogramming.org/Quiescence_Search

Re:Micro-Max, a 133-line Chess Source by mocy on Wednesday September 22, 2021 @04:11PM (#28621144)
Surprisingly good chess engine (ELO ~2000). Good resource for my kids, the younger learning chess and the older interested in programing.
Re:Micro-Max, a 133-line Chess Source by actually_a_dog on Wednesday September 22, 2021 @05:47PM (#28622338)
If you find this interesting, the Chess Programming Wiki has a real treasure trove of info on computer chess.

https://www.chessprogramming.org/Main_Page

Re:Micro-Max, a 133-line Chess Source by mocy on Wednesday September 22, 2021 @04:14PM (#28621168)
on iOS, Chess Mini is build around Micro-Max: https://apps.apple.com/us/app/chess-mini/id616424231
Re:Micro-Max, a 133-line Chess Source by tasty_freeze on Wednesday September 22, 2021 @05:38PM (#28622207)
Despite the engine being 2000 chars and 133 lines, the GUI is expensive. From the program description:

    Size
    40.5 MB
Re:Micro-Max, a 133-line Chess Source by selcuka on Wednesday September 22, 2021 @08:37PM (#28623897)
There's also The Kilobyte's Gambit [1], which is a chess engine written in 1024 bytes of JavaScript.

[1] https://vole.wtf/kilobytes-gambit/

Re:Micro-Max, a 133-line Chess Source by thom on Thursday September 23, 2021 @06:11AM (#28627256)
Don't know if the author frequents these parts, but I really enjoyed the annotated Toledo chess source book, and would very happily pay for similar here!
Re:Micro-Max, a 133-line Chess Source by jfoucher on Wednesday September 22, 2021 @05:40PM (#28622224)
This is nice, I just compiled it, but how do I play it? I can't seem to find any instructions on the website...
Re:Micro-Max, a 133-line Chess Source by jkingsman on Wednesday September 22, 2021 @05:58PM (#28622493)
From https://home.hccnet.nl/h.g.muller/download.html:

> To play you must enter moves in algebraic notation, and to make the computer do a move you should press an extra enter. You can alternate sides whenever you want, the program accepts or plays moves for the side whose turn it is to move. After having done a move, be it yours or his own, micro-Max prints a board with the new position. To quit type control-c.

Re:Micro-Max, a 133-line Chess Source by racingmars on Thursday September 23, 2021 @02:52AM (#28625952)
The instructions say you must enter "algebraic notation," but I couldn't figure it out until I took a peek at the source code to see how it was trying to parse input.

You always just enter source square to destination square. So to play an opening move 1. d4, you would type `d2d4` (move piece on d2 to d4) and press enter. Then if you want micromax to play the next move for black, just press enter again. It'll think for quite a while and draw the board with the new position. To play 2. Bf4, you'd then type 'c1f4', and so on.

(This appears to be "long algebraic notation" and is apparently common in chess engines, now that I look it up on Wikipedia.)

Re:Micro-Max, a 133-line Chess Source by jfoucher on Thursday September 23, 2021 @08:34AM (#28628251)
Right, that's the answer. I tried using regular algebraic notation without success, but this works fine. Thank you.
Re:Micro-Max, a 133-line Chess Source by xwdv on Thursday September 23, 2021 @05:07AM (#28626838)
Why bother implementing rules at all? Just create an interface to move pieces around on a board wherever you want. If you play chess you should know the rules and how to move pieces.
Re:Micro-Max, a 133-line Chess Source by greyman on Thursday September 23, 2021 @07:23AM (#28627708)
I kind of agree, chess without promotions, castling and en passant is not chess. But the guy also made full version, with impressively small size:

For real purists: a close-to-minimal version that does understand full FIDE rules including under-promotion can be found here. It measures 1433 characters.

(although I don't know why people who adhere to chess rules are called "purists", but whatever. :-))

Re:Micro-Max, a 133-line Chess Source by xwdv on Thursday September 23, 2021 @07:40AM (#28627818)
In Ultima Online we would play chess to pass time on long sea voyages while hunting for monsters or treasure.

There was no rules engine, it was just a simple board where you could drag and drop pieces around on any which way, which allowed for a lot of flexibility in how you played. We could even play random chess this way.