Myopic's internals have been upgraded to support a search reporting a predicted variation, or "PV". This means that a search will produce not just the (supposedly) best move, but also the predictions for a number of successor moves. Now, PV calculations require O(N^2) memory where N is the maximum sequence length. To make things fit in the 8 KB RAM limit of the AVR1280, the program sets an upper bound of seven moves in a PV.
The PV is shown with embedded move numbers, just as would be seen in traditional chess media and commercial chess programs. The score and the analysis node count also appear in the output as before, but now the count is reported for each search instead of being a cumulative statistic.
The letters used for the colors and pieces are stored as initialized constant tables that take only a few lines of code. This mean that users that prefer non-English abbreviations for colors and pieces can make changes easily.
Myopic's Arduino sketch is now about 24 KB long. That's larger than I had expected at this point but still far below the AVR1280's 128 KB flash limit. The program's RAM requirement has grown to be about 6,700 bytes of the 8,192 available. Myopic does not use any EEPROM.
I've placed an order with SparkFun for one of their 8x8 RGB LED arrays with an attached AVR that communicates via a 125 KHz SPI channel. The matrix firmware allows only a single display update format that requires a full 64 bytes of data; this in turn limits the refresh rate to about 200 Hz and there may be other factors that lower it even further. However, the matrix firmware can be re-flashed to support other software protocols, and one improvement would allow random access of the individual LEDs. When a chess move is made, it usually changes the contents of only two squares (three for an en passant capture and four for castling) and so only a few bytes need to be sent with an incremental updating scheme.
A re-flash of the matrix controller may also be needed for LED color management. Some documents say that 256 colors are available while others say the limit is only eight. Maybe somebody have already tried a re-flash to handle extra colors. This will need more research.
SparkFun also sells a 128x64 monochrome LED array and I'll probably get one of this for displaying a (very tiny) chessboard. But both it and an 8x8 LED matrix would be optional additions to the program; a user could still do battle with only a serial interface.
From Reinfeld's 1,001 Brilliant Ways To Checkmate, here are problems number six through ten as seen in the sketch source:
TestMateSearch(2, "r2q1r2/pp2np2/1bp4p/3p2pk/1P1N2b1/2PB2B1/P5PP/R2QK2R w KQ - 0 1");
TestMateSearch(3, "r1bqr3/pp1kn1pp/2pp4/6B1/1P6/PBp5/2P2PPP/R2QR1K1 w - - 0 1");
TestMateSearch(2, "6R1/p4p2/1p2q2p/8/6Pk/8/PP2r1PK/3Q4 w - - 0 1");
TestMateSearch(3, "6kr/1q2r1p1/1p2N1Q1/5p2/1P1p4/6R1/7P/2R3K1 w - - 0 1");
TestMateSearch(3, "6rr/p2b1pk1/1pn1p1p1/2qpPP2/3N2P1/2P1Q3/P2B2K1/2R4R w - - 0 1");
And here's the program's output for the above:
Distance: 2 FEN: r2q1r2/pp2np2/1bp4p/3p2pk/1P1N2b1/2PB2B1/P5PP/R2QK2R w KQ - 0 1
bR:: bQ bR ::
bPbP:: bNbP::
bBbP:: :: bP
:: ::bP:: bPbK
wP wN ::bB::
:: wPwB:: wB
wP:: :: ::wPwP
wR ::wQwK ::wR
[w KQ - 0 1]
Predicted variation: 1 Qxg4+ Kxg4 2 Be2#
Score: MateIn2 Nodes: 1567
Distance: 3 FEN: r1bqr3/pp1kn1pp/2pp4/6B1/1P6/PBp5/2P2PPP/R2QR1K1 w - - 0 1
bR::bBbQbR:: ::
bPbP::bKbN bPbP
::bPbP :: ::
:: :: :: wB
wP :: :: ::
wPwBbP :: ::
::wP:: wPwPwP
wR ::wQwR wK
[w - - 0 1]
Predicted variation: 1 Qxd6+ Kxd6 2 Bf4+ Kd7 3 Be6#
Score: MateIn3 Nodes: 50162
Distance: 2 FEN: 6R1/p4p2/1p2q2p/8/6Pk/8/PP2r1PK/3Q4 w - - 0 1
:: :: ::wR::
bP :: ::bP::
bP ::bQ:: bP
:: :: :: ::
:: :: ::wPbK
:: :: :: ::
wPwP ::bR::wPwK
:: ::wQ:: ::
[w - - 0 1]
Predicted variation: 1 Qe1+ Rxe1 2 g3#
Score: MateIn2 Nodes: 334
Distance: 3 FEN: 6kr/1q2r1p1/1p2N1Q1/5p2/1P1p4/6R1/7P/2R3K1 w - - 0 1
:: :: ::bKbR
::bQ:: bR bP
bP ::wN::wQ::
:: :: ::bP::
wP bP :: ::
:: :: :: wR
:: :: :: wP
:: wR :: wK
[w - - 0 1]
Predicted variation: 1 Rc8+ Qxc8 2 Qxg7+ Rxg7 3 Rxg7#
Score: MateIn3 Nodes: 42347
Distance: 3 FEN: 6rr/p2b1pk1/1pn1p1p1/2qpPP2/3N2P1/2P1Q3/P2B2K1/2R4R w - - 0 1
:: :: ::bRbR
bP ::bB::bPbK
bPbN::bP::bP::
:: bQbPwPwP::
:: wN ::wP::
:: wP wQ ::
wP:: wB ::wK::
:: wR :: ::wR
[w - - 0 1]
Predicted variation: 1 Qh6+ Rxh6 2 Bxh6+ Kh7 3 Bf8#
Score: MateIn3 Nodes: 43844