It struggles a little with complex positions, like when there are an even number of moves and it has to round down, but when run against itself it's capable of finding some novelties. At one point I saw six knights on the board at once; Stockfish rarely exceeds four.
This comic shows a new chess engine, presumably created by Randall, which takes a list of all legal moves (in algebraic notation) in alphabetical order and chooses the median. The name may also be intended to invoke AlphaGo, the first computer program to beat a professional human Go player.
Algebraic notation begins with a symbol for which piece is being moved, which is always the first letter of the piece name, with the exception of knights (N) and pawns (nothing). This is then followed by the square that the piece is being moved to. For example, 'Rc4' would indicate a move that moved a rook to c4. Other symbols include a lowercase x before the destination, indicating that the move is a capture; a plus sign (+) after the destination, indicating that the move places the opposing king in check; and a hash sign (#) after the destination, indicating that the move places the opposing king in checkmate, thus winning the game. There are also O-O and O-O-O notations, which indicate that a player is castling kingside or queenside, respectively.
In practice, this algorithm runs into a few issues. As seen in the comic, the algorithm rarely moves bishops and rooks due to their relative lack of moves in the early game, and their tendency to inhabit the edges of any list when they do have sortable moves. Among basic moves, only pawns destined to move in the first two files of a board can ever sort higher than bishops, and nothing other than another rook can be closer to the far end than a rook. The algorithm favors knight and king moves, with entries starting with the most alphabetically middling "K" and "N" list entries, and (to a lesser extent) pawns destined to move up the right side of the board, the "h"-file pawn generally having the greatest statistical chance. Castling moves would also occur near the middle of the list, as they are denoted with letter 'O' characters as O-O or O-O-O, but could only appear in the list of legal moves after the bishops moved or were captured and before the associated king moved, which would be very unlikely. The shortcomings of AlphaMove are instantly apparent from looking at the game board presented in the comic; roughly ten moves into the game, White has lost three pawns, captured nothing, and advanced their king into the open rather than developing any pieces, while Black (presumably being played by a 'stronger' conventional chess engine) has taken control of the center with a knight and two pawns, developed a bishop, and advanced their queen to f2.
The actual middle of the list might vary away from the usual alphabetic median if the moves (and the pieces removed by the opponent) are heavily biased to a particular subset of player-pieces. It is conceivable that an opponent could identify the AlphaMove strategy as being used, and then use their foreknowledge of the algorithm's 'developing game' to strategically make (normally non-optimal) moves designed explicitly to force the algorithm down their own choice of path, such as targeting undefended rooks and queens (either capturing them with impunity, or just strategically restricting their movements by moving into contact with them in a way that would normally be a suicidal sacrifice), in order to make certain other pieces take moves more advantageous to the opponent. However, given the established failings of uncritically sticking to the algorithmic plan, it is probably vastly more effort to precisely engineer a given game-state than to merely play properly and respond with half-decent responses to the overwhelmingly sub-optimal series of moves generated by AlphaMove. For example, setting Stockfish (Black) against AlphaMove (White) results in the following fifteen-move victory for black:
- f3 e5
- e4 Bc5
- d4 Bxd4
- f4 d5
- g4 Qh4+
- Ke2 Qf2+
- Kd3 dxe4+
- Kxe4 Nf6+
- Kd3 e4+
- Kc4 Be6+
- Kb5 a6+
- Ka5 Bc3+
- Ka4 b5+
- Ka3 Qc5+
- b4 Qxb4#
On the other hand, a person playing black who knew that white was using AlphaMove could win in five moves (possibly fewer):
- f3 e5
- e4 Qf6
- d4 Qxf3
- dxe5 Bc5
- g4 Qf2#
However, chess tournaments do not award more points for quicker victories, and playing like this would be risky. If White initially uses AlphaMove and Black goes for the five-move checkmate, White could capture Black's undefended queen on move three, revealing the AlphaMove emulation to just be a ruse to get Black to expose a queen. White would then be in a winning position after 4. Nxf3, 4.Qxf3, or 4. gxf3, so opting for the fifteen-move mate would likely be safer. Indeed, playing Stockfish against itself after 4. Nxf3 yields the following 29-move win for white:
- f3 e5
- e4 Qf6
- d4 Qxf3
- Nxf3 exd4
- Bc4 b5
- Bd5 c6
- Bb3 c5
- Bd5 Nc6
- Ng5 Nh6
- Qh5 Kd8
- Nxf7+ Nxf7
- Qxf7 Bb7
- Bf4 c4
- O-O Bc5
- Qxg7 Rf8
- Na3 Rxf4
- Rxf4 a6
- Rf7 d3+
- Kh1 Ne7
- Bxb7+ Rc8
- Rxe7 Bxe7
- Qg8+ Bf8
- Qxf8+ Kc7
- Qxc8+ Kb6
- Qxd7 d2
- Qc6+ Ka7
- Bc8 d1=Q+
- Rxd1 c3
- Qxb7#
Thus, the AlphaMove ruse, where White pretends to use AlphaMove in order to trick Black into hanging the black queen, can be advantageous for White if Black falls for it. However, even after 1. f3 e5 2. e4, White has a weakened kingside early in the game and has not been the most productive at allowing for future development, so Black should focus on development (e.g., 2. … Nc6 or 2. … Bc5) and use the advantage that Black already has instead of risking falling into a trap. (Of course, the AlphaMove ruse would only have any chance of working if the opponent reads xkcd, which is another reason to not try it.)
Even if AlphaMove ever found one or more of its potential moves to be one that happens to result in checkmate, it has no reason to do anything other than choose its "mid-list move", as described, and the chances are high that such a mate would never be invoked. Along those lines, Qa4+ is a relatively safe move to create a short-term check, to put immediate pressure upon the Black king, and potentially a longer term inconvenience with 'only' a predictable response preventing it from developing into a mate. But it is not in the right list position to attempt, never mind whether it would then be correctly followed up.
This engine may be named for and inspired by the real chess engine AlphaZero, or AlphaGo which plays a different game but has a more similar name. Another real name, mentioned in the title text, is Stockfish, a widely used (and powerful) chess engine.
On this board, Black can win the game instantly with ...Bb4#. Rather than do anything to defend against this, White just moves an unrelated piece, almost certainly losing immediately afterward. Randall has also chosen a setup where the king is placed in a position where it cannot make any legal moves, thus removing it from the list of pieces that can perform any moves. Almost certainly this was a choice, both to make the list without king moves and also to make it pretty easy to see how one more move would be checkmate.
The title of the comic is a play on words. As the name of the chess engine, it refers to the strategy of choosing moves based on alphabetical ordering, while in popular usage, an "alpha move" is an action that would assert dominance over someone else. This makes it an ironic name for the chess engine; rather than asserting dominance, it loses quickly.
The title text mentions games with "six knights", which implies that two pawns have been promoted to knights. Pawns can promote to bishop, knight, queen or rook, so the middle of this list is tied between knight and queen. It is rare that a pawn is promoted to a knight; in most situations a queen would be preferred. The exceptions (perhaps where promoting to queen would cause either an immediate stalemate from what was a winnable position, or let the king survive on a square that's a knight's move away from the newly-promoted queen) are common in contrived chess puzzles but rare in actual gameplay. Promotion to rook or bishop would be even rarer, as these pieces have fewer move possibilities than a queen without the alternative moves of the knight. It would probably be due to a 'forced' promotion, in lieu of moving a more vital piece currently perfectly positioned for the endgame, and the player concerned should be perfectly aware of they must or must not promote to, ahead of time. However, when AlphaMove plays itself, the pawns tend to preferentially move up (and down) the right-hand side of the board, and may meet each other in double-files, or more, possibly with the opportunity to cross over to capture an opponent. If the alphabetical balance of moves becomes such that multiple right-hand files of pawns are dodging past each other, it is not unrealistic that multiple pawns would reach the respective back ranks and 'choose' to promote to knights.
Chess is a recurring theme on xkcd, with another recent example being 3036: Chess Zoo.