Back to Silas S. Brown's home page

Solving Micropower Chess (1982)

Jump to shortest solution

I'm only an intermediate player (Elo perhaps 1500 if given enough time), but I did once checkmate some software that "Micro Power" released in 1982 for the then very new BBC Micro Model B (which it ran in screen mode 1)---and as this program always replied to a given sequence of moves in the same way (no random factor), any win against it can be repeated every time and therefore counts as having "weakly solved" that level. I first did this by lasting as long as I could with equal-material exchange, knowing that microcomputers of the time were more likely to play badly in the endgame, but it turns out there are considerably shorter solutions.

Confusion about level numbers

MicroPower released three versions of Chess that ran on the BBC Micro:
  1. a tape version in 1982, with 6 levels numbered 1 through 6;
  2. a tape "Electron" version in 1983, with levels 1, 3, 5, 7 and 9 identical to the first 5 levels of the 1982 version, plus new 'in-between' levels that introduced randomness;
  3. a BBC Micro disk version (which is what my school had)---this is the 6-level 1982 version plus a relocation loop, but they confused us by adding a loader that explains how level-numbering works on the Electron version (oops!) leading us to believe the highest level was 9 when it wasn't.
This wouldn't have been so bad if it weren't for how the response to the "Level?" question is handled by the 1982 version---you'll find the relevant 6502 code at RAM address &1DF2 (or &2DF2 before relocation)---if the key pressed does not fall between digits 1 and 6, it just sets it to 2 without saying anything.

So if you read the loader instructions as I did, you'll think "best play" is Level 9, but when you choose Level 9 you will get Level 2 (equivalent to Level 3 on the Electron version).

Long solution to Level 2

This was my first solution, in 89 moves (I could have checkmated on move 47 but then we wouldn't have seen an empty-board endgame); the computer made striking mistakes on moves 45, 67 and 76. The program was set to control the Black pieces, and I thought I was playing "Level 9" as I didn't know about the above level-numbering mix-up. (On the other hand, the real best-play levels are so slow they make only a few moves per day, and I doubt anyone would have let me run a computer for long enough to reach an endgame at that speed.)

In more modern times I tried a similar technique on Magnus Carlsen's 2014 iOS app and narrowly beat "age 10" (which is different from Magnus's real age 10: Tord Romstad set progress more 'linear' when tuning his Stockfish predecessor for the app)---it let me win an otherwise-drawn endgame by responding to move 78 inaccurately. These games are not usually reproducible as the engine adds a random factor, but here it is for reference:

Fishing-Pole Trap

In the BBC Micro days I had no way of knowing about Brian Wall's "fishing-pole trap" operated by black (open with knights and sacrifice one on g4 to expose white's castled king)---I don't think it was published before the 21st century (unless someone discovered it independently). Experimenting on an emulator shows the BBC Micro's Level 2 is vulnerable to this trap and it reduces the game length to 14 moves, which is rather fewer than I originally took:
1. e4 e5 2. Nc3 Nf6 3. Nf3 Nc6 4. Bc4 Bc5 5. O-O Ng4? (setting the trap) 6. Na4 Bd6 7. h3 h5? 8. hxg4?? (falling for the trap) hxg4 9. Nh2?? (falling much further in) Qh4 10. Bxf7+ Kxf7 11. f3? g3 12. Re1 Qxh2+ 13. Kf1 Nd4 14. c3 Qh1#
This also works on the Electron version's Level 3 if it starts with e4 not d4. It does not work on higher levels.

Using modern engines

The shortest game I found against an unassisted modern engine was 16 moves, with MicroPower level 2 controlling the white pieces against 2002's Sjeng 11 (the engine behind Apple Chess) in a mid-level mode: Increasing the play-level of Sjeng (or using Don Dailey et al's Komodo 9) or decreasing the play-level of the BBC Micro made the game 5 to 8 moves longer (although the modern engine still won of course).

I was able to reduce this to 14 moves as white by manually playing an unusual opening until the computer put its king in a risky place (misfired heuristic?), then letting a modern engine "do the honours" from move 8:

1. g3 d5 2. Bh3 Be6 3. Bxe6 fxe6 4. Nf3 Nc6 5. O-O Nf6 6. d4 Kf7? 7. Ng5+ Kg6? 8. Qd3+ Ne4 9. h4 e5 10. h5+ Kxh5 11. Qf3+ Kg6 12. Qf7+ Kh6 13. Nxe4+ g5 14. Bxg5#
and then a couple of manual experiments shortened this still further, to a 12-move game that (oddly enough) gives discovered checkmate by 'pawn to king 4':
1. g2g3 d7d5 2. f1h3 c8e6 3. h3e6 f7e6 4. g1f3 b8c6 5. h1g1 g8f6 6. d2d4 e8f7 7. f3g5+ f7g6 8. h2h4 d8c8 9. h4h5+ g6h5 10. g3g4+ h5h4 11. g1h1+ h4g4 12. e2e4#
(pawn to king four checkmate) This works on Level 2, but meets a different response on Level 1 that requires another half-dozen moves to win.

If the exact algorithm is known for a deterministic weaker engine then I suppose a stronger engine could be "tuned" to win faster by laying 'traps'---non-best moves that result in this particular opponent making an even bigger mistake---by modifying the minimax algorithm in the stronger engine to prune out lines the weaker engine wouldn't choose (e.g. never mind "10. g4 is not as good as Qd3 because the black king could go back to g6 and escape our forced mate in 4" if we know it'll actually go to h4 and we mate in 3). This would probably amount to emulating the weaker engine (with its different static evaluator and search depth) at every candidate 'opponent to move' position instead of doing alpha-beta pruning (because alpha-beta pruning is not applicable to trees where there's only ever one opponent move), but you might want to limit this "trap pruning" to upper levels of the tree (probably down to at most the difference between the two engines' ply depths), and there'll be places where the simulation of the weak engine can be optimised.

Higher levels

Now we know I was actually playing Level 2 (not 9), I suppose for completeness I should also post solutions to the actual higher levels (I took some hints from modern engines to save time).

Default "Replay" game

MicroPower's "Replay" feature normally plays back the last-played game. The limit is 150 moves each (actually it's 303 ply but castling counts as 2½ ply); Replay also has display bugs if you've played 130-odd moves and left the game unfinished.

If you choose Replay before any game has been played, it gives you a 41-move sample game that seems incomplete. Moves are stored in RAM at &19A0 (relocated from &29A0, from file CHESS offset BA0, from disk-image offset 1FA0); the first two bytes point to the next free slot, then start and destination squares are encoded as 10*(rank+1)+file where rank and file start at 1; for castling the king's move is coded first and then the rook's after a byte 01.

This turns out to be a copy of Fischer versus Spassky, Reykjavik world championships (Iceland), 7 January 1972 round 6. It's "incomplete" because Spassky resigned after Fischer's 41. Qf4---the computer doesn't tell you this and just returns to the menu. (Modern engines tend to checkmate black within 7 moves, e.g. ...Qg8 42. Qe5 Rh7 43. e7 Qxg2+ 44. Kxg2 Rg7+ 45. Kf3 Kh7 46. Bd3+ Rg6 47. Rxg6 Rc8 48. Rg5#)

MicroPower documented the inclusion of the Fischer-Spassky game on the back cover of the 1982 tape release, but then it was removed for the 1983 "Electron" release (probably because extra code necessitated moving the Replay buffer to &400 which is outside the program's load-address range and they didn't fancy writing a relocator), and when they later brought back the 1982 version for a disk release they apparently forgot it included a Fischer-Spassky game and didn't mention it, making it a so-called "easter egg". (At school I assumed it to be a pre-generated computer self-play and wondered why I could never get the same moves with the Play option.)

Other differences with the Electron version

As already mentioned, the 1983 re-release "for the Acorn Electron" (although the BBC Micro can run either version) changed the level numbers---levels 1, 2, 3, 4 and 5 were renumbered 1, 3, 5, 7 and 9, with randomised intermediate levels added and the old Level 6 dropped---and the bundled copy of the Fischer-Spassky game was removed.

Other changes were:

  1. The Electron version does not use the keyboard buffer, so when playing a deterministic level you cannot enter moves ahead of the computer as you can with the BBC Micro version. This is somewhat made up for by the added ability to continue from any point in a replay.
  2. Support for under-promotion is added (the computer asks "Piece?" when you promote) although only queen promotions are included in the search. To demonstrate this without waiting for the computer too long, here's a 42-move win against Level 1 that includes two promotions, behaving identically on both versions:
  3. When the computer controls the white pieces, instead of always opening with e4, it now chooses at random between d4 and e4 (even on the odd-numbered levels that don't otherwise involve randomness). The opening behaviour when you play white is unchanged (e5 if you first move from a, c or e, d5 otherwise).
  4. The menu has fancier formatting, clocks are displayed for both players (not just the user), the "Replay" option prints a scrolling list of moves beside the board and you can continue from any point or save/load the moves, move 'animations' are slightly faster (with a slightly longer beep for "illegal move") and colours are customisable.

The bugs associated with the Delete key are still present.

Tube compatibility and other Chess software

The only Chess engine reviewed by Beebug was Martin Bryant's Colossus in 1987 (plays at 12-ply with estimated 1850 Elo if given enough time, and has a monochrome Mode 4 display); this outperformed earlier engines but fewer schools had the disk. Colossus does not always make the same moves, so you won't be able to "solve" a level with a single win as you can with MicroPower.

Tube compatibility is relevant if you have a "PiTubeDirect" ~140× speed second processor instead of a BBC emulator running at ~15× speed---although both options are now outpaced by Chris Evans' "BeebJIT" which can achieve 5000+× speed on AMD64 (and has a mode to do so while keeping timers at normal speed, so you don't have to toggle back to 1× to type as you do with older emulators).

MicroPower Chess is basically Tube-compatible but the chessboard is invisible: you see only the coordinates. Colossus however has more serious Tube problems. Acornsoft Chess (which Arthur Norman helped write) and Computer Concepts Chess (and its Superior re-release, both by David Thompson) have full Tube compatibility and don't always make the same moves, while Bug-Byte Chess is fully Tube compatible and deterministic (although slow to update the screen)---but it's less clear what counts as "solving" it as its search parameters may be configured in hundreds of ways (albeit none of them strong by modern standards)---however these programs all use low-resolution Mode 5 pieces that can be hard to tell apart, meaning that, in order to avoid making blunders due to misidentifying an opponent piece, you either have to get used to their odd pixel art or else keep track of the position separately, meaning there's little advantage over MicroPower's invisible board; perhaps the lack of Mode 1 graphics contributed to these programs' being less popular with schools than MicroPower's.

All material © Silas S. Brown unless otherwise stated.