back to article ZX81 BEATEN at last as dev claims smallest Chess code crown

Developer Olivier Poudade claims he's beaten a 33 year-old record for the smallest working Chess program. The previous record-holder, 1K ZX Chess, ran on the seminal Sinclair ZX81 which shipped with just 1K of RAM. 1K ZX Chess was lousy at the game, but its mere existence bestowed a little gravitas on the easy-to-ridicule ZX81 …

  1. werdsmith Silver badge

    The ZX81 changed my life!

    Literally, there was one TRS-80 in my school and it was kept in a dark locked roomed and only ever touched by an elite clique of sixth form under-geeks. I was never allowed near it.

    Then one kind science teacher brought his own ZX-81 into school and allowed us nobodies all over it during lunchtimes. That led to me being determined to own one (they cost the equivalent of today's XBOX One at the time) and so started a career that has kept me comfortable since. Before that I was literally going nowhere messing up O Levels and couldn't see how I was going to make my way in the world.

    I've still got the ZX81, I still code for minimal footprint (on the rare occasion that I write code these days). I still find chess tedious.

    1. Anonymous Coward
      Anonymous Coward

      @werdsmith & A non e-mouse

      I agree with both of you. Chess is ultimately very advanced stamp collecting; it is possible to program a computer to beat human players, but once you have done that there is little point in actually playing the game. Programming a computer to play chess is a significant intellectual challenge which advances the art of programming, and once you have done that you can use what you have learnt to solve other difficult problems.

      Most of the current generation of programmers will never experience the challenge of shoehorning functionality into a few bytes of assembler, which is a pity. As Goethe says in Natur und Kunst, the true master reveals himself through overcoming limitations.

      1. Uncle Slacky Silver badge

        Re: @werdsmith & A non e-mouse

        I'm reminded of the letter from Blaise Pascal (IIRC) where he apologised for lacking the time to make it shorter.

        1. Baldie

          Re: @werdsmith & A non e-mouse

          This from Mark Twain?

          1. Uncle Slacky Silver badge

            Re: @werdsmith & A non e-mouse

            Twain is reported to have said it, but it seems Pascal was probably the first:

            http://quoteinvestigator.com/2012/04/28/shorter-letter/

        2. Phuq Witt
          Headmaster

          Re: Blaise Pascal / Mark Twain quote

          ...or for the artists amongst us, a similar sentiement from Antoine de Saint-Exupery:

          *"A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away."*

    2. Dave 126

      >I've still got the ZX81, I still code for minimal footprint (on the rare occasion that I write code these days). I still find chess tedious.

      Try 'Go' - the board game, not the programming language!

      As a beginner player, I like the inherent tensions in the game are obvious (grabbing territory quickly Vs being secure) and the fact that you can get involved in a 'skirmish' at any time.

      Computers do not play Go well:

      Given an average of 200 available moves through most of a game of Go, for a computer to calculate its next move by exhaustively anticipating the next four moves of each possible play (two of its own and two of its opponent's), it would have to consider more than 320 billion (3.2×1011) possible combinations. To exhaustively calculate the next eight moves, would require computing 512 quintillion (5.12×1020) possible combinations. As of March 2014, the most powerful supercomputer in the world, NUDT's "Tianhe-2", can sustain 33.86 petaflops.[121] At this rate, even given an exceedingly low estimate of 10 operations required to assess the value of one play of a stone, Tianhe-2 would require 4 hours, to assess all possible combinations of the next eight moves in order to make a single play.

      (Hmm, how long would it take the ZX81 to do what Tianhe-2 does in 4 hours?)

      1. Simon Sharwood, Reg APAC Editor (Written by Reg staff)

        >> (Hmm, how long would it take the ZX81 to do what Tianhe-2 does in 4 hours?)

        Until the heat death of the universe. The envelope with the calculations is just over there ...

        1. Dave 126

          I've just found this thread http://forums.channelregister.co.uk/forum/1/2011/11/02/fujitsu_k_super_10_petaflops/

          in which Steve 48 (MIA since 2012) says "Reg units: I refuse to accept Petaflops - can we have it in terms of ZX81s instead?" and brainwrong (MIA for the last 18 months) responded:

          @Steve 48

          Excellent idea! Slow mode or Fast mode?

          The ZX81 didn't do double precision, it used a 40 bit format (documented in the excellent manual).

          I don't know the flops rating of a ZX81, and I should think that the difference between adds and multiplies (done in software) would be much larger than modern hardware, which may complicate comparisons.

          For a rough idea, a mandelbrot renderer I wrote in BASIC on a CPC464 (same Z80 running at similar speed, also 40 bit FP) achieved about 166 iterations per second. That was 4 adds and 4 multiplies, giving a whopping 1333 Flops!

          Re-writing it in PASCAL tripled the speed, at the expense of reduced precision of 32 bit.

          That was still so dreadfully slow that I re-wrote it again in Z80 assembler, bumping the precision back to 40 bit with my own routines. That ran at double the speed again, 1000 iterations/sec. Here I was able to replace a multiply by 2 with a single INC instruction, so I'll only claim 7 ops per iteration for 7 KFlops. I was still running renders up to 2 days at 320x400 resolution.

          I have no idea how fast double precision could be done on a Z80, which is what is needed for a true comparison, maybe someone has done it and knows?

          So, if I understand correctly (fat chance!), the ZX81 would need 4x10^12 hours, so that's roughly 4x10^9 years... so if not the heat death of the universe, then certainly getting a bit close to when the Sun will enter its Red Giant stage and engulf the Earth.

          4 billion years per move... I'll never complain about playing a boring board game again!

      2. Anonymous Coward
        Anonymous Coward

        Actually, computers play go well enough to beat a beginner. I was able to win only a few games against gnu go which is not the best go playing program. I've read they play at about 1 dan.

    3. DrXym

      Our school had this RML-380Z which was a hulking CPM thing with elephant disks. It must have cost a fortune and nobody knew how to use it or was very interested. One day someone turned up with a ZX81 and 3D monster maze and everyone was crowded around to see it.

      It's amazing now to think how this primitive, crappy little computer sparked more interest than a "proper computer". I got a ZX Spectrum soon after and was hooked.

      The school didn't learn though. They more some RML480s which were sans floppy and booted off the network somehow. Nobody was interested in them. They switched to BBC micros soon after which at least had some games, colour, sound and enough other things for kids to find them interesting. I still preferred my Spectrum though.

      1. werdsmith Silver badge

        DrZym

        "Our school had this RML-380Z "

        Yes, a couple of years later when I was doing day release at college we had an 8080 based CP/M thing which was like a stack hi-fi in a frame in layers.

        We did assembly language on converted cash registers, wrote a flow chart, wrote out the assembly on paper, hand assembled the assembly to hex codes on paper, then punched them in on the keypad - volatile storage. Switch them off and it's gone. Which was pretty OK as that was how I was programming the ZX-81 (set up a loop to put the hand assembled hex codes into memory with a POKE command).

    4. ParaHandy

      My dad bought a kit for £50. It was £70 built. You could put a 2KB RAM chip in it as this was socketed. No idea what that cost extra.

      He bought me one a few weeks later and that was my first experience with a soldering iron. It didn't work first time but several hours with a mutlimeter (old type using a galvanometer - lovely thing made of bakelite) comparing mine to his I eventually found a splash of solder under a capacitor. Cleaned that off and I had my first computer (they were micro back then until IBM made them personal a few years later). Happy days, learning to program from the excellent manual. 2K from the start and eventually getting a 16K upgrade, a sort of decent addon keyboard and even a sound add-on. Type too hard and all the dodgy connections caused it to reset but it was star trek technology to a 15 year old in 1981.

      The manual had more information in it, and taught me more about how a computer actually works than kids get in secondary school now. They are taught a lot about what a computer can do but almost nothing about how they work. A raspberry pi could do this but it needs a manual as good as the XZ81 and later that of the spectrum.

      Clive did some really good stuff up until the C5. But that's another discussion.

  2. A Non e-mouse Silver badge

    Although the ZX81 had 1KB RAM on board, not all of it was usable by programs. System variables and screen display took up some of that 1K. (If you used the full screen, you'd use 793 bytes of RAM!)

    Oh, and that 1K ZX Chess was actually done in 672 bytes - using just over half of the ZX81's RAM.

    Source: Wikipedia.

    @ werdsmith - I agree with you on the chess front ;-)

    1. Anonymous Coward
      Anonymous Coward

      The story claims that the x86 chess "runs" in a 512-byte x86 boot sector. (*) I think it means that the code itself presumably fits in to that sector, it doesn't say how much RAM it uses. The impressive thing about the ZX81 version was as much that the *whole thing fitted AND ran* in less than 1KB of free space.

      Another question is how much the x86 code exploits or uses any facilities in the PC's firmware, which I'd assume provides more than the ZX81's 8K OS/BASIC ROM. In fact, when I commented on this elsewhere, someone replied that the ZX81 version (apparently) *doesn't* use any notable ROM facilities, aside from picking up the display list pointer.

      There are also issues of whether the PC instruction set is more powerful per byte than the ZX81's, and whether that would be a benefit here (the opposite would be the case if modern x86 code was less space efficient in general).

      None of this is to say that the x86 program isn't an impressive achievement, more it's an acknowledgement that it's hard to directly compare the two because of the different environments.

      (*) This may be due to the article's mixture of paraphrasing and literal quotation:- ...and runs in “in a 512-byte x86 boot sector for Windows / Linux / OS X / DOS / BSD”.

  3. Blergh
    Megaphone

    En Passant

    If it doesn't allow castling I bet it doesn't allow En passant either.

    I'm so proud of myself. I've not played chess for 20 years and I still remembered!

    1. Anonymous Coward
      Thumb Up

      Re: En Passant

      Try this for size:

      http://www.quinapalus.com/picblitz.html

      Features

      •Knows all chess moves, including castling, en passant and pawn promotion and underpromotion

      •Independently-settable clocks for each player, defaulting to five minutes each

      •Plays black or white

      •Variable search depth, depending on time available

      •Negamax search with alpha-beta pruning

      •Rudimentary move sorting (captures before non-captures)

      •Extended search on captures and on forcing lines

      •Position evaluation function includes material, pawn structure (including doubled, isolated, backward and passed pawns), castling rights, king safety and piece centrality

      •Evaluation function weights change as the game progresses

      •Evaluation function tuned to prefer sharper variations for more entertaining games

      •Basic openings book (44 lines, 137 positions)

      In addition, it uses the following techniques to compensate for its limited processing power.

      •Thinking in your time (‘pondering’)

      •Minimalist user interface, hampering move entry

      •Attempting to disconcert you by replying instantly when it has correctly guessed your move even though it would otherwise think for longer

      •Displaying the board using barely-comprehensible black-and-white graphics

    2. Bigbird3141

      Re: En Passant

      IIRC the ZX81 1k chess doesn't allow en passant

  4. nematoad

    20/20

    easy-to-ridicule ZX81 …

    Maybe it is easy to ridicule the ZX81 with 20/20 hindsight but at the time it was an amazing bit of kit for the hobbyist.

    You might as well ridicule the Guidance and Navigation System on the Apollo Lunar Module:

    But it did get the job done with all of the constraints of the state of the art at that time.

    Same with the ZX81

    1. Simon Sharwood, Reg APAC Editor (Written by Reg staff)

      Re: 20/20

      Pfah! It was easy to ridicule at the time. Flimsy. Unreliable. Hard to do anything meaningful with. Stricken by hardware problems - remember how you had to get the RAM pack balanced just right?

      Yes, yes, yes ... it was also miraculous for its time. But it was a wretched thing to use, ergo worthy of ridicule.

      That's my $0.05. And I ended up with a Spectrum, a Spectrum+ AND a Spectrum 3. So it's not like I'm anti-Sinclair.

      1. Jedit Silver badge

        "remember how you had to get the RAM pack balanced just right?"

        Yes, which is why DKTronics RAM packs came with a piece of Velcro to hold them on. They were also designed to run across the back of the ZX81, fitting to its shape. Very swish, much better than the official Sinclair components and (if memory serves) slightly cheaper, too.

        1. Michael Strorm Silver badge

          Re: "remember how you had to get the RAM pack balanced just right?"

          The DKTronics thing sounds like it makes sense. I heard somewhere that the ZX81 rampack was because Sinclair used the existing (ZX80?) mould/design that didn't fit the ZX81's case...?

          At any rate, the RAM pack is one of the few aspects of the ZX81 that *was* simply poor design rather than an excusable attempt to keep costs down. Apparently one American magazine criticised Sinclair for not providing a proper keyboard, failing to realise that a full mechanical one back then probably would have come close to doubling the cost of the machine, and taken it out of the low-cost price niche where it made sense. (It would have been a moderately expensive black and white, low res, no sound machine no-one would have bought until those were added, at which point it would have been something more like a Vic 20 and been no cheaper).

          Yeah, it was horribly limited and I'm not claiming that the flat keyboard was nice, but all that was necessary to make it into a machine affordable enough for UK buyers at the time. An Atari 800 would have knocked its socks off, but it could damn well afford to- apparently it cost circa £600 when it launched in the UK (which would have been near the time the ZX81 came out for £70 pre-assembled).

          1. Little Mouse
            Boffin

            Re: "remember how you had to get the RAM pack balanced just right?"

            My home-made heat-sink / rampack holder took care of the wobble. Basically the whole zx81 sat on a sheet of metal, slightly shaped so you could wedge something in behind the rampack - a small length of garden hose in my case. I forget which hobbyist magazine the details were in, but it was the business.

            1. werdsmith Silver badge

              Re: "remember how you had to get the RAM pack balanced just right?"

              I could only just stretch to affording a ZX-81, the RAM PACK was beyond my means.

              I did desolder the RAM chip and replace it with a 2KB 6116 RAM chip. The DIL thru-holes were there in the PCB already, as this was the spec for the USA Timex version. And a soldered jumper link if I recall right.

              Pimp my Sinclair 1982 style.

          2. werdsmith Silver badge

            Re: "remember how you had to get the RAM pack balanced just right?"

            I've looked up that a BBC Model B cost £399 the equivalent of £1300 by the RPI, or £1700 relative to 2015 salaries. That's Apple MacBook money.

            The ZX-81 was initially £69.95 kit a/ £99.95 assembled, but came into my clutches when the price dropped to £69.95 assembled. Equivalent to £250 now, the Sinclair was the only way that I was going to get near a usable computer with a display/process/ram/storage.

          3. John Brown (no body) Silver badge
            Joke

            Re: "remember how you had to get the RAM pack balanced just right?"

            "Apparently one American magazine criticised Sinclair for not providing a proper keyboard,"

            Assuming said magazine still exists, I wonder how their reviews of smartphones and tablets read?

        2. Peter Gathercole Silver badge

          Re: "remember how you had to get the RAM pack balanced just right?" @Jedit

          I think that Memotech were the first people to do a shaped RAM pack that conformed to the shape of the rear of the case. A nice piece of kit that was made with a metal case.

          They also has a pass-through bus, so that you could plug things in behind the RAM pack. Eventually they produced bank-switched 32 and 64K memory packs, and other 'slices' that could be stacked one next to another for other things like high resolution graphics, and RS232 and Centronics printer ports.

          By the time you had bought a number of these, you might as well have bought a more capable machine!

          1. John Brown (no body) Silver badge

            Re: "remember how you had to get the RAM pack balanced just right?" @Jedit

            "By the time you had bought a number of these, you might as well have bought a more capable machine!"

            That was the point though,wasn't it. Those who could afford a more capable machine,did. The other choice was a loan or HP, so you'd end paying even more. An cheap but expandable and modular system was what brought computing to the masses. I well remember wrangling over the decision as to whether a faster, more reliable floppy drive instead of cassette tape would be a better investment than a printer which would let me debug my programmes by seeing more than 16 lines of code at once.

            For the record, the printer won. About £200 + another £35 for the interface box. The floppy drive came the following year and was only £150 (prices fell) with another £80 for the disk interface box, which includes a centronics interface and <gasp> a real time clock!

            1. Peter Gathercole Silver badge

              Re: "remember how you had to get the RAM pack balanced just right?" @John

              None of the Sinclair machines were built as modular systems. In the case of the ZX80 and 81, the card edge expander was effectively just the naked CPU busses with one or two added lines, and the cases were not produced with an eye to add additional equipment apart from the RAM pack. Even the Interface 1 for the Spectrum was only just fit for purpose.

              What happened is that capable and inquiring people found ways of using this 'expansion' bus to do things that it was not intended for. Indeed, if you could see a ZX81 with the Quicksilver expansion board on it, you would marvel at the fact that it worked at all!

              I spent time and money on my ZX81 mainly because I could (and I was waiting for my BBC micro to be delivered - about 6 months IIRC). Whilst it was fun, the benefit was very minor (the number of games that made use of the QS sound card was tiny) except for the satisfaction of doing it - exactly the definition of a hobby.

              I used to attend local computer user group meetings, and I took it as a challenge to make my '81 appear to do as much as the much capable systems like Acorn Atoms. This was before the days of colour computers, when what you saw at these meetings was Commodore Pets, Apple ][s (normally with a black and white TV or monitor because the color (sic) system was not PAL) and Atoms, with the occasional UK101 or Nascom system.

              At one such meeting, we had a demo of a prototype BBC micro (with a serial number below 10), and that sold me on spending the equivalent of a month's pay (I could afford this because I lived with my parents for a year after leaving University) to order one as soon as they opened the order line. I still have it, it's got an issue 3 board, and I think the serial number is in the somewhere around 7000.

              I still have my '81 as well, but unlike the BEEB, it no longer works.

      2. Peter Gathercole Silver badge

        Re: 20/20

        I added an external keyboard (adapted from a Tandy keyboard by repainting the conductive tracks on the flexible membrane and keyboard legends cut out from a magazine picture stuck on to the top of the keys with clear tape), together with a power switch on the keyboard. The ZX81 then sat untouched on a shelf, well away from poking fingers.

        Once there and safe from unwanted movement, I added a Quicksilver expansion board and sound card, together with an additional modulator to add the sound to the TV signal. I also hacked around with the internal 1K of memory, mapping it into a different address in the memory when the RAM pack was installed so it could be used, and also added a second 1K of static memory on the ULA/ROM side of the bus isolation resistors which allowed me to use it as a programmable character map by manipulating the I register that was used to hold the page address of the base of the character table.

        I never had any problems with it until my (homebrew) power supply popped it's bridge rectifier and fried the rampack!

        Good memories.

      3. Michael Wojcik Silver badge

        Re: 20/20

        But it was a wretched thing to use, ergo worthy of ridicule.

        This applies to at least one aspect of every computing system I have ever used, from four-function calculators to z-series mainframes.

        But if that means they're all worthy of ridicule, hey, I'm happy with that.

  5. Anonymous Coward
    Anonymous Coward

    Wow, still remember

    opening the book at xmas that the listing for 1k chess was in, also remember typing in the machine code with REM statements.

    I also remember being utterly amazed with my zx81.

    Long live the ZX81....

    PRINT USR1+USR1

    PS, i also remember that that program wouldn't castle either. (I think!, its a long time ago!)

  6. 45RPM Silver badge

    There are times, and this is one, when I realise what an absolute beginner I am at this writing software malarkey. Okay, so I don’t have the luxury of absolute minimalism - my code has to be readable and easily maintainable - but sometimes (for fun) I try to write tiny software. My best effort so far is 6.5KB Tetris. Which is appallingly bloated compared with this chap’s effort. And Tetris is a simpler game than Chess - if I were to attempt a Chess game you can be certain that I’d need at least 20KB to do it in.

    Respect.

    1. Uncle Slacky Silver badge

      Small Tetris

      I've got a printout somewhere of Tetris in C (running on a VAX), possibly from one of the Obfuscated C contests, that was written in one line which took up most of an 80x25 terminal screen. I've also got an ASCII Mandelbrot generator written in DCL (banned at uni shortly after being distributed, for obvious reasons).

  7. SolidSquid

    Not sure how this can really qualify as being a fully functional chess game if it's missing key components of the game, and I have to wonder how much code would be needed to add that in and whether it would still fall under the limit

    1. Little Mouse

      If the original benchmark 1K version being discussed is the same as the one listed at the end of the "How to Master Machine Code on your ZX81" tome, then IIRC that version also did not allow castling either. So at least it's a level playing field.

  8. Zog_but_not_the_first
    Angel

    The ZX81 will never be beaten!

    I predict that this will rapidly become a ZX81 retrospective thread.

    A wonderful piece of democratising technology. Its limitations (write a program to fill the screen and you can't run it) forced people to think about clever ways to make it work. I learned Z80 machine code just to write a passable StarTrek game.

    It changed lives in so many ways. How many early users learned the importance of using Vaseline for maintaining a snug fit with maximum contact? Or how milk can help you to keep your cool?

    And yes, chess is tedious.

  9. Michael H.F. Wilkinson Silver badge
    Thumb Up

    Very nice exercise in minimalist programming

    especially in an age where a word processing package has minimum requirements in terms of memory and compute power equivalent to a Cray Y-MP. Hats of (the black fedora again) to the programmer.

    The art of compact programming is not totally dead, of course. People working on embedded systems can do some really neat work. We also let student program Arduino boards, which also requires a fair degree of discipline in terms of memory use.

    1. ChrisC Silver badge

      Re: Very nice exercise in minimalist programming

      Indeed, embedded development is an area where old-school programmers can thrive, particularly if you stay within the lower-spec end of the business and avoid any contact with embedded systems which, based on their hardware spec and runtime environments, could easily be mistaken for a full-blown PC. I've spent my entire career so far in this area, working on systems varying from the positively luxurious (72MHz Cortex M3 with 128KB of flash and 20KB of SRAM) down to the wonderfully insane (1MHz Tiny AVR core with 1KB of flash and no SRAM whatsoever), and every time I get really stuck into a bit of embedded coding I end up having flashbacks to my formative years bashing out code on a Spectrum.

      Learning how to work within the limitations of the hardware (and, if you're also involved in designing the hardware environment itself, how to reduce the number of limitations without increasing the BOM cost or PCB size), knowing how to eke out a few extra bytes of memory, or shave a few cycles off a particularly time-sensitive bit of code, and then seeing the end result working nicely in a device which might be expected to run unattended for years on end without being reset, is a particularly rewarding experience.

      1. peterkin

        Re: Very nice exercise in minimalist programming

        Code you debug with an oscilloscope!

  10. Andy Non Silver badge
    Happy

    Fun times

    I remember learning to program on a ZX81. Wrote a little game of ping-pong. Don't know how anyone managed to program chess in 1k though - my hat is off to them. I wrote a fully featured chess program from the logic engine right up to graphical interface for Windows computers and that was complex enough. It even beats me on the highest level - I don't know whether to be happy about that or frustrated that it uses my own game play logic better than I do!

  11. PaulR79

    I know nothing of coding

    Allow me to pick upon the only other thing I can on this article - the video. Did he apply some sort of dark filter to the camera? Was the lens covered in mud? Was the camera powered by a ZX81? How can anyone use that as footage? It isn't that hard to record something from a screen using a camera / phone camera.

    I applaud the coding part though. I have never been able to learn anything sadly. I get frustrated too easily when a guide is slightly different to what is in front of me due to versions of program meaning things have moved around etc. Given the amount of time I sit in front of a computer though I know I should be able to learn something useful. If anybody has a seriously good starting point website I would appreciate links!

  12. theOtherJT Silver badge

    If it makes illegal moves, he's not really nailed it, has he?

    Still, I've got to applaud the achievement here, even if it's not 100%. I've tried to write a chess program about half a dozen times at this point and - not being much better at programming than I am at actually playing chess - don't think I've ever managed a complete implementation in _any_ language in _any_ amount of code, so I still find this very impressive.

  13. Dinky Carter

    Microchess?

    Microchess by Peter Jennings, released in 1976 for the Commodore Kim-1, was no slouch either, weighing in at 1.1k.

    Full 6502 listing here

    http://www.benlo.com/microchess/Kim-1Microchess.html#26

  14. Matthew 17

    He can use a few more bytes to fix it, still beaten the 81 :)

    I remember when a friend of mine got a new ZX81 for Christmas (I would have been about 8 or 9 I think), he had it hooked up to a small portable TV set in his parents kitchen. Simply by switching it on and typing something it was one of the most amazing things I'd ever seen.

  15. Paul Cooper

    Programming in small spaces

    Back in the 1980s, I had to write a data logging program for an S100 bus based single card computer with a Z80 processor. The program had to fit in the space allocated to EPROM - about 2k, if I remember correctly. No operating system, prototype hardware doing the data acquisition, time constraints on data acquitistion and logging, and I had to allow for buffering up to about 20 seconds of data during a tape rewind. I also drove a real time data display and accepted minimal commands from a keyboard device. I did have a reasonable amount of RAM, but had to dedicate pretty much all of it to the data buffer; only a few hundred bytes were used for program variables.

    I hate to think how big a program to do all that would be today, written in a high level language and without access to the hardware!

  16. Zombieman

    ZX81 - remember it well

    Seeing a (partial) screenshot of 1K chess, and (still) remembering how low memory ZX81s used memory for the screen, that's a minimum of 124 bytes for the screen. Add in the 125 bytes of system variables thats a quarter of the machine's 1K gone before you look at code.

    I seem to remember reading that the 1K ZX81 chess program didn't have an internal chess board, it actually used the screen display AS the storage for the board. Also remember reading there was no memory to store a starting position, so you had to reload from tape for every game, the initial position being on screen and loading alongside the program.

    And I also remember "no advanced rules", so no en passant and no castling - can't remember if that was implemented in the "16K" version.

    ZX81 "tokenised" BASIC let you do some wonderful memory saving things - for "speed" ZX BASIC stored floating point within code, so "3" cost you 8 bytes IIRC, but "INT PI" cost you 2 bytes. Any experienced ZX programmer will probably still remember the small integer recipes such as NOT PI for 0, SGN PI for 1 for example.

    1. Zombieman

      Re: ZX81 - remember it well

      (oops, human memory error, a literal "3" cost 7 bytes in BASIC not 8, in case anyone says anything)

  17. Anonymous Coward
    Anonymous Coward

    Where's the Horsey and the bloke with the pointy hat?

    "Geek Chess", tut.

    1. Zog_but_not_the_first

      Re: Where's the Horsey and the bloke with the pointy hat?

      Are you playing Queeg?

  18. People's Poet

    My father brought home a friends ZX-81 they'd only just purchased so I had it for a week or two. Like so many others I was hooked at that point and was soon spending my Saturday mornings and most of my holidays in the only computer shop in Durban, BBM Microworld. Most of that time was spent on TRS-80 Model 1's and III's. I got so well known that the staff would let me demonstrate the kit to customers.

    Another friend of my father had his ZX-81 held down onto a flat heavy piece of wood woth a metal bracket and the RAM pack held in place in similar fashion and the power cable with a clip also screwed down. It never crashed from RAM pack wobbles!

    I ended up with a TRS-80 Color Computer and a BBC Micro, the latter of which would overheat in the Durban climate when playnig Elite. I used to keep the top off it with a small desk fan directed over the CPU and motherboard. Worked a treat.

    Ah the heady days of micro-computing!

  19. mistergrantham

    illegal schimegal

    onya Poudade, punch em in the guts with the power gauntlet...

  20. conscience

    NOT PI - I always wondered why some programmers wrote numbers like that when I'd go through the BASIC listing of various games.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon