# Chess Opening Theory/Pachinko Index
## Introduction
### Why do we need an index?

Because this is a book and not an encyclopedia, so there has to be a logical order in which to read the various pages. And because it helps ensure that equally important openings get equal coverage. The internet can have "shallow bias" when it comes to discussing chess openings. Miscellaneous first and second moves by both players, especially exciting gambits, get proportionally more attention than important variations further along the branches of the tree. For example, there is a truckload of theory on the Blackmar-Diemer Gambit (1.d4 d5 2.e4?!) and there is a truckload of theory on the Latvian Gambit (1.e4 e5 2.Nf3 f5?!). But the Sveshnikov Sicilian line 1.e4 c5 2.Nf3 Nc6 3.d4 cxd4 4.Nxd4 Nf6 5.Nc3 e5 6.Nbd5 d6 7.Bg5 a6 8.Na3 b5 9.Bxf6 gxf6 10.Nd5 has two sub-variations, 10...f5 and 10...Bg7, and in real-world, high-level chess, both of those sub-variations are more significant openings than the entire Blackmar-Diemer Gambit or the entire Latvian Gambit.

### How do you index a book on chess opening theory?

Good question. It makes no sense to use alphabetical order. ECO codes (Encyclopedia of Chess Openings) have been the standard since the 1960s. There are a few reasons ECO codes might be sub-optimal for our purposes:
* ECO is a commercial endeavour. Cribbing off a commercial system is not really the wiki way. Go open source or go home!
* Although this is hardly ECO's fault, openings go in and out of style, and the 500 ECO codes are assigned to what used to be the 500 top openings in the 1960s. So the Staunton Gambit has two codes, the Centre Game has two codes, while several big beasts including the Sveshnikov Sicilian, c3 Sicilian, Advance French, Modern, Scandinavian and Scotch make do with one each.
* Because of that, an opening book arranged in ECO order will have some very long pages and some very short ones.
* All the possible codes from A to E and from 00 to 99 are allocated. The system can't be expanded unless Chess Informant announces a volume F or mathematicians discover some more two-digit numbers.
* The trunk-and-branch structure of ECO means you can get a position that's classified under one code, and a move later it's switched to a different code. The codes refer to routes rather than destinations. There is room for a complementary approach based on destinations.

### What's the Pachinko Index?

It's a free and hopefully future-proof complement to ECO codes developed for this Wikibook. It's represented by the symbol π (pi) - not to be confused with the number 3.1415926.
There are 2 letters and 2 numbers. Like this: Ru-57. They may remind you of chemical isotopes.

### What do the letters mean?

They're the highest level of the structure, the equivalent of ECO volumes. We can define new ones as needed. Currently there are 11 volumes:
* [Si] - the Open Sicilian, 1.e4 c5 2.Nf3
* [As] - the Anti-Sicilians, 1.e4 c5 2.everything else
* [Kp] - mutual king's pawn, 1.e4 e5, except for the Ruy Lopez
* [Ru] - the Ruy Lopez, 1.e4 e5 2.Nf3 Nc6 3.Bb5
* [Fr] - the French Defence, 1.e4 e6
* [Ks] - the semi-open defences, 1.e4 everything else
* [Ka] - a very small volume devoted to the King's Indian Attack, a particular White formation played against almost anything
* [In] - the Indian Defences, 1.d4 Nf6
* [Qp] - mutual queen's pawn, 1.d4 d5
* [Qs] - the semi-closed defences, 1.d4 everything else
* [Fl] - flank openings, anything other than 1.d4 or 1.e4 by White

### What do the numbers mean?

Within each volume there are 81 possible two-digit indexes. The numbers used are 1-9, there is no zero. Each index is one unit of opening theory. A unit isn't quite the same as a line in the traditional sense, because lines can transpose into each other, whereas Pachinko Indexes are (supposed to be) mutually exclusive. The idea is that once you've reached a particular Pachinko Index, you can no longer transpose out of it to a different one. This is not a 100% guarantee, but the assigned indexes have been checked and transpositions limited as far as possible.
They are also (supposed to be) roughly equal in size. This size corresponds to 1 game in 1,000, or to make the math easier, 1 game for every 500 games in your database that begin 1.e4 (1.e4 games represent about 50% of the total). If "something" happens in 1 game in every 1,000, it gets its own Pachinko Index. So you can read up on a single index in your lunch break, the way you can read a chapter of a book.

### Why is there no zero?

This is the, ahem, clever bit. The system is effectively base-9 so that it can be infinitely expanded fractal-style and the "missing" 10th code can be used to link different levels together. If the codes from Si-21 to Si-29 are all allocated and we need to fit another code in there, we just spin off a new volume where Si-2 gets replaced by, let's say, Nd. The second digit in the old volume becomes the first digit in the new volume, so Si-21 maps to Nd-11, Si-26 maps to Nd-61, etc. The codes in the old volume do not get recycled - they are permanently linked to the new volume.

### Why doesn't the line played in my game seem to fit into any Pachinko Index?

It's probably something that happens in fewer than 1 game out of every 1,000. There are a couple ways of handling those. One is to use a partial Pachinko Index, so if you find a random second move against the Caro-Kann that isn't covered by codes Ks-11 to Ks-19, you could just call it Ks-1 or even just Ks. (This is another reason for not using zeroes - it makes partial codes possible.) The other is to append either w or b and then a move number to the end of the Pachinko Index, so Fr-31b9 would be an opening that was heading towards Fr-31 until Black deviated from it on move 9.
Flexibility is always nice.

### Why "Pachinko Index"?

Because the words Pachinko and Index exist in almost every language. And because the individual units are like buckets in a pachinko machine - the ball may take tens or hundreds of different paths through the pins to arrive at the same one.

### Isn't this rather reinventing the wheel?

Not just the wheel. The whole darned tractor.

## The codes

| π | Codes allocated (max 9) | Openings covered | ECO equivalent |
| Si-1 | 8 | Sidelines after 2.Nf3 d6 | B27-B29 & B50-B57 |
| Si-2 | 8 | Najdorf Sicilian | B90-B99 |
| Si-3 | 3 | Dragon Sicilian | B70-B79 |
| Si-4 | 7 | Classical Sicilian | B58-B69 |
| Si-5 | 3 | Scheveningen Sicilian | B80-B89 |
| Si-6 | 4 | Rossolimo Sicilian | B30-B31 |
| Si-7 | 9 | 2...Nc6 3.d4 including Sveshnikov Sicilian | B32-B39 |
| Si-8 | 5 | Taimanov Sicilian | B45-B49 |
| Si-9 | 5 | Kan Sicilian | B40-B44 |
| Si | total 52 | | B27-B99 |
| As-1 | 3 | 2...Nc6 and 2...d6 vs. Closed Sicilian, including Grand Prix Attack | B23-B26 |
| As-2 | 1 | St. George Sicilian (2.Nc3 a6) | B23 |
| As-3 | 2 | Alapin Sicilian Main Line (2...Nf6) | B22 |
| As-4 | 2 | Alapin Sicilian, Barmen Variation (2...d5) | B22 |
| As-5 | 1 | Smith-Morra Gambit | B21 |
| As-6 | 1 | McDonnell Attack (2.f4) | B21 |
| As-7 | 1 | Czerniak Variation (2.b3) | B20 |
| As | total 11 | | B20-B26 |
| Kp-1 | 2 | Vienna Game | C25-C29 |
| Kp-2 | 4 | King's Gambit | C30-C39 |
| Kp-3 | 1 | Bishop's Opening | C23-C24 |
| Kp-4 | 0 | reserved for Centre Game | C21-C22 |
| Kp-5 | 3 | Russian (Petroff's) Defence | C42-C43 |
| Kp-6 | 2 | Philidor and Hanham Defences | C41 |
| Kp-7 | 3 | Four Knights and Ponziani | C44 & C46-C49 |
| Kp-8 | 6 | Italian (including Giuoco Piano) | C50-C59 |
| Kp-9 | 4 | Scotch Game | C45 |
| Kp | total 25 | | C20-C59 |
| Ru-1 | 2 | Open Berlin Defence | C67 |
| Ru-2 | 2 | Closed Berlin Defence (4.d3) | C65 |
| Ru-3 | 1 | Schliemann (Jaenisch) Defence | C63 |
| Ru-4 | 0 | reserved for Classical Defence | C64 |
| Ru-5 | 2 | Exchange Variation and Deferred Defences other than 4...Nf6 | C68-C76 |
| Ru-6 | 2 | White alternatives to 5.0-0 | C77 |
| Ru-7 | 4 | 5.0-0 sidelines | C78-C88 |
| Ru-8 | 4 | Closed main line | C90-C99 |
| Ru-9 | 2 | Marshall Gambit and anti-Marshalls | C89 |
| Ru | Total 19 | | C60-C99 |
| Fr-1 | 2 | White second move variations other than KIA | C00 |
| Fr-2 | 4 | Tarrasch French, everything except 3...Nf6 | C03-C04 & C07-C09 |
| Fr-3 | 2 | Closed Tarrasch (3...Nf6) | C05-C06 |
| Fr-4 | 2 | Advance French | C02 |
| Fr-5 | 2 | Exchange French | C01 |
| Fr-6 | 4 | Winawer French | C15-C19 |
| Fr-7 | 3 | 3.Nc3 Nf6 4.Bg5 | C12-C14 |
| Fr-8 | 2 | Steinitz French (3.Nc3 Nf6 4.e5) | C11 |
| Fr-9 | 2 | Rubinstein French | C10 |
| Fr | Total 23 | | C00-C19 |
| Ks-1 | 2 | Caro-Kann second move variations other than KIA | B10-B11 |
| Ks-2 | 4 | Exchange Caro-Kann including Panov-Botvinnik | B12-B14 |
| Ks-3 | 3 | Advance Caro-Kann | part of B12 |
| Ks-4 | 5 | Open Caro-Kann (3.Nc3/Nd2 dxe4) | B15-B19 |
| Ks-5 | 6 | Pirc Defence | B07-B09 |
| Ks-6 | 4 | Modern Defence | A42 & B06 |
| Ks-7 | 3 | Scandinavian Defence | B01 |
| Ks-8 | 4 | Alekhine's Defence | B02-B05 |
| Ks-9 | 2 | Assorted rare defences to 1.e4 | B00 |
| Ks | total 33 | | A42 & B00-B19 |
| Ka-1 | 1 | KIA vs. French | part of C00 |
| Ka-3 | 1 | KIA vs. Caro-Kann | part of B10 |
| Ka-6 | 1 | KIA vs. Closed Sicilian | B24-B25 |
| Ka-7 | 1 | KIA vs. ...e6 Open Sicilian | part of B40 |
| Ka-9 | 1 | KIA vs. Yugoslav Réti | part of A07 |
| Ka | total 5 | | |
| In-1 | 5 | 2.c4 sidelines and Trompowsky Attack | E00 |
| In-2 | 5 | Nimzo-Indian Rubinstein System (4.e3) | E40-E59 |
| In-3 | 6 | Nimzo-Indian, everything else | E20-E39 |
| In-4 | 8 | Bogo- and Queen's Indians | E10-E19 |
| In-5 | 9 | King's Indian with 5.Nf3 | E90-E99 |
| In-6 | 6 | King's Indian, everything else | E70-E89 |
| In-7 | 7 | Grünfeld Defence | D70-D99 |
| In-8 | 5 | Fianchetto System (classified as a King's Indian by ECO) | E60-E69 |
| In-9 | 5 | Benoni and Benko | A56-A79 |
| In | total 56 | | A56-A79, D70-E00 & E10-E99 |
| Qp-1 | 6 | Semi-Slav | D43-D49 |
| Qp-2 | 4 | Main Line Slav | D15-D19 |
| Qp-3 | 6 | Assorted Slav sidelines including 4.e3 | D10-D14 & D31 |
| Qp-4 | 5 | Queen's Gambit Declined 3...Nf6 other than 4.Bg5 | D35-D42 |
| Qp-5 | 4 | QGD Pillsbury Attack (4.Bg5) | D50-D69 |
| Qp-6 | 2 | QGD alternatives to 3...Nf6 | D32-D34 |
| Qp-7 | 4 | Catalan Opening | E01-E09 |
| Qp-8 | 4 | Assorted other defences to the Queen's Gambit | D06-D10 |
| Qp-9 | 5 | Mutual queen pawn, everything other than the Queen's Gambit | D00-D05 |
| Qp | total 40 | | D00-69 & E01-E09 |
| Qs-1 | 1 | English Defence | part of A40 |
| Qs-2 | 0 | reserved for Keres Defence | part of A40 |
| Qs-3 | 3 | Leningrad Dutch | A87-A89 |
| Qs-4 | 2 | non-Leningrad Dutches | A90-A99 |
| Qs-5 | 2 | anti-Dutches | A80-A84 |
| Qs-6 | 1 | Old Indian | A41 |
| Qs-7 | 1 | Old Benoni | A43-A44 |
| Qs-8 | 0 | reserved for Bogoljubow-Miles Defence and Black Knight's Tango | A50 |
| Qs | total 10 | | A41, A43-A55 & A80-A99 |
| Fl-1 | 2 | Independent lines after 1.Nf3 d5 | A06-A09 |
| Fl-2 | 3 | Independent lines after 1.Nf3 Nf6 | A05 |
| Fl-3 | 1 | Independent lines after 1.Nf3 c5 | A04 |
| Fl-4 | 3 | Assorted defences to 1.c4 | A10-A19 |
| Fl-5 | 5 | Reversed Sicilian | A20-A29 |
| Fl-6 | 7 | Symmetrical English | A30-A39 |
| Fl-7 | 1 | Bird's Opening | A02-A03 |
| Fl-8 | 2 | 1.b3 | A01 |
| Fl-9 | 1 | Everything else | A00 |
| Fl | total 26 | | A00-A39 |