pouët.net

BootChess by Red Sector Inc. [web]
[nfo]
screenshot added by Baudsurfer on 2015-01-27 01:42:29
platform :
type :
release date : january 2015
  • 51
  • 23
  • 20
popularity : 86%
 86%
  • 0.33
alltime top: #2100
added on the 2015-01-27 01:42:29 by Baudsurfer Baudsurfer

popularity helper

increase the popularity of this prod by spreading this URL:

or via: facebook twitter pinterest tumblr bluesky threads

comments

BootChess is the smallest computer implementation of chess on any platform (487 bytes) for Windows / Linux / OS X / DOS / BSD / DOSBox / Bochs
Smaller than previous 33-year old record 1024 bytes 1K ZX Chess.
Cam video link : https://www.youtube.com/watch?v=mlLgOLmQg_g
I just started a quick game :D After 1.e4 e6 2.Ne2 d5 3.exd exd 4.Nc3 c6 5.Nxd5? cxd5 6.h3 i am already sure i'll win this, but hey, i am a club level chess player ;) Will dive deep into the code later, for now i'll just say : WOW! Great release!
rulez added on the 2015-01-27 02:28:20 by HellMood HellMood
Nice
rulez added on the 2015-01-27 05:20:47 by Ramon B5 Ramon B5
nice opening for the next 30 years!
rulez added on the 2015-01-27 05:25:53 by gentleman gentleman
Okay, maybe I'm dense but is there any way to assemble this to run from the console on OSX/Linux? I don't have anything with a floppy drive to write it to at the moment.
added on the 2015-01-27 07:09:24 by jmph jmph
WAT? With all those ports, and No Amiga port? Disappointment ;)
rulez added on the 2015-01-27 07:49:57 by tFt tFt
Automatic thumb for new world record! :) And 50% smaller than previous attempt!
rulez added on the 2015-01-27 08:00:12 by ramon ramon
Nice!
rulez added on the 2015-01-27 08:17:21 by SnC SnC
Wow!
rulez added on the 2015-01-27 10:20:43 by neoman neoman
nicely done :)
rulez added on the 2015-01-27 11:24:55 by visy visy
wow
BootChess.txt was interesting reading.

Congratulations for the record.
rulez added on the 2015-01-27 12:06:09 by wullon wullon
Awesome!

Also, thank for the use of WTFPL, sam will be pleased :)
rulez added on the 2015-01-27 12:12:30 by rez rez
needs better gfx and fighting animations like battlechess! ;)
rulez added on the 2015-01-27 12:52:56 by wysiwtf wysiwtf
Actually there ARE other 512b games, check this as an example: http://trd.speccy.cz/demos/ncp12.htm.
Otherwise cool. Can't figure out how to enter moves, any advice plz?
rulez added on the 2015-01-27 15:44:24 by lvd lvd
great stuff!
rulez added on the 2015-01-27 16:08:53 by sensenstahl sensenstahl
WTF!?!
rulez added on the 2015-01-27 18:41:37 by w00t! w00t!
Great!
Tried that myself once but gave up too early because i thought it would not have been possible
rulez added on the 2015-01-27 19:13:20 by whizart whizart
Cool
rulez added on the 2015-01-27 19:17:42 by bitl bitl
Very cool, and a really impressive feat. =)
rulez added on the 2015-01-27 19:18:53 by imerso imerso
Nice!
rulez added on the 2015-01-27 19:59:53 by hfr hfr
.
rulez added on the 2015-01-27 20:01:59 by SiR SiR
Great, I'm alway ready for a good game of chess. So here we go...

White: Boot Chess
Black: Ham/SFL

1. e2e4 e7e5
2. Ng1e2 (with this movement, BootChess enters the Alapin's Opening)

Notice that, in the source code, there is a comentary about "hardcoded Spanish Opening"... well, just the first move of the Spanish (1 e4) is really hardcoded so it is misleading to say that BootChess knows that opening (As every good chess player knows, lots of opening starts with 1 e4, not just the Spanish, the Spanish Opening is 1 e4 e5 2 Nf3 Nf6 3 Bb5)

2. ... Ng8f6
3. Nb1c3 d7d5
4. e4xd5 Nf6xd5
5. Nc3xd5 Bf8c5

Till now BootChess played very well but suddenly...

6. Nd5xc7? Qd8xc7

Nxc7 is a bad mistake. BootChess exchange a knight for a pawn.

7. h2h3 Nb8c6
8. Rh1h2 e5e4
9. g2g3 f7f5
10. Bf1g2 Rh8f8

I would like to castle instead of place a rook on f8 but the program does not allow me to do it. So I play Rh8f8.

11. Bg2xe4? f5xe4

Another bad exchange. A bishop for a pawn. This program likes all captures!

12. f2f3 e4xf3
13. Ke1f2 f3xe2+
14. Kf2xe2 (screenshot 1)

BB Image

It seems that white are lost and soon a checkmate will come. I decided to take the g3 pawn to prepare a decisive attack with queen and rook combined.

14. ... Qc7xg3

But then...

15. Ke2f3?? <-illegal move! (screenshot 2)

BB Image

BootChess does not care if his King is placed on a square controlled by the enemy pieces. Very bad and very illegal. This is forbidden by chess rules!

15. ... QxK++
16. Program exit to MSDOS

Well... It is clear to me that you put more interest in making a small chess program that in making a good chess program. That's understandable even if the result is a program very easy to beat but... you cannot say that BootChess is a complete chess program because it does not allow to castle (didn't tried promotions, underpromotions, en passant pawn captures, stalemate... but I bet that are not supported, are they?) and, worst, it does not care about avoid to place a King in check. Every chess player knows that it is illegal (the movement CANNOT be made) to place your king on a square controlled by your rival pieces. If you allow it, then this is not chess.

I myself coded a few chess engines so I know how hard it is to do it and squeeze it in a small program. So I will not thumb down this nice effort. But you should stop that bragging about breaking records until you make a complete chess program.
added on the 2015-01-27 20:53:17 by ham ham
oh ham you are being too harsh.. I'm sure Baudsurfer will fix that, there are plenty of bytes for it!
rulez added on the 2015-01-27 21:06:58 by pera pera
No way!
rulez added on the 2015-01-27 21:22:38 by TomoAlien TomoAlien
Observations by ham are correct. This behaviour is desribed in the readme though ;) The program is expoitable really fast by some kind of reversed scholars mate :/

1. e2e4 e7e5
2. Ng1e2 Bf8c5
3. Nb1c3 Qd8h4
4. h2h3 Qh4xf2 (mate)
5. Ke1xf2 Bc5xf2 (exits)

I'd advise to change the opening move to e2e3 (passive) or (solid) both prevent the basic scholars mate idea).

Basically i'm d'accord with everything ham said. Just i think that this is awesome anyway ;)

Some links for interested people :
http://talkchess.com/forum/index.php
http://tcec.chessdom.com/live.php
http://stockfishchess.org/
http://www.computerchess.org.uk/ccrl/4040/
https://groups.google.com/forum/#!forum/fishcooking
https://chessprogramming.wikispaces.com/
added on the 2015-01-27 21:22:44 by HellMood HellMood
Quote:
I'd advise to change the opening move to e2e3 (passive) or (solid) both prevent the basic scholars mate idea).


... or d2d4 (solid) ^^
added on the 2015-01-27 21:24:17 by HellMood HellMood
Thanks for all the nice comments !

@ham : I do not claim to be an expert like you at programming chess engines, but I believe your vision is one of a rigorist for after all the Wikipedia entry for 1K ZX Chess still recognized as "the greatest program ever written" by some, clearly states "The game implements most chess rules (castling, queening, and en passant capture are missing)" thereby breaking at least 3 FIDE legal rules (don't know about moving king in mate position). It is still referred to still by Wikipedia as "the smallest implementation of chess on any computer".

Please read file bootchess.txt in release archive about choices and dilemas :
Quote:

from paragraph 5.1 - The TaxiMax ai used :
In the case of BootChess there is alas not enough space (512 bytes binary program size and 640 bytes RAM execution environment) for such level of sophistication. It uses a variant : while maximizing captures it tries to minimize the taxi/Manhattan distance to the opponent's black king rank. This weaker ai element combination will be named "TaxiMax" for the occasion and can be viewed as a half-ply plus. Note this half-ply thus cannot prevent the king to move in check position.


And to be honest, for the non-experts players, if you move really wish to move your king in check position, it will be captured by the computer opponent just behind thereby ending the game.

Would you really have the smallest strict FIDE legal chess program ever :

Quote:

from paragraph 2.2 - False claims abound :
"int main(void){puts("I resign");}


So all in all, it is just the smallest chess implementation program since 1982 if not totally implementing every single FIDE rule, like 1K ZX Chess (adding extra queening promotion) and I think you shouldn't have held yourself back to thumb it up.
I just read the previous record on wikipedia, 1k ZX chess (which is to be compared), implements (only) most chess rules.
rulez added on the 2015-01-27 21:32:21 by Buckethead Buckethead
just to nitpick a bit, the 1k ZX Chess is actually 672 bytes big, not 1024 bytes
added on the 2015-01-27 22:01:50 by britelite britelite
Don't take me wrong. I know what you have achieved and I like it. A very compact program capable of generate pseudolegal moves. Another step forward and your program could avoid placing the King in check and also play a bit better.

It is very difficult, considering your less-than-1K constraint, to make a decent AI but you should, by all means, try to implement some awareness of the control over the board of the enemy pieces (and also yours, in the turn of the opponent). Try, for instance, to fill an array representing "board pressure" or "force field" (before calculate the next possible moves) with numbers of attacks of enemy pieces in the board (you can clear the array to zeroes and use the pseudolegal moves generator to add +1 to every square that could be a destination for some enemy piece). Then take care when checking the legality of a king movement that the destination square are not controlled by enemy forces.

You could avoid mistakes like the bad exchanges implementing some sort of static exchange evaluator (static because does not rely on techniques like negamax that you do not have space to implementent). You can base that exchange evaluation in the data present in that array of "pressure". Never take a piece less valuable than yours if the destination square is under attack.

This are imperfect solutions and the program still will play bad cheap chess. But al least will endurance a bit more and maybe win some games against beginners. Even the idea of use the taxi distance can work somehow if your AI is aware of the minefield of squares taken by the rival and avoid to place his pieces on bad squares. But it does not work very well in the current form of your program.

Just don't be lazy. There is a way to test that old "1K ZX Chess"? I would like to see how well play.

Your goal should be making a program able to beat that old relic with less bytes!

By the way, add a little bit of randomness in the game. Pure deterministic opponents can kill fun in chess.
added on the 2015-01-27 22:06:49 by ham ham
Another interesting resource regarding small chess program is nanochess by Oscar Toledo who wrote several chess programs whose C source fits in ~900 bytes and the uber famous JS Chess 1k.
rulez added on the 2015-01-27 22:17:14 by p01 p01
I'd give the Monte Carlo approach a try.

https://chessprogramming.wikispaces.com/Monte-Carlo+Tree+Search

Basically, just play repeatedly random games until the end from the current position, and chose the move which scores best on average. No sophisticated evaluation needed here, not even memory (besides the one currently simulated variant). Just a score per each possible move, which is updated after each run. After some (thousands?) of these runs, chose the most promising move ;)
added on the 2015-01-27 22:23:33 by HellMood HellMood
@britelite

Quote:
ust to nitpick a bit, the 1k ZX Chess is actually 672 bytes big, not 1024 bytes
added on the 2015-01-27 22:01:50 by britelite


Not really britelite for the article written by David Horne, the author of 1k ZX Chess states clearly "in just 1000 bytes of memory" (top right of article scan).

Whether 1k ZX Chess is 1000 bytes of memory as he states vs. 672 bytes of memory as Wikipedia states, BootChess is still smaller for has a max padded to 512 bytes binary fingerprint (487 bytes on 16-bit DOS which already qualifies as "on any platform-ish") and uses max 512+2+128=642 bytes of memory (min 617 bytes).

What the Wikipedia author probably meant is that "once the data is loaded from the 1K ZX Chess tape" it has 672 bytes of memory (or 1000 bytes if you believe its author), but that preloaded data still of course counts in the overall final binary footprint which is the only real measure in sizecoding.

So...Do I get your thumb now britelite :) ?
@HellMood: Implementing a Monte Carlo approach would require the ability to make and unmake moves. It will be necessary to do it many "plies" and evaluate depth nodes/leafs in the game tree. I assume that BootChess cannot make/unmake moves because it does not use minmax/negamax style of search (I didn't examine the whole source code, just read the bootchess.txt).

With randomness I mean something very simple, like add a small random factor, about half a pawn value after evaluate every position so the program could choose a different line when there are many equally good possibilities.

@Baudsurfer: Improve it a little bit and you will get more thumbs. ;]
added on the 2015-01-27 22:43:40 by ham ham
Quote:
BootChess is still smaller

I never claimed otherwise

Quote:
So...Do I get your thumb now britelite :) ?

No
added on the 2015-01-27 22:44:16 by britelite britelite
Not proper chess, but great work nevertheless.
added on the 2015-01-27 22:47:17 by Preacher Preacher
@ham, yes, you would need to push and pop a lot ;) i think that's still better than any evaluation based approach. Better, in the meaning of : more suited for a sizetro. Evaluation means formulas, or tables, or both, in the code (!) A sizetro has no space for that. But it can use 640K of memory. While normally, nobody in the current chess coding scene will route for the MC approach right now, it might make perfect sense for a sizetro.

I guess, we will never know unless somebody actually tries ;)
added on the 2015-01-27 22:53:46 by HellMood HellMood
Impressive as always Baudsurfer, this time probably even more. Thumbs up!
rulez added on the 2015-01-28 00:01:23 by Cleaner Cleaner
On the one hand, it's super small and thus very impressive. And with the goal of "super small" in mind, I think it doesn't need to focus on playing strong. Of course one could improve it at the cost of size, but then when do you stop?

But I agree with others that considering the bragging, it should at least implement the rules correctly, or otherwise it's not Chess.
added on the 2015-01-28 08:32:32 by Kylearan Kylearan
It seems this prod has been slashdotted. This fate used to (temporarily) bring down sites back in the day. I wonder how Pouet will fare...

Also, obligatory thumb.
rulez added on the 2015-01-28 10:24:14 by Trilkk Trilkk
Hey, you made it on slashdot, thumbs up!
rulez added on the 2015-01-28 10:25:51 by decca decca
a chess game which can not play chess.
sucks added on the 2015-01-28 10:51:39 by Oswald Oswald
Since the binary file size seems to be what folks are going for here, why not just write the thing in 6502 assembly for the VIC-20 and C-64? You also might be able to save a few bytes by writing some self-modifying code and store a few variables in the boot code, which wouldn't be used once things fired up :D.
If wouldn't be as impressive as being able to run on almost any x86 box, but you'd still have the record (as it plays "chess").
added on the 2015-01-28 12:21:24 by ab5ni ab5ni
Tiny coding! <3
rulez added on the 2015-01-28 15:21:11 by baah baah
Quote:
Not really britelite for the article written by David Horne, the author of 1k ZX Chess states clearly "in just 1000 bytes of memory" (top right of article scan).


It was written for ZX81 which only HAS 1024 bytes of memory.
Therefore the code AND data storage together have to fit in 1K.
added on the 2015-01-28 16:11:22 by Scali Scali
Cool :)
Beat the game pretty easily due to his king taking a rook that was protected by my queen. Technically an illegal move, but I suppose this game features suicidal kings
rulez added on the 2015-01-28 17:41:27 by Tjoppen Tjoppen
The BBC article has a link back to this thread :-)
rulez added on the 2015-01-28 23:14:44 by CiH CiH
Quote:
"[It] demonstrates why assembly language is still the language of choice to excel [at] in programming," he said.


hahahaha
added on the 2015-01-28 23:52:03 by superplek superplek
I'm not sure which is more impressive, the code in this or getting the bbc to link to pouet :D
rulez added on the 2015-01-29 01:57:25 by psonice psonice
cute size code endeavour but the whole world record press announcement thing feels a bit ridiculous.
added on the 2015-01-29 04:08:57 by psenough psenough
Thumb up for the world press announcement
rulez added on the 2015-01-29 04:27:28 by Serpent Serpent
Fantastic achievement. Wish it would run on 8086 (uses pusha/popa), but that is a minor quibble. Major thumbs up.
rulez added on the 2015-01-29 06:07:06 by trixter trixter
for a few bytes more, we could fix the 8086 issue.
I'm happy to say that the proper size is actually 485 bytes, because I have a -2 bytes optimisation, but sad to say that it was not included for some reason.
rulez added on the 2015-01-29 07:12:54 by qkumba qkumba
Great tribute to the ZX era, amazing challenge.
Bravo Baud!
rulez added on the 2015-01-29 08:15:40 by fra fra
Cool stuff!!!!
rulez added on the 2015-01-29 08:30:28 by okkie okkie
What ps said. Cool but enough sizecoding already, we want Rush Hour 3.
added on the 2015-01-29 08:36:07 by break break
excellent world press announcement! it's now in the papers that you're in RSI so it must be true!
rulez added on the 2015-01-29 10:20:02 by skrebbel skrebbel
What Serpent said.
rulez added on the 2015-01-29 13:16:04 by PotcFdk PotcFdk
Note that the "1k RAM" of the ZX81 also contains video memory, system variables and stack and BASIC boot loader. That is, 1024 bytes is the grand total of actual code, internal data, stack, DFILE and system stuff. This means that the "1k-Chess" is way below 1024 bytes.

This noteworthy "512 byte implementation" (actually 510 because its final 55/AA signature) uses external system variables, external data (note the "brd" equ), external stack, external video memory, and even 80186 instructions and EGA bios.
Congrats on making the headlines, but as others have commented, this does not implement the rules of the game correctly.

Castling is permissible if and only if all of the following conditions hold (Schiller 2001:19):
The king and the chosen rook are on the player's first rank.[3]
Neither the king nor the chosen rook have previously moved.
There are no pieces between the king and the chosen rook.
The king is not currently in check.
The king does not pass through a square that is attacked by an enemy piece.[4]
The king does not end up in check. (True of any legal move.)
http://en.wikipedia.org/wiki/Castling

A pawn on its fifth rank may capture an enemy pawn on an adjacent file that has moved two squares in a single move, as if the pawn had moved only one square. The conditions are:
the capturing pawn must be on its fifth rank;
the captured pawn must be on an adjacent file and must have just moved two squares in a single move (i.e. a double-step move);
the capture can only be made on the move immediately after the opposing pawn makes the double-step move; otherwise the right to capture it en passant is lost.
http://en.wikipedia.org/wiki/En_passant
added on the 2015-01-29 14:13:12 by dila dila
Ok, so the Z80 has way less instruction flexibility as the 80x86. There are very limited pointer indexing abilities and less registers. Also no direct memory writes are possible, eg.
Code:mov byte ptr [bx],0x34
. I gotta wonder how big your game would be if you wrote it in Z80 assembler. THAT would be the true test. This is hardly a massive victory until you've done that.

I'm not saying this ain't cool, but it's hardly comparative.
new pouet record for comments/popularity ratio :D
hahaha, "'BootChess'-Screenshot von Red Star Inc." @ spiegel.de
added on the 2015-01-29 16:45:09 by dipswitch dipswitch
stomachcontents: In an other hand it also mean that there's no world record if it's not coded on a ZX81 with 1Ko of RAM because it's not comparable... Well I think this is the new benchmark. "Beat dis!" :))

Amazing hype :P
Just goes to show how you can easily generate press by hitting the right media buttons. Every news site needs a dozen stories per day and things come and go very quickly. If you wanted to generate even more attention you could try making a Super Mario Bros. clone in 1k or a Call of Duty clone in 4k. Or maybe someone should link them to the best 256 byte tetris we have so far, but then again, that's maybe too mundane, as nobody can claim to have bested some dubious 30+ year record. :)

Don't get me wrong: This program is pretty cool and there's a lot of work put into it, but all the shortcomings, bugs, begging people for thumbs and the apples to oranges comparisons regarding size and features make this an unlikely prod for me to like and endorse. It's also visually not the best solution. By adding spaces, it would look much more comprehensible and less crammed, etc.
added on the 2015-01-29 17:04:02 by tomaes tomaes
sensenstahl: I think this one takes the cake in historical context at least :)

About the prod itself, I'm too conflicted to make up my mind... grats anyway.
added on the 2015-01-29 17:05:30 by noby noby
Nein, wirklich nicht.
sucks added on the 2015-01-29 17:05:55 by lsl lsl
I vote LSL. This is subpar x86 asm implementing chess in a broken and highly unattractive way.
sucks added on the 2015-01-29 19:07:33 by superplek superplek
Awesomeness!
rulez added on the 2015-01-30 15:23:03 by Psycho Psycho
Chess is boring, but thumb for hype.
rulez added on the 2015-01-30 17:49:34 by Emod Emod
Yes! Nice work! BB Image for you and BB Image for scene politicans and fault-finders. Jealousy goes with glory.
rulez added on the 2015-01-30 19:20:51 by et et
Check mate! We have a NEW WORLD RECORD at 481 bytes.

And voilà. Oscar Toledo, author of many tiny chess programs, including the JS1k chess, made one similar to BootChess, in 481 bytes that he called AtomChess.

Your turn ;)
added on the 2015-01-30 21:42:02 by p01 p01
@p01, in Toledos version you can directly capture their king on first move -> 1.d1e8 and over ^^ You might notice that Toledos version does play on still though :D He also just omitted board coordinates (that alone should save at least 5 bytes). If not for these flaws, it seems to play slightly stronger. But not checking moves for legality and playing on? I don't like where this is going ...
added on the 2015-01-30 22:09:28 by HellMood HellMood
"playing on" ... without king i mean ;)
added on the 2015-01-30 22:10:10 by HellMood HellMood
yeah.. thumbing down faulty chess programs sucks. seems legit.
added on the 2015-01-30 22:12:45 by lsl lsl
Quote:
made one similar to BootChess


p01: I looked at what Oscar did and it is interesting,
I will include his effort with Peter Ferrie's who has also brought some optimizing as I see 90% of the code is refactored our code. I know it was published under the WTFPL v2 license but this is just blatant code-ripping because nowhere is mentionned the original source used as skeleton.

I could maybe remove a byte from http://www.pouet.net/prod.php?which=8697, but I surely wouldn't say I created it and put my name on it.

Code:tab db p-tab,r-tab,n-tab,b-tab ; piece type mov offset array db q-tab,q-tab ; note original 1K ZX Chess q=k trick br0 db "rnbqkbnr",8,16,32,64,128 ; end rank pattern + beg piece values db 32,16,8,'p',4,'.',0,'.',0 ; end piece values + beg mid board reps db '.',0,'.',0,'P',4 ; ... end mid board reps p db 2,3,-10h,-15,-17,10h,15 ; bit#2 pf=04 p[6]=r[0] overlay r db 17,4,10h,-1h,-10h ; bit#3 ??=08 r[5]=n[0] overlay n db 1,8,1fh,21h,12h,-0eh,-1fh ; bit#4 af=16 n[9]=b[0] overlay db -21h,-12h ; ... end of knight moves list b db 0eh,4,-0fh,11h,-11h ; bit#5 ??=32 b[5]=q[0] overlay q db 0fh,8,10h,11h,0fh,1h,-10h ; bit#6 zf=64 k=q except k[0]=1 db -11h,-0fh,-1h ; ... end of queen/king moves list bf1 db "abcdefgh" ; gui file index string


Code:initial: db 2,5,3,4,6,3,5,2 scores: db 0,10,50,30,90,30 chars: db ".prbqnk",&0d,".PRBQNK" offsets: db 14,18,8,12,8,0,8 total: db 4, 4,4, 4,8,8,8 displacement: db -33,-31,-18,-14,14,18,31,33 db -16,16,-1,1 db 15,17,-15,-17 db -16,-32 db 15,17,16,32



Also he states "Your movements aren't checked for legality", where BootChess verifies movement legality.

You can remove an extra 10 bytes from Bootchess in textmode to oif you do not use a graphical mode and stick to textmode.

It seems easy to remove some 40 bytes too from bootchess if not displaying row and ranks coordinates like he does :

BB Image

And finaly if I type H7h5 it just doesn't work it seems :

BB Image

BootChess and 1K ZX Chess program flow are not copied one from another. BootChess was created from scratch. Here it was not, it's just removing barely the static data of ranks and files string, removing the graphic mode and not checking if moves are legal, from BootChess. I'm pretty sorry to see that from the author M. TOledo because I had great respect from him before he "hevaily borrowed" our code and most important the tiny game design that took us months to lay correctly.

So is there a need to republish a version that doesn't check legal chess moves ? I'm not certain, but we can release one to maybe bring BootChess down to way down under 400.
I want to state clearly that I don't borrowed code from your chess program.

I would be ashamed of doing that. Anyone can verify it and compare sources side by side. You should be more careful before assuring that.

This is my original implementation based on Toledo Nanochess core plus my Picochess simplifications changed to a 0x88 implementation in order to use page-size optimizations.

The core searchs at 3-ply depth exploration and doesn't make illegal movements.
added on the 2015-01-31 01:25:24 by nanochess nanochess
i'm more a checkers person, me
Baudsurfer: It seems that AtomChess do not check for legal moves at input so you can type H7H5 (moving a black piece instead of one of your white pieces) and the program then move another black piece (g7 pawn in your example). Notice that even if this lack of legallity test (of the rival moves) is a bad thing it is still better that a program that does not care of place his king in check (something that is illegal in chess!). So AtomChess can play an entirely legal game of chess (limited because it does not have castling, en passant captures, promotions, etc... but still legal inside this set of limitations) but your program cannot because it will play illegal moves the moment it allows his king to move into a square that is controlled by an enemy piece.

The code snipets that you show us are not relevant. They are data related to the initial placement of pieces, relative values and offsets for the move generator algorithm. Not sure of that you pretend to prove with that.

nanochess: Kudos to you! Your program plays very much interesting chess than BootChess (it has even randomness to spice the game!). It is convenient that your program plays black and Bootchess white. We can confront them. ;]
added on the 2015-01-31 02:11:26 by ham ham
Now do Go.
@ham

... i just DID ^^

Game Notation
1. e4 g6 2. Ne2 g5 3. Nbc3 c6 4. h3 c5 5. Rh2 Bg7 6. g3 h5 7. Bg2 h4 8.
gxh4 gxh4 9. Bf3 c4 10. Ng3 hxg3 11. fxg3 Be5 12. Kf2 Bd4+

BB Image

Download as PGN

"Bootchess" wants to move Qe2 here (illegal). I would count that as win for black. "Nanochess" in response does a "nullmove" :D In the final position, Nanochess has a knight for a pawn, so it's clearly better. I don't know if i have the patience to play a whole tourney ^^
added on the 2015-01-31 02:55:49 by HellMood HellMood
Quote:

Check mate! We have a NEW WORLD RECORD at 481 bytes.
And voilà. Oscar Toledo, author of many tiny chess programs, including the JS1k chess, made one "similar" to BootChess, in 481 bytes that he called AtomChess. Your turn ;)
added on the 2015-01-30 21:42:02 by p01


@p01 : you have to understand the code here is only the final outcome of much work done beforehand. For BootChess to be the first chess game ever in history to fit and launch in a bootsector no algorithm or code flow was copied, refurbished, refactored or inspiring : it was done from scratch. It is not a classic intro effect one just betters by copying what a previous person did before and call it yours because you saved a byte. WTFPL license is meant to free people from legal hassles (read Fred Fish PD) but maybe not ethically omit to inform your viewers about the origin of your "similar" code.

Nevertheless if I one insists on removing rank and file indexes BootChess becomes only 468 bytes (pic). The download archive and the .nfo were both updated with binaries and sourcode to reflect this added "feature" enabling 468 bytes.

BootChess... The original chess game in a bootsector
Baudsurfer: You have to understand 2 things:
1. I don't really care about this "world record".
2. Oscar Toledo has been writing tiny chess programs for yeaaaars and knows what he's doing. Surely he doesn't need you, and we don't need your nasty insinuations.

Discussion over.
added on the 2015-01-31 09:12:35 by p01 p01
Why does it not support castling or en passant capture?

These are not "features" of a chess program, like a pretty UI, or the ability to undo moves.

"The en passant capture rule was added in the 15th century when the rule that gave pawns an initial double-step move was introduced."
added on the 2015-01-31 10:09:59 by dila dila
Thumb down for ego and horrible unfounded accusations that others are ripping your code.

This thread is featured on many high profile sites, and these petty arguments are doing nothing to help show the demoscene in a good light.

Also, if (as you told the BBC) "[you] hoped this achievement would now inspire other programmers to get involved in the sizecoding scene" then why are you now discrediting others that are doing exactly that?
sucks added on the 2015-01-31 13:34:06 by Mtl Mtl
pseudo chess.
sucks added on the 2015-01-31 14:13:08 by Igoronimo Igoronimo
Quote:

Thumb down for ego and horrible unfounded accusations that others are ripping your code.

This thread is featured on many high profile sites, and these petty arguments are doing nothing to help show the demoscene in a good light.

Also, if (as you told the BBC) "[you] hoped this achievement would now inspire other programmers to get involved in the sizecoding scene" then why are you now discrediting others that are doing exactly that?
sucks added on the 2015-01-31 14:55:13 by v3nom v3nom
Quote:
Quote:
Thumb down for ego and horrible unfounded accusations that others are ripping your code.

This thread is featured on many high profile sites, and these petty arguments are doing nothing to help show the demoscene in a good light.

Also, if (as you told the BBC) "[you] hoped this achievement would now inspire other programmers to get involved in the sizecoding scene" then why are you now discrediting others that are doing exactly that?
sucks added on the 2015-01-31 15:03:55 by Defiance Defiance
sizecoding != demoscene.
sucks added on the 2015-01-31 15:20:20 by rmeht rmeht
also the new contents and writings of this site are at least disgusting, i feel sorry that a legendary group's name is being exploited like this and has fallen prey to a person with such a childish behavior...
added on the 2015-01-31 15:21:52 by Defiance Defiance
Quote:
nanochess: Kudos to you! Your program plays very much interesting chess than BootChess (it has even randomness to spice the game!). It is convenient that your program plays black and Bootchess white. We can confront them. ;]


@ham: Thanks. It would be interesting to see it. Edit: just I've seen the match ran by HellMood. :)

Quote:
"Bootchess" wants to move Qe2 here (illegal). I would count that as win for black. "Nanochess" in response does a "nullmove" :D In the final position, Nanochess has a knight for a pawn, so it's clearly better. I don't know if i have the patience to play a whole tourney ^^


@HellMood: wow! that's cool :)

Quote:
Nevertheless if I one insists on removing rank and file indexes BootChess becomes only 468 bytes (pic). The download archive and the .nfo were both updated with binaries and sourcode to reflect this added "feature" enabling 468 bytes.


@baudsurfer: With the extra space you can now solve the bug in Bootchess where it puts its own king in check, otherwise is pointless.

It will be interesting to see if you're able to fit it in less than 481 bytes.
added on the 2015-01-31 16:00:16 by nanochess nanochess
Quote:
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.


Using that license and then complaining that people do what it allows... well...

You could have used a license that requires people to give credit if you wanted so. There are several of those...
Just to make that clear : in the above game, i let the 486 byte "Bootchess" play with white against the 481 byte "Atomchess" with black (not Nanochess) ;)
added on the 2015-01-31 16:56:15 by HellMood HellMood
Since I suck at chess I'm in no position to nitpick on anything.
rulez added on the 2015-01-31 17:58:16 by Rouquemoute Rouquemoute
Thumb for the effort, and all that resulted from it.

As a long-time chessplayer; can we not ditch the gui, and that you guys start competing for the worlds smallest chess _engine_ ? And use normal chess annotations for input/output?

Perhaps this frees up the needed bytes to implement both a correct and stronger chess opponent.
rulez added on the 2015-01-31 22:00:41 by spkr spkr
@wietze, i totally agree. As the war for the smallest formally correct chess entity is now over, they (we) should focus on a complete implementation. I wouldn't even mind to play blind ;)
added on the 2015-01-31 22:08:29 by HellMood HellMood
Nice. :)
added on the 2015-01-31 22:34:12 by AntDude AntDude
I'd rather see legal, complete, and competent chess in 1k than broken chess in 512b. "Exceptions" like castling and en passant are what make it interesting to implement -- skipping out on them is no fun!

I think sizecoding is a subset of demoscene, but so is aesthetics, and this prod feels very unaesthetic to me.

Respect the effort, but ultimately leaves me wanting more!
added on the 2015-02-02 09:37:01 by Herschel Herschel
strange thread....much hate
Found a very nifty online version for a virtual PC V86, courtesy of Mr. Fabian Hemmer :

here or there

BB Image
When does a chess computer cease to be a chess computer?

How many rules can you strip out?
added on the 2015-02-13 03:05:20 by dila dila
Some improvements based on this entry, done by some chess programmer: http://www.nanochess.org/chess6.html
added on the 2015-03-03 15:23:48 by lvd lvd
Good small chess program! It's fun to play!
rulez added on the 2015-03-23 07:18:41 by PROSM PROSM
The new working url to test Bootchess in any javascript compatible browser is here
(hosting and javascript x86 virtual machine courtesy of Fabian Hemmer)
thumbdown for unfounded accusations of code stealing
Should I thumb this down for releasing an unfinished product (because of allowing illegal moves)?
added on the 2015-06-28 16:56:36 by Triace Triace
This is really cool
rulez added on the 2015-08-27 22:15:21 by Rat Rat
smallest chess program : now 455 bytes ^^ Bootchess http://bit.ly/1FVtho0
@baudsurfer so now your program only runs from a COM file.

Toledo Atomchess is now 446 bytes ;) and still boots from a floppy disk. http://nanochess.org/chess6.html

All four versions included in the ZIP file if anyone wants to see the process of optimization.
added on the 2015-10-10 17:36:45 by nanochess nanochess
Broken/incomplete "chess" and accusing others of stealing your code without any proof and the whole ego trip here deserves more than one thumb down.
sucks added on the 2015-10-10 20:27:04 by StingRay StingRay
yes, it's no longer bootchess, and not even the smallest chess. That "breaking the record" claim can be removed now.
added on the 2015-10-12 19:09:18 by qkumba qkumba
@Stingray : check out toledo's wayback history from archive.org and you will have the proof that before Bootchess was released, there was no trace whatsoever of either 1) assembly or 2) chess programming in assembly or 3) even original idea of fitting a chess game in less than a Master boot Record (512 bytes) so to boot to it on a PC.
So at least the original idea was copied without crediting.
Now I don't know if you know how to program in assembly on PC @Stingray but if you look close at the code, you will notice similarities in Toledo's code that were original published in Bootchess : the xlatb displacement part in whole and other parts. The queen is king from David Horn was also copied without crediting the latter also. And the whole code is pretty much like that. So unless you're clueless in assembly or too biased to do a wayback search on the interweb the facts are there (and for a long time).
@Stingray : also I dislike you very much as I hate weasels.

@Qkumba, Toledo took 10 months to better Bootchess from January to today (October), I bettered his by a byte in size in 4 hours a few days ago : leave me some time ; although the novelty has faded away now, I will make it smaller and bootable within a short time (as always).

Quote:
Illegal moves are allowed ! Atomchess' author claims in toledo_atomchess-v4.asm that the "Computer plays legal basic chess movements ;)" but there is no check for the player to move the computer's/opponent pieces (see screen capture http://imgur.com/aueeAmL for proof)
2) Attempt to shamelessly copyrighting ("© Copyright 2015 Óscar Toledo Gutiérrez" :) other people's code and ideas including ZX legend David Horne


@qKkumba : I don't answer to your pompous emails anymore because the trouble with a mediocre virus writer like yourself (https://falsevxers.wordpress.com/2013/07/15/the-double-life-of-peter-ferrie-roy-g-biv-qkumba/) is thinking they are a 9.5/10 in asm while being a 7 and envious of others.
Stay classy.

BB Image

You clearly have got the skills to pay the bills, and should better put money where mouth is.
added on the 2015-10-13 11:42:52 by p01 p01
no
sucks added on the 2015-10-13 12:03:09 by wbcbz7 wbcbz7
yeah...
sucks added on the 2015-10-13 12:05:54 by britelite britelite
Hahaha :D I think I'll just thumb this down because of obvious reasons.
sucks added on the 2015-10-13 12:44:54 by Preacher Preacher
Quote:
chess programming in assembly

So now you even claim to be the first person to have programmed chess in Assembly?
Quote:
you will notice similarities in Toledo's code that were original published in Bootchess : the xlatb displacement part in whole and other parts

The only similarity is that they both use a LUT of offsets for valid moves - but that's because that's the trivial way of doing it, and the way it's approached is different: Bootchess never had an xlatb displacement (looking at BootChess_v01_487b.asm vs http://web.archive.org/web/20150202101559/http://nanochess.org/chess6.html), it uses memory offsets, and the logic around that particular lookup is very different - just look at the pawn moves, which Nanochess does from code instead of lookups, for example. You're dismantling your own argument in front of people who can actually comprehend ASM code, and anyone who can actually look and read what you told them to look and read will now never believe you.
Quote:
@qKkumba : I don't answer to your pompous emails anymore because the trouble with a mediocre virus writer like yourself (https://falsevxers.wordpress.com/2013/07/15/the-double-life-of-peter-ferrie-roy-g- biv-qkumba/) is thinking they are a 9.5/10 in asm while being a 7 and envious of others.

So you just took someone who (according to the credits) helped you, and now try to turn it into character assassination based on a random unsourced blogpost you googled up?
added on the 2015-10-13 15:05:52 by Gargaj Gargaj
Quote:
before Bootchess was released, there was no trace whatsoever of either 1) assembly or 2) chess programming in assembly


1979 called..
BB Image

Heck, Video Chess even implements castling and en passant correctly
added on the 2015-10-13 15:17:50 by Tjoppen Tjoppen
drama
sucks added on the 2015-10-13 15:30:54 by groepaz groepaz
@Baudsurfer, you "don't answer to my emails" that I didn't send anyway, and used an e-mail to tell me so, as well as announcing it here. Bootchess would not exist without me. You asked me for help, and I cut it until it fit in 512 bytes. This is what you call "code review". I work on Nanochess now.
added on the 2015-10-13 17:16:01 by qkumba qkumba
Wow, just wow. Upgrading my thumb.
sucks added on the 2015-10-13 17:34:47 by break break
Good at asm. Failing at human relations.
sucks added on the 2015-10-13 18:10:38 by noby noby
Quote:
before Bootchess was released, there was no trace whatsoever of either 1) assembly or 2) chess programming in assembly


Of course not, you are the first person in the world who coded a chess game in assembly. Nobody, except you of course, has been able to code a chess game in assembly. You are out of this world!

Quote:
@Stingray : also I dislike you very much as I hate weasels.


Fine, for me hate is just a four letter word.

Thanks for the entertainment.
added on the 2015-10-13 18:33:35 by StingRay StingRay
Smells like "social" media fueled mobbing.
Let's compare who downvoted this, but didn't upvote megapole.
<grabs popcorn>
rulez added on the 2015-10-13 20:29:33 by r1g8 r1g8
Hold on the pitchforks, Baudsurfer was talking specifically about Oscar Toledo.

You may grab your pitchforks again now.
added on the 2015-10-13 21:05:37 by p01 p01
A game that isn't chess and doesn't boot.
sucks added on the 2015-10-13 21:06:22 by cce cce
This is getting ridiculous
sucks added on the 2015-10-14 00:00:25 by Triace Triace
soundtrack vote
rulez added on the 2015-10-14 00:05:37 by Fell Fell
While Baud tends to exaggerate a bit, Mr. Toledo also isn't free from arrogance ;) I really can't decide or understand when a chess game is "broken" (even 1K ZX chess seems to miss some rules), so it's still a nice production for its size. And thanks for the drama - the scene needs it.
added on the 2015-10-14 09:25:26 by neoman neoman
BB Image
added on the 2015-10-14 11:23:30 by Serpent Serpent
Quote:

(c)2015 WTFPL v2 license.


Quote:

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.


... and then complain that people use the license as intended? If you want credit, use a license that says so!
sucks added on the 2015-10-14 11:44:13 by PulkoMandy PulkoMandy
Kudos to Baudsurfer for gaining such a big popularity (=number of views)!
added on the 2015-10-14 13:19:03 by lvd lvd
Quote:
soundtrack vote


HAHAHAHAHAA!!!!!!!!!!!!!!!!
added on the 2015-10-14 14:25:35 by djh0ffman djh0ffman
added on the 2015-10-14 15:27:50 by SiR SiR
Toledo Atomchess in 399 bytes (COM file), 408 if you want it bootable https://github.com/nanochess/Toledo-Atomchess, now in nasm syntax, optimization help from HellMood and qkumba.
added on the 2015-10-26 21:43:06 by nanochess nanochess
Never even try to understand how to code chess playing algorithm but always think that it's a type rocket science.
rulez added on the 2016-01-20 14:16:25 by ded^RMDA ded^RMDA
Quote:
Toledo Atomchess in 399 bytes (COM file), 408 if you want it bootable


Actually, now it's down to 383 bytes (COM) or 392 bytes (bootable). Neat!
added on the 2016-03-25 06:19:42 by trixter trixter
Please look at Chesslin ("the Edlin of Chess") for a 256 bytes (COM) chess program.
ZX81 Chess was better than this on every way.
sucks added on the 2016-11-17 13:47:37 by cngsoft cngsoft
Maybe a little late, but here I go...

Last year, almost by accident, I started a new chapter of the mini chess programs story. I was trying to learn some Z80 assembly and ended up writing a chess game for ZX Spectrum.

Following David Horne's ZX81 1K Chess, Olivier Poudade's BootChess, Óscar Toledo Nanochess/Atomchess and others, I have just finished my game, likely to be the smallest ever, called ChesSkelet. In its tiniest version ju​​st takes 379 bytes. Hey, I´m sure it still has some bugs , but I also hope to find some new way to shrink it a bit.

For more details or to play online, have a look here. On the website, you can find 2 other versions with som​e​ additional features.
http://chesskelet.x10host.com/

If you would like to get in touch with me, write me at:
alex(dot)garcia(dot)b(at)gmail(dot)com

See you!
Alex
added on the 2019-03-20 19:24:48 by reeagbo reeagbo
Lovely work!

I just came across a Timex Sinclair 1000 for $10, pulled up 1k ZX Chess and that brought me here.
rulez added on the 2019-07-10 06:02:21 by Leander Leander
@reeagbo It's never too late to break a world record!

I just released LeanChess, which is 328 bytes long - 24 bytes smaller than ChesSkelet and less than half the size of ZX1K.

Best,
Dmitry
added on the 2019-12-01 12:02:10 by leanchess leanchess
Delighted with playing chess of this bytecode size! But, it was hardly worth expecting a serious game from a program that fits into the boot sector of a floppy disk.

Always starts: King's Pawn Opening, respond to this move: Alekhine's Defence.

Then the chess game continues like this:

BB Image

The program does not respond to a check, and if you knock down the king, it throws it into DOS.

BB Image

BB Image

He generally reacts to castling in a curious way:

BB Image

Thanks a lot and best regards!
rulez added on the 2023-03-14 18:54:23 by yevrowl yevrowl

submit changes

if this prod is a fake, some info is false or the download link is broken,

do not post about it in the comments, it will get lost.

instead, click here !

[previous edits]

add a comment