Computer chess created in 487 bytes

For everything that's not in any way related to PureBasic. General chat etc...
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Computer chess created in 487 bytes

Post by djes »

User avatar
Tenaja
Addict
Addict
Posts: 1949
Joined: Tue Nov 09, 2010 10:15 pm

Re: Computer chess created in 487 bytes

Post by Tenaja »

That is awesome. Maybe Wilbert can pull a byte out...
User avatar
J. Baker
Addict
Addict
Posts: 2178
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: Computer chess created in 487 bytes

Post by J. Baker »

Now that's impressive! :shock: I just wonder how many bytes were used in order for it to be cross platform?

1K ZX Chess - 672 bytes

Image
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
User avatar
luis
Addict
Addict
Posts: 3876
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Computer chess created in 487 bytes

Post by luis »

Red Sector wrote:BootChess is the smallest computer implementation of chess on any platform (487 bytes) for Windows / Linux / OS X / DOS / BSD / DOSBox / Bochs
J. Baker wrote:I just wonder how many bytes were used in order for it to be cross platform?
It's not cross platform, don't know why they felt the need to make you believe that.
Thanks to that also almost any place reporting the "news" says it can run on all those OSes. MAH!

Runs on computers having a PC-compatible BIOS without requiring any particular OS since the program is loaded from the boot sector and it just requires the basic I/O BIOS routines for keyboard input and characters output provided by all the PC-compatibles, the good old software interrupts loved by DOS programmers (INT 0x10 anyone ?).

Write the bootsector to floppy, set the BIOS to boot from it, and then you can have OS/2 or Banana OS on your PC and it still will work.

Does that mean it "runs on" or it is "for" OS/2 and Banana OS too ?

It's basically more like a DOS program using just BIOS calls than anything else.

There is an option to build a .COM program from it by setting the appropriate starting offset using the fasm 'org' directive (and some other small details) and that's it.

BTW: these software are obviously nice and very interesting and all but they should be called "chess-like" or "sub-chess" programs since they don't implement all the chess rules.
For one, tell a chess player he can't castle...
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
tj1010
Enthusiast
Enthusiast
Posts: 624
Joined: Mon Feb 25, 2013 5:51 pm
Location: US or Estonia
Contact:

Re: Computer chess created in 487 bytes

Post by tj1010 »

The real question is: how good is the AI?
The truth hurts.
User avatar
luis
Addict
Addict
Posts: 3876
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Computer chess created in 487 bytes

Post by luis »

Not very good, but what can you expect from around 500 bytes ?
Also didn't catch some illegal moves, as already reported by others and I've verified that.
That's bad.
I appreciate the effort still required to get even this (took 3 months to write @ 1 to 3 hours per day) and the value it has for the person who wrote it (you must give everything you got and solve countless problems, and it's all good) but I don't see the reason to write something incomplete just to forcibly try to dethrone a previous software which HAD TO stay in 1KB.
1KB was a constrain imposed by the hw, since that was the amount of RAM the machine was sold with. So he had to do the best possible with what was available.

Today, write a complete implementation with the smallest footprint you can if you want, but make something that work. All this work for something broken...
You are using a different architecture, a different instruction set with another cpu, different code in ROM to support you, a comparison doesn't make sense anyway.

There are some decent chess engines (very good really for their size) in 1-2 KB. I find those a lot more interesting than this. And they play CHESS and they can beat many beginners easily.

They can certainly beat Bill Gates -> http://www.chess.com/news/bill-gates-vs ... conds-8224
I'm not joking.
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
skywalk
Addict
Addict
Posts: 4003
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Computer chess created in 487 bytes

Post by skywalk »

Thanks for the link. Chess nerd here.
The feat can be admired at first glance, but ultimately not practical.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
tj1010
Enthusiast
Enthusiast
Posts: 624
Joined: Mon Feb 25, 2013 5:51 pm
Location: US or Estonia
Contact:

Re: Computer chess created in 487 bytes

Post by tj1010 »

I wrote a simple chess prediction tool once that had no memory, it only listed moves that couldn't be compromised inside two turns. It was a lot of code.

For actual AI you need memory for guarding algorithms plus code to simulate turns based on a complexity setting. I'd hate to have to manage assembler code-base for that..
The truth hurts.
User avatar
Otrebor
Enthusiast
Enthusiast
Posts: 201
Joined: Mon Mar 17, 2014 1:42 pm
Location: São Paulo, Brasil
Contact:

Re: Computer chess created in 487 bytes

Post by Otrebor »

User avatar
luis
Addict
Addict
Posts: 3876
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Computer chess created in 487 bytes

Post by luis »

@otrebor

I agree with the person in the first link (unsurprisingly).
Didn't know about the last point he's mentioning, so thanks for the link. :shock:

BTW: Toledo Atomchess Game (from Óscar Toledo)
http://www.nanochess.org/chess6.html

comments from Bootchess author:
http://www.pouet.net/prod.php?which=64962#c715480

answer from Toledo (author of a LOT of small chess programs):
http://www.pouet.net/prod.php?which=64962#c715482
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
Otrebor
Enthusiast
Enthusiast
Posts: 201
Joined: Mon Mar 17, 2014 1:42 pm
Location: São Paulo, Brasil
Contact:

Re: Computer chess created in 487 bytes

Post by Otrebor »

Thank you for the links, Luis.
Well...i think that in nowadays the chess is competitive in a different way :|
User avatar
luis
Addict
Addict
Posts: 3876
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Computer chess created in 487 bytes

Post by luis »

Otrebor wrote: Well...i think that in nowadays the chess is competitive in a different way :|
They have modified their source, adding this:

Code: Select all

; BootChess is the smallest computer implementation of chess on any platform
; Chess in a 512-byte x86 boot sector for Windows / Linux / OS X / DOS / BSD
; Coded by Olivier "Baudsurfer/RSi" Poudade with extra help of Peter "QKumba"
; Ferrie. Logo by Frederic "Cleaner/Break" Cambus. (c)2015 WTFPL v2 license. 
; ****************** To Mr. Oscar Toledo and others : **********************
; YOU MAY REFACTOR THE RESULT OF OUR WORK (THIS FILE) BUT PLEASE CREDIT US !
; ******************************************************************
Remember -> http://www.pouet.net/prod.php?which=64962#c715482

They may be somewhat competent at coding, even if they tend to lie about their achievements or to not verify their statements just to gain media attention, but the resulting final picture of them is embarrassing. They suck on so many levels.
Then again they are being celebrated on countless pages and even on BBC, and if that is all they were looking for, I suppose it's a success.
"Have you tried turning it off and on again ?"
A little PureBasic review
Post Reply