Your first chess program.

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Ron Murawski
Posts: 397
Joined: Sun Oct 29, 2006 4:38 am
Location: Schenectady, NY

Re: Your first chess program.

Post by Ron Murawski »

I started out in 1981 on a Sinclair ZX80. It looked like a door wedge.
http://oldcomputers.net/zx80.html
It had a membrane keyboard that was almost unusable. I added a 32K RAM pack (for $150!). Hitting the membrane keys caused the RAM pack to wobble and would crash the machine. I quickly modified the computer by cutting into the case and added an external full-sized keyboard.

I learned Basic from the excellent Sinclair manual. Basic was not only a programming language, it was also the operating system. Back then you booted to a Basic prompt.

I soon realized Basic was a very slow language, so I learned Z80 assembly language. In the Sinclair you would create a long REM statement, and then poke in your machine code. You could then call the machine code using the following Basic line:
RAND USER 16514
where 16514 was the address of the first REM line. (That's why you needed to put it first, otherwise it got messy trying to calculate where your machine code would be located in memory.)

I remember using Z80ASM to assemble my programs
http://z80cpu.eu/mirrors/oldcomputers.d ... z80asm.pdf
At the heart of Z80ASM was something called the 'Dirty Dog' assembler - it was a quick and dirty implementation and programmers were often heard saying "You dirty dog!", hence the name. I kinda remember saying things that were worse than that... I remember disassembling the Z80ASM program and finding a text string right at the beginning saying: "Nosy, aren't you?"

After upgrading my machine to a Sinclair ZX81 (and immediately modifying it to accept my external keyboard), I bought the Sinclair disassembled ROM code and it became easy to call math and I/O functions from assembly language.
http://k1.dyndns.org/Vintage/Sinclair/8 ... ra%29.html

I wrote a chess move generator in Z80 asm and it did a 7-deep perft in about 10 seconds. But, when I printed out the chess board, it would occasionally 'lose' a piece that the move generator had inexplicably lost. It was a very buggy piece of software and I never fully debugged it.

I did not return to chess programming until 2000.
diep
Posts: 1822
Joined: Thu Mar 09, 2006 11:54 pm
Location: The Netherlands

Re: Your first chess program.

Post by diep »

Ron Murawski wrote:I started out in 1981 on a Sinclair ZX80. It looked like a door wedge.
http://oldcomputers.net/zx80.html
It had a membrane keyboard that was almost unusable. I added a 32K RAM pack (for $150!). Hitting the membrane keys caused the RAM pack to wobble and would crash the machine. I quickly modified the computer by cutting into the case and added an external full-sized keyboard.

I learned Basic from the excellent Sinclair manual. Basic was not only a programming language, it was also the operating system. Back then you booted to a Basic prompt.

I soon realized Basic was a very slow language, so I learned Z80 assembly language. In the Sinclair you would create a long REM statement, and then poke in your machine code. You could then call the machine code using the following Basic line:
RAND USER 16514
where 16514 was the address of the first REM line. (That's why you needed to put it first, otherwise it got messy trying to calculate where your machine code would be located in memory.)

I remember using Z80ASM to assemble my programs
http://z80cpu.eu/mirrors/oldcomputers.d ... z80asm.pdf
At the heart of Z80ASM was something called the 'Dirty Dog' assembler - it was a quick and dirty implementation and programmers were often heard saying "You dirty dog!", hence the name. I kinda remember saying things that were worse than that... I remember disassembling the Z80ASM program and finding a text string right at the beginning saying: "Nosy, aren't you?"

After upgrading my machine to a Sinclair ZX81 (and immediately modifying it to accept my external keyboard), I bought the Sinclair disassembled ROM code and it became easy to call math and I/O functions from assembly language.
http://k1.dyndns.org/Vintage/Sinclair/8 ... ra%29.html

I wrote a chess move generator in Z80 asm and it did a 7-deep perft in about 10 seconds. But, when I printed out the chess board, it would occasionally 'lose' a piece that the move generator had inexplicably lost. It was a very buggy piece of software and I never fully debugged it.

I did not return to chess programming until 2000.
complete BS as for your own person.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Your first chess program.

Post by Evert »

Ron Murawski wrote: I wrote a chess move generator in Z80 asm and it did a 7-deep perft in about 10 seconds.
...
Really?
Martin Brown
Posts: 46
Joined: Sun Oct 18, 2009 12:07 pm

Re: Your first chess program.

Post by Martin Brown »

Dan Honeycutt wrote:Programmers,

How did you get into chess programming? What was your first program like?
Not mine but the first computer chess I ever ran into was Arthur Norman's PDP-2 assembler program which dates from about 1974. A fair amount of the code was dedicated to driving a vector graphics display screen. It was cute but had a tendency to cheat creatively in complex positions due to overflowing the stack (which it detected and then gracefully cheated). This made it a lot harder for good chess players to beat. I think I still have a listing for it in the loft somewhere.

My own first chess prog was a 6502 asm version on the Acorn Atom in about 1980/81. Lost the code and wore out the hardware. It had material evaluation in one byte, alphabeta and swapoff heursistics and pawn = 3. Played it against a ZX81 chess program once and the the result was painful to watch. Machine against machine back then was very meandering. It did OK against weaker humans since they have a plan and it just had to hang on and eventually spot a tactical blunder that they had missed. Any half decent chess player could hammer it into the ground - as was true back then of all computer chess programs.

I also have a heavily modified copy of a small chess program from 1986 originally written in VAX Pascal by Bob Kushlis with help from Peter Gilbert (according to the headers). It has been through two dialects of Pascal and Modula2 so it now bears little resemblance to the original.

Is there a repository for historic chess programs from way back?
Martin Brown
Martin Brown
Posts: 46
Joined: Sun Oct 18, 2009 12:07 pm

Re: Your first chess program.

Post by Martin Brown »

jdart wrote:I wrote a DOS-based program in Modula-2 back in 1991-2. It was never released. It had an integrated user interface written in assembly language, using direct video writes, supporting VGA and Hercules graphics modes (if you remember Hercules, you are an old-timer like me). The graphics was probably the best part of it, though, because the chess engine was junk, and like Dan, I was happy if it could solve mate in 4 or something like that. It tried to do some fancy dynamic eval with analysis of en prise pieces etc.
--Jon
Out of curiousity which dialect of M2? Logitech, JPI, StoneyBrook or another? M2 programmers are unfortunately a rare breed.

ISTR Logitech & JPI could support inline assembly after a fashion (although Logitech was input your own hand annotated hexadecimal). JPI had native Hercules graphics support in the libary. The JPI code generator and runtime debugger was way ahead of its time on the PC (as was Logitechs post mortem debugger but code gen was very pedestrian).
Martin Brown
Matthias Hartwich
Posts: 38
Joined: Tue Jul 01, 2008 9:36 pm

Re: Your first chess program.

Post by Matthias Hartwich »

I started 1986 with typing the BASIC Source into my Schneider CPC 464 (german version of Amstrad CPC). It got about 0.33 nodes/s. 8-)
My improvements just got it faster by a small margin so I started to rewrite it in assembler. Only having finished the move generator I went on in 1990 with an Atari Mega ST with Omicron BASIC (some 10 nodes/s interpreted) and Turbo C (500 nodes/s).
In 1992 I bought a 486 DX2...
jdart
Posts: 4367
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: Your first chess program.

Post by jdart »

IIRC it was targeted at the Stony Brook Modula-2 system but I think I also used Logitech around that time. I did a lot of programming in the UCSD p-System (Pascal) in the late 70's/early 80s (but not chess) and at some point I migrated to Modula-2. But it was a bit of a dead-end as you know, although the Stony Brook system apparently still exists as a product (http://www.modula2.org/sb/productinfo.htm).
JVMerlino
Posts: 1357
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: Your first chess program.

Post by JVMerlino »

I sort of came in the back way. :)

I started as a member of the Chessmaster GUI team in 1996, working on Chessmaster 5500, and I stayed on that team for more than six years. My last version was CM9000. So while I wasn't working on a chess engine, I did talk with Johan regularly about how to interface new GUI features.

I started working on my first chess engine, Myrddin, in 2009. I hadn't done any programming to speak of after leaving the CM team in more than six years, and it just felt like something that would be "fun". Little did I know. Myrddin is still a less-than-mediocre engine, but I'm now working on a bitboard conversion. So hopefully someday it will be merely mediocre.

jm
diep
Posts: 1822
Joined: Thu Mar 09, 2006 11:54 pm
Location: The Netherlands

Re: Your first chess program.

Post by diep »

JVMerlino wrote:I sort of came in the back way. :)

I started as a member of the Chessmaster GUI team in 1996, working on Chessmaster 5500, and I stayed on that team for more than six years. My last version was CM9000. So while I wasn't working on a chess engine, I did talk with Johan regularly about how to interface new GUI features.

I started working on my first chess engine, Myrddin, in 2009. I hadn't done any programming to speak of after leaving the CM team in more than six years, and it just felt like something that would be "fun". Little did I know. Myrddin is still a less-than-mediocre engine, but I'm now working on a bitboard conversion. So hopefully someday it will be merely mediocre.

jm
Who did work on CM4000? I remember CM4000 release. Back then I found its graphics pretty impressive.
JVMerlino
Posts: 1357
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: Your first chess program.

Post by JVMerlino »

diep wrote:
JVMerlino wrote:I sort of came in the back way. :)

I started as a member of the Chessmaster GUI team in 1996, working on Chessmaster 5500, and I stayed on that team for more than six years. My last version was CM9000. So while I wasn't working on a chess engine, I did talk with Johan regularly about how to interface new GUI features.

I started working on my first chess engine, Myrddin, in 2009. I hadn't done any programming to speak of after leaving the CM team in more than six years, and it just felt like something that would be "fun". Little did I know. Myrddin is still a less-than-mediocre engine, but I'm now working on a bitboard conversion. So hopefully someday it will be merely mediocre.

jm
Who did work on CM4000? I remember CM4000 release. Back then I found its graphics pretty impressive.
Chessmaster 4000 was worked on by a completely different team at Mindscape, although they were only a few doors down from me at the time. You can see the complete credits for it here:

http://www.mobygames.com/game/win3x/che ... bo/credits

Dan Guerra is listed as the artist, and he was still working on Chessmaster up through CM9000, doing all 2D art. When true 3D graphics were implemented in CM9000, we had a dedicated 3D artist as well.

jm