From 53ffc69d40171e21b2da192c5994611a2ee6b34e Mon Sep 17 00:00:00 2001 From: vrubelroman Date: Wed, 28 Oct 2026 12:07:29 +0300 Subject: [PATCH 1/9] =?UTF-8?q?Opponent=20prep:=20owner's=20scope=20?= =?UTF-8?q?=E2=80=94=20openings=20only,=20desktop=20first?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5.1 --- docs/research/opponent-prep.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/research/opponent-prep.md b/docs/research/opponent-prep.md index 44c3d88..76f3aaf 100644 --- a/docs/research/opponent-prep.md +++ b/docs/research/opponent-prep.md @@ -272,3 +272,11 @@ ChessBase Style Report (боевитость, риск, острота, темы ## 8. Как воспроизвести замеры Скрипты лежали в scratchpad сессии (`rep.py`, `book.py`): разбор PGN регулярными выражениями, фильтр по `White`/`Black` = «Вафин Радель», подсчёт первых 1–6 полуходов, результатов, первых и последних `[%clk]`, числа различных префиксов до 30 полуходов и первого полухода, где префикс встречается в базе реже T раз (сама партия исключена). Файл владельца не изменялся. + +## 9. Решения владельца (2026-10-28), ветка `opponent-prep` + +- **Только дебюты.** Нужны две вещи: что он играет (репертуар по цветам с названиями и первыми ходами) и где в дебютах ошибается (какие ошибки, в каких дебютах, в каких партиях). Цейтнот, фазы, тренд, «как побеждали», стиль — **не делаем**. +- **Книга — большая база на полке** (Mega и т. п.) или дебютная база, если есть; по ней — «где ушёл из теории / редкий ход». Ошибки — движком. +- **Названия дебютов** — по таблице `lichess-org/chess-openings` (CC0), на английском, как на Lichess при любом языке интерфейса, всегда с первыми ходами; переводить 3 865 названий на 9 языков не будем. +- Онлайн-партии соперника в отчёте — нет. Досье/экспорт — потом. **Android — потом**, сначала компьютер. +- Работа ведётся в ветке `opponent-prep`: решение о слиянии — после того, как владелец посмотрит результат. From 015fa0cfe3a93c8d8d0438c443abbe7d527a3ad8 Mon Sep 17 00:00:00 2001 From: vrubelroman Date: Wed, 28 Oct 2026 12:18:56 +0300 Subject: [PATCH 2/9] Design: opponent preparation screen Co-Authored-By: Claude Fable 5.1 --- docs/design/opponent-prep.md | 482 +++++++++++++++++++++++++++++++++++ 1 file changed, 482 insertions(+) create mode 100644 docs/design/opponent-prep.md diff --git a/docs/design/opponent-prep.md b/docs/design/opponent-prep.md new file mode 100644 index 0000000..697fe89 --- /dev/null +++ b/docs/design/opponent-prep.md @@ -0,0 +1,482 @@ +# Подготовка к сопернику: экран отчёта по дебютам + +Статус: проект дизайнера, 2026-10-28, **не утверждён**; ветка `opponent-prep`. Объём — по решениям владельца (`../research/opponent-prep.md` §9): **только дебюты** — что соперник играет (репертуар по цветам с названиями и первыми ходами) и где в дебютах ошибается (какие ошибки, в каких дебютах, в каких партиях). Без часов, фаз, трендов, стиля, онлайн-партий, досье и Android. Названия дебютов — по таблице `lichess-org/chess-openings`, по-английски при любом языке интерфейса, всегда с первыми ходами. «Книга» — большая база с полки, по ней «где ушёл из теории / редкий ход»; ошибки — движком. + +Опирается на: концепцию аналитика (`../research/opponent-prep.md` §3.1–3.4, §5), техническую часть разработчика (`../research/opponent-prep-tech.md` §2–5, §7: крейт `crates/prep`, дерево на N = 20 полуходов, дедупликация позиций, кэш по позиции, формула времени), `reference.md` (таблица ходов и таблица партий, выбор базы, «Новинка», стек партий «⬅ К партии»), `board-search.md` (полоса Б/Н/Ч, чипы, мини-доска в подсказке, меню ⋯ доски), `large-databases.md` / `library-layout.md` (панель фильтров, шапка таблицы), `narrow-windows.md` (минимум окна 640×480, стопка на экране партии), `player-games.md` (список имён, тексты RU/EN), код `apps/desktop/src/review.rs` (диалог анализа: движок · качество · потоки · память · оценка времени; после первого запуска кнопка стартует сразу — флаг `chosen`), `notation.rs` (`assessment_color`, `assessment_text_color`), `large_db.rs` (группа «Игроки», контекстное меню строки партии), `library.rs` (контекстное меню карточки), `game_view.rs` (шапка партии, `previous` → «⬅ К партии»). + +Размеры — логические точки egui. Макеты: ширина 1400 — 14 точек на знак (100 знаков), 640 — 10 точек на знак (64 знака); значки в ASCII опущены там, где ломают выравнивание. Тексты — по-русски, в §9 — пары «ключ EN → RU» (ключ — английский текст, как везде в `i18n.rs`). Пример данных — Вафин Радель из базы «Гран-при РШШ» (271 партия: 138 белыми, 133 чёрными). + +## 0. Коротко + +1. **Вход — три двери, один диалог.** «Подготовиться к {имя}…» есть в панели фильтров (когда игрок выбран), в контекстном меню строки партии (по одному пункту на каждого игрока) и в меню ☰ / по правой кнопке на названии партии. Все три ведут в один диалог «Подготовка к сопернику» с базой, списком кандидатов с числом партий (похожие имена отдельной группой, объединение написаний — флажками), цветом и книгой. Если имя уже точное (из фильтра с подсказкой или из строки партии), диалог открывается с готовым выбором — остаётся нажать Enter. +2. **Отчёт — отдельный экран на весь размер окна, как экран партии**, со стеком возврата «⬅ К подготовке» из открытой партии. Слева доска выбранной позиции, справа вкладки «Репертуар | Дебюты | Ошибки» и под ними список партий выбранного узла. В правую панель библиотеки (260–380) дерево с шестью колонками не входит; отдельное окно ОС противоречит однооконной компоновке проекта. +3. **Цвет — переключатель в шапке отчёта «Белые | Чёрные | Оба»**, не вопрос при входе. Дерево всегда имеет корни «Белыми · 138» и «Чёрными · 133»; переключатель показывает один корень или оба. По умолчанию — цвет из фильтра библиотеки, если он задан, иначе «Оба». Область работы движка следует переключателю (в диалоге можно поменять). +4. **Движок — по кнопке «Найти ошибки в дебютах», с диалогом как у анализа партии**, качество «Быстро» по умолчанию (своя настройка, отдельная от анализа партии), оценка времени по дедуплицированным позициям. После первого запуска кнопка стартует сразу с теми же параметрами (как `chosen` в `review.rs`), диалог — по «▾». Ошибки появляются в дереве и таблицах по мере оценки; отмена сохраняет сделанное; повторный отчёт — из кэша. +5. **Ошибка привязана к узлу дерева** (позиция + его ход): отметка `?!`/`?`/`??` стоит у хода в дереве, цветами нотации; «повторяющаяся ошибка» — это узел с отметкой и ≥ 2 партиями. Одна модель данных для дерева, таблицы дебютов и вкладки «Ошибки». +6. **Книга** — выбор как в Справочнике (список баз полки, по умолчанию самая большая по файлу, можно «Нет»); в дереве колонка «Книга» с числом партий книги в позиции; первое место, где число падает ниже 5, выделено — «здесь он выходит из книги». Редкий ход ≠ ошибка, подсказки это говорят. + +## 1. Сценарии + +### 1.1. Тренер готовит ученика к завтрашней партии белыми против Вафина + +1. Библиотека, база «Гран-при РШШ» → «Фильтры» → «Игрок: вафин» → подсказка «Вафин Радель · 271». Под строкой цвета появилась кнопка «♟ Подготовиться к Вафин Радель…». +2. Нажал → диалог: база «Гран-при РШШ», кандидат «Вафин Радель · 271» отмечен, ниже «Похожие имена: Вафина Раяна · 10» (не отмечена), цвет «Чёрные» (ученик играет белыми — соперник чёрными), книга «Mega Database 2026». Enter. +3. Экран отчёта: вкладка «Репертуар», корень «Чёрными · 133» раскрыт: «1.e4 — 79 партий», под ним «1…c5 — 79 · 100 %» (всегда сицилианская), дальше «2.Nf3 d6 — 39», «2.c3 Nf6 — 17»… Счёт в каждом узле, дата последней партии, «Книга: 1 203 981» у 1…c5. Щелчок по «2.c3 Nf6» — доска показывает позицию, снизу 17 партий. +4. «▶ Найти ошибки в дебютах ≈ 30 с» → диалог с «Чёрные — 133 партии», «Быстро» → Enter. Полоса «Ищу ошибки: 412 из 1 306 позиций · ≈ 20 с»; в дереве у «6…Nb6» появляется «?» и число «×3». +5. Вкладка «Ошибки»: «Повторяющиеся» — «после 6.Bc4 · 6…Nb6 ? · лучше 6…e6 · ×3 · +1 −2 · Sicilian Defense: Grand Prix Attack». Щелчок — доска показывает позицию до хода с двумя стрелками (сыгранный — оранжевый, лучший — зелёный). Enter — партия на этом ходу; «⬅ К подготовке» возвращает. +6. На доске «⋯ → Играть отсюда…» — ученик разыгрывает позицию после 6…Nb6 против Maia; «Открыть как партию» — тренер записывает линию с комментариями и сохраняет в базу ученика. + +### 1.2. Быстрый взгляд перед туром (без движка) + +Турнирная база открыта, таблица партий. Правая кнопка на строке «Кузнецов — Вафин» → «Подготовиться к Вафин Радель…» → Enter в диалоге → отчёт за секунду. Вкладка «Дебюты»: «Белыми: Sicilian Defense 37 % · French Defense 15 % · Caro-Kann 13 %…», раскрыть сицилианскую — варианты с первыми ходами и счётом. Достаточно, чтобы сказать ученику «он всегда 1.e4, на 1…c5 чаще 2.Nf3, но бывает Гран-при». + +### 1.3. Повторный отчёт после обновления базы + +База онлайн-партий дописалась новыми партиями. Вход тот же; сбор дерева — мгновенно; оценки прежних позиций — из кэша; в шапке «Ошибки найдены · Stockfish 19 · Быстро · 1 306 позиций · новых 84 [Доразобрать ≈ 5 с]». + +## 2. Точка входа + +### 2.1. Три двери + +| Где | Элемент | Что передаёт в диалог | +|---|---|---| +| **Панель фильтров**, группа «Игроки», под строкой цвета («любым цветом · белыми · чёрными») | кнопка «♟ Подготовиться к {name}…» (`♟ Prepare against {name}…`); видна, когда игрок выбран из подсказки (`NameFilter.exact`); при свободном тексте без подсказки — кнопка «♟ Подготовиться к сопернику…» без имени (диалог покажет кандидатов по этому тексту). В узком окне панель — выдвижная, кнопка та же | база — текущая; игрок — `exact`; цвет — из фильтра («белыми» → Белые, «чёрными» → Чёрные, иначе Оба); остальные активные фильтры (годы, Эло, турнир) — как условия отчёта (§2.4) | +| **Контекстное меню строки таблицы партий** (`large_db.rs:2214`), после «Открыть» | два пункта: «Подготовиться к {white}…», «Подготовиться к {black}…» (имя в тексте пункта, без склонения). Один пункт, если имена совпадают или одно пустое | база — текущая; игрок — точное имя из записи; цвет — Оба | +| **Экран партии**: меню ☰ нижней панели и правая кнопка по названию партии в шапке | подменю «Подготовиться к сопернику ▸» с двумя пунктами-именами; по правой кнопке на названии — те же два пункта сразу | база — база партии (`source`); у партии без базы (вставлена, новая) — база не выбрана, диалог просит выбрать; игрок — точное имя; цвет — Оба | + +Клавиша в библиотеке: `Ctrl+Shift+P` — то же, что кнопка панели (с игроком из фильтра, если выбран; иначе пустой диалог). На экране партии клавиши нет. + +Почему не кнопка в шапке таблицы и не карточка на полке: вход всегда начинается с человека — имя либо уже в фильтре, либо в строке партии, либо в шапке партии. Отдельная кнопка «без имени» заставила бы искать игрока второй раз. + +### 2.2. Диалог «Подготовка к сопернику» + +Модальное окно 520 × по содержимому (как диалог анализа, `egui::Modal`). + +``` +┌ Подготовка к сопернику ────────────────────────────────────────┐ +│ База [Гран-при РШШ · 33 640 ▾] │ +│ Игрок [вафин ] × │ +│ ☑ Вафин Радель 271 партия │ +│ ☐ Vafin, Radel 6 партий │ +│ Похожие имена — скорее всего, другие люди │ +│ ☐ Вафина Раяна 10 партий │ +│ Отмечено: Вафин Радель, Vafin, Radel · 277 партий │ +│ │ +│ Цвет (•) Оба ( ) Белые — 138 ( ) Чёрные — 133 + 6 │ +│ Книга [Mega Database 2026 · 11,7 млн ▾] │ +│ По книге видно, где он уходит из теории. «Нет» — без │ +│ этой колонки. │ +│ [Отмена] [▌Открыть отчёт▐]│ +└────────────────────────────────────────────────────────────────┘ +``` + +- **База** — список баз полки (имя · число партий), как «База» в Справочнике; по умолчанию та, откуда пришли. Смена базы перезапрашивает кандидатов. База, которая ещё не открыта, открывается тут же со спиннером в строке («Открываю базу…»). +- **Игрок** — поле с тем же механизмом, что «Игрок» панели фильтров (`suggest_players`, слова без учёта регистра и порядка; точки в инициалах убираются — правка `words()`, `opponent-prep-tech.md` §2.2). Но список кандидатов **не выпадающий, а постоянный** под полем, с флажками: до 8 строк, дальше прокрутка. Первая строка отмечена сама, если совпадение по всем словам ровно одно; иначе ничего не отмечено, кнопка «Открыть отчёт» неактивна с подсказкой «Отметьте игрока». +- **Похожие имена** — отдельная группа под слабым заголовком «Похожие имена — скорее всего, другие люди»: имена, которые совпадают по началу слова, но не по слову целиком («Вафин» ⊂ «Вафина»), или отличаются одной буквой. Никогда не отмечаются сами. Автоматической склейки нет (решение исследования §5.7). +- **Объединение написаний** — просто несколько флажков. Строка «Отмечено: … · N партий» показывает сумму. Выбор запоминается на базу и имя (в данных программы, как просмотренные партии): в следующий раз те же флажки стоят сами. +- **Цвет** — радио «Оба / Белые — N / Чёрные — N» с числом партий; по умолчанию из входа (§2.1). Это начальное положение переключателя отчёта, его меняют в отчёте в любой момент. +- **Книга** — список баз полки, кроме выбранной базы, плюс первая строка «Нет» и последняя «Эта же база (сверстники)»; по умолчанию самая большая по размеру файла (как в Справочнике, `reference.rs` «largest one on the shelf»), выбор запоминается. Подсказка: «Книга — большая база, по которой видно, до какого хода его линия обычна и где он играет редкий ход. Редкий ход — не ошибка». +- Enter — «Открыть отчёт», Esc — отмена. Фокус при открытии: в поле «Игрок», если игрок не задан; иначе на «Открыть отчёт». + +Диалог показывается всегда, даже когда всё известно: в нём видно число партий по цветам и похожие имена — то, из-за чего отчёты врут. Это один Enter. + +### 2.3. Что происходит после «Открыть отчёт» + +Экран отчёта открывается сразу. Сбор (линии, дерево, имена, книга) — в фоне (`Background::spawn`): для сотен партий заканчивается до первого кадра; для фильтра по Mega — секунды с прогрессом «Собираю партии… 37 %» на месте дерева. Сверка с книгой — отдельный шаг с прогрессом в колонке «Книга» («…»), дерево уже видно. + +### 2.4. Условия из библиотеки + +Если при входе из панели фильтров были активны другие фильтры (годы, Эло соперников, турнир), отчёт строится **по отфильтрованной выборке**, и это видно в шапке отчёта чипами без `×`: «Годы: 2025–2026 · Эло ≥ 1700». Так тренер получает «последний год» и «против сильных» без новых элементов управления в отчёте. Убрать условие — вернуться в библиотеку и снять фильтр. Вход из строки партии и из шапки партии — всегда все партии игрока. (Вопрос 11.1.) + +## 3. Экран отчёта + +### 3.1. Где живёт + +| Вариант | За | Против | +|---|---|---| +| **А. Отдельный экран на всё окно, как экран партии** (шапка «⬅ Библиотека», стек возврата) | место для доски + дерева в 6 колонок + списка партий; партия из отчёта открывается поверх со стеком «⬅ К подготовке» — механизм уже есть (`previous`, `reference.md`); состояние библиотеки не трогается | ещё один тип экрана (третий после библиотеки и партии) | +| Б. Третий сегмент в библиотеке `[Фильтры │ Доска │ Подготовка]` | рядом с фильтром игрока, нулевой переход | правая часть — 260–480 точек: дерево с колонками не помещается; таблица партий библиотеки показывает все партии базы, а отчёту нужен свой список по узлу; в узком окне (< 880) панель и так идёт по очереди с таблицей | +| В. Вкладка в правой панели экрана партии, как «Справочник» | та же механика «таблица ходов + партии» | отчёт — не про текущую партию, а про игрока; открывать пустую партию, чтобы посмотреть отчёт, странно; панель 370–700 тесна для дерева + дебютов + ошибок | +| Г. Отдельное окно ОС | можно держать рядом с партией | в проекте одно окно; viewport-ы egui тянут за собой отдельные настройки, фокус, тайлинг; на ноутбуке второе окно некуда ставить | + +**Рекомендация — А.** Шапка — как у партии: «⬅ Библиотека», название, справа «⚙ Настройки». `Ctrl+W` — назад в библиотеку, к той же базе и фильтрам. Отчёт живёт, пока его не закрыли; повторный вход для того же игрока (та же база, те же написания) возвращает его как был (вкладка, узел, прокрутка, результаты движка). + +### 3.2. Компоновка, 1400 × 1000 + +``` +⬅ Библиотека │ Подготовка к сопернику: Вафин Радель · 271 партия · 01.2026 – 10.2026 · Гран-при РШШ ⚙ Настройки +[ Белые │ Чёрные │▐ Оба ▌] Книга [Mega Database 2026 · 11,7 млн ▾] Дебют: 10 ходов ▾ [▶ Найти ошибки в дебютах ≈ 1 мин] +Белыми 138 · 77 % (+103 =8 −27) · соперники ≈ 1612 · последняя 18.10.2026 · из книги выходит на 6-м ходу, первым — в 61 % партий +Чёрными 133 · 58 % (+70 =14 −49) · соперники ≈ 1655 · последняя 18.10.2026 · из книги выходит на 7-м ходу, первым — в 48 % партий +──────────────────────────────────┬───────────────────────────────────────────────────────────────────── + ○ Ход чёрных · после 3.Bb5 │ [▐Репертуар▌] Дебюты Ошибки Ветви от [3 ▾] партий · Раскрыть всё +┌────────────────────────────┐ │ Ход Дебют Партий % Счёт Последняя Книга +│ │ │ ▾ Белыми 138 77 % ▕███▒░▏ 18.10.2026 +│ │ │ ▾ 1.e4 136 99 77 % 18.10.2026 2 971 304 +│ │ │ ▾ 1…c5 Sicilian Defense · B20 50 37 70 % 18.10.2026 890 112 +│ доска 380 │ │ ▾ 2.Nf3 33 66 73 % 12.10.2026 512 004 +│ │ │ ▾ 2…Nc6 16 48 69 % 12.10.2026 201 330 +│ │ │ ▌3.Bb5 Sicilian Defense: Nyezhmetdinov-Ros… · B30 14 88 71 % 12.10.2026 88 410 +│ │ │ ▸ 3…g6 9 64 67 % 12.10.2026 41 002 +│ │ │ ▸ 3…e6 4 29 75 % 03.09.2026 22 118 +└────────────────────────────┘ │ ▸ другие ходы (1) 1 + 1.e4 c5 2.Nf3 Nc6 3.Bb5 │ ▸ 2…d6 12 36 75 % 05.10.2026 390 877 + Sicilian Defense: Nyezhmetdinov- │ ▸ 2.Nc3 17 34 65 % 18.10.2026 60 215 + Rossolimo Attack · B30 │ ▸ 1…e6 French Defense · C00 21 15 81 % 18.10.2026 1 102 440 + [Открыть как партию] [⋯] │ ▸ 1…c6 Caro-Kann Defense · B10 18 13 83 % 27.09.2026 905 731 + ├───────────────────────────────────────────────────────────────────── + │ Партии · после 3.Bb5 · 14 ✕ + │ Белые Эло Чёрные Эло Рез. Дата Дальше Турнир + │ Вафин Радель 1887 Ширшов С. 1802 1-0 12.10.2026 3…g6 4.O-O Bg7 Блиц 12, до 13 + │ Вафин Радель 1860 Гадисов М. 1744 ½-½ 03.09.2026 3…e6 4.O-O Nge7 Рапид 9, до 13 +``` + +Высоты: шапка 36; строка переключателей 32; сводка 2 строки по 20 (при «Белые» или «Чёрные» — одна строка выбранного цвета, вторая слабым); разделитель. Левая колонка — доска `min(H_панели − 120, 420)`, не меньше `BOARD_MIN` 220, ширина колонки = доска + 24; правая — остальное, не уже 560. Правая колонка делится по вертикали: вкладки сверху, список партий снизу, граница перетаскивается (по умолчанию список — 35 %, не меньше 4 строк). + +### 3.3. Шапка + +- Название: «Подготовка к сопернику: {name}» (`Preparing against {name}`); при нескольких написаниях — первое отмеченное и «+1 написание» (`+1 spelling`) с подсказкой-списком. Дальше слабым: число партий, период «MM.YYYY – MM.YYYY» (по датам партий; без дат — пусто), имя базы; чипы условий из библиотеки (§2.4). Сокращение в узком окне — как у шапки партии (`narrow-windows.md` §3.4): «⬅ Библиотека» и имя видны всегда, остальное с «…». +- «⚙ Настройки» — общие настройки программы, как везде. + +### 3.4. Строка переключателей + +- **Цвет** — сегментный переключатель `[Белые │ Чёрные │ Оба]` (`White · Black · Both`), как `[Фильтры │ Доска]`. Действует на дерево (какие корни показаны), таблицу дебютов, вкладку «Ошибки», список партий и на область движка. Сводка показывает оба цвета всегда (строка другого цвета слабым). +- **Книга** — выпадающий список как в Справочнике (`reference.rs:927`): «Нет», базы полки, «Эта же база». Смена — пересчёт колонки «Книга» в фоне. +- **Дебют: 10 ходов ▾** — глубина дерева и анализа: 6 / 10 / 15 ходов (12 / 20 / 30 полуходов, по умолчанию 20 — `opponent-prep-tech.md` §3.1). Смена перестраивает дерево (мгновенно) и меняет число позиций для движка. +- **Кнопка движка** — §4. Во время работы на её месте полоса прогресса; после — строка состояния. + +### 3.5. Сводка + +Две строки, по одной на цвет: «Белыми 138 · 77 % (+103 =8 −27) · соперники ≈ 1612 · последняя 18.10.2026 · из книги выходит на 6-м ходу, первым — в 61 % партий». Счёт — очки игрока в процентах; +/=/− — с его точки зрения. «Из книги…» — только при выбранной книге: медиана номера хода, на котором его партия впервые попала в позицию, встречающуюся в книге меньше 5 раз; «первым» — доля партий, где из книги вышел он, а не соперник. После движка добавляется третья строка на цвет: «Ошибок в дебюте: неточностей 14 · ошибок 11 · зевков 5 — в 24 партиях (17 %)» (числа цветом отметок, §8). + +### 3.6. Вкладка «Репертуар» — дерево + +Та же таблица, что таблица ходов Справочника (полосатые строки, обычный шрифт), но с отступами дерева. + +| Колонка | Что | Ширина | +|---|---|---| +| Ход | `▾`/`▸` + отступ 14 на уровень + SAN с номером («3.Bb5», «2…Nc6»); ход игрока — обычным, ход соперника — слабым; ⤳ после хода — к позиции приходили и другим порядком (подсказка — порядки) | гибкая, ≥ 180 | +| Дебют | имя по таблице у **первого** узла, где оно появилось (глубже — пусто, чтобы не повторять); «Family: Variation» + слабым ECO; сокращается с «…», полное — в подсказке | гибкая, ≥ 160, прячется второй | +| Партий | число партий игрока через эту позицию | 56 | +| % | доля от родителя | 40 | +| Счёт | очки игрока в процентах + полоса Б/Н/Ч 60 (как на доске поиска; подсказка «+10 =1 −3») | 110 | +| Последняя | дата последней партии (дд.мм.гггг; без дат — год или «—») | 84 | +| Книга | число партий книги в этой позиции (разделители тысяч, слабым); первое в линии значение < 5 — цветом предупреждения, подсказка «Здесь он выходит из книги: в «Mega» такая позиция встречается 2 раза»; «…» пока считается; нет книги — колонки нет | 80 | +| (после движка) | у хода игрока — значок отметки `?!`/`?`/`??` (пилюля как в нотации) сразу после SAN в колонке «Ход» и в подсказке «Ошибка: лучше 6…e6 (оценка 0,0 → −1,2) · в 3 партиях» | — | + +- **Корни** — «Белыми · 138» и «Чёрными · 133» (`As White`, `As Black`); при переключателе «Белые» виден один корень, раскрытый. Чередование уровней: под корнем «Белыми» первый уровень — его ходы, второй — ответы соперников, и так далее. +- **Раскрытие по умолчанию**: до узлов с ≥ 5 партиями включительно, но не глубже 6 полуходов; остальное свёрнуто. «Раскрыть всё» / «Свернуть» — ссылки в строке над таблицей (действуют на выбранный узел, без выбора — на корни). +- **Ветви от N партий** — выпадающий 2 / 3 / 5 (по умолчанию 3; «грубая → тонкая» детализация ChessBase). Дети с меньшим числом партий сворачиваются в одну строку «другие ходы (N)» (`other moves (N)`) в конце списка детей; раскрывается как узел и показывает их. +- **Выделение** — одна строка (полоса ▌ слева, как в таблицах библиотеки). Выбранный узел = позиция на доске + заголовок списка партий «Партии · после 3.Bb5 · 14». Щелчок по уже выбранному — ничего (не снимает). Щелчок по `▾/▸` — раскрыть/свернуть без смены выделения. Двойной щелчок — раскрыть/свернуть. +- **Мало партий**: в узлах с < 5 партиями «%», «Счёт» и полоса — слабым цветом, подсказка «Мало партий — проценты ненадёжны» (`Few games: percentages are unreliable`). +- **Переходы**: узел — по порядку ходов, статистика — по позиции (как рекомендует разработчик, §3.1 техчасти): два узла с одной позицией показывают одинаковые числа и ⤳; подсказка перечисляет порядки. +- Высота — вся вкладка, прокрутка; выбранный узел прокручивается в видимую область при навигации с клавиатуры. + +### 3.7. Вкладка «Дебюты» — таблица + +``` + Дебют Первые ходы Партий % Счёт Последняя Ошибок + ▾ Sicilian Defense B20–B99 1.e4 c5 50 37 70 % ▕██▒░▏ 18.10.2026 3 ? · 1 ?? + Nyezhmetdinov-Rossolimo Attack B30 1.e4 c5 2.Nf3 Nc6 3.Bb5 14 28 71 % 12.10.2026 1 ? + Grand Prix Attack B23 1.e4 c5 2.Nc3 Nc6 3.f4 11 22 64 % 18.10.2026 2 ? · 1 ?? + Open Sicilian B32–B99 1.e4 c5 2.Nf3 … 3.d4 19 38 74 % 05.10.2026 + без названия глубже 6 12 67 % 21.08.2026 + ▸ French Defense C00–C19 1.e4 e6 21 15 81 % 18.10.2026 2 ?! + ▸ Caro-Kann Defense B10–B19 1.e4 c6 18 13 83 % 27.09.2026 +``` + +- Две ступени: **семейство** (часть имени до двоеточия) → **варианты** (самое глубокое имя линии). Партия считается в одном варианте. Варианты без имени глубже семейства — строка «без названия глубже» (`no deeper name`). +- Колонки: Дебют (имя, у варианта — без повторения семейства), ECO слабым (у семейства — диапазон), Первые ходы (линия до именованной позиции, слабым, сокращается с «…» посередине — первые и последние ходы важнее середины), Партий, % (семейство — от цвета, вариант — от семейства), Счёт с полосой, Последняя, Ошибок (после движка: счётчики цветом отметок; пусто = ошибок нет; «…» пока считается). +- При переключателе «Оба» — колонка «Цвет» первой (`♙`/`♟` + «белыми / чёрными»), и семейства одного имени за разные цвета — разные строки. Сортировка по умолчанию — по числу партий; заголовки сортируют (Счёт, Последняя, Ошибок). +- Щелчок по строке — доска показывает именованную позицию, список партий — партии дебюта/варианта («Партии · French Defense · 21»). Двойной щелчок по семейству — раскрыть. Ссылка в подсказке строки «показать в дереве» — вопрос 11.6; в первой версии нет. + +### 3.8. Вкладка «Ошибки» + +До движка — приглашение (§5). После: + +``` + Stockfish 19 · Быстро · 1 306 позиций · 28.10.2026 14:02 [Точнее…] [Доразобрать] + Чёрными: неточностей 14 · ошибок 11 · зевков 5 — в 24 партиях из 133 (18 %) + + Повторяющиеся ошибки — одна и та же позиция, тот же ход + Позиция Сыграл Лучше × Счёт Дебют + ▸ после 6.Bc4, ход чёрных 6…Nb6 ? 6…e6 3 +1 −2 Sicilian Defense: Grand Prix Attack · B23 + ▸ после 4…Nf6, ход белых 5.e5 ?? 5.Nc3 2 +0 −2 Caro-Kann Defense: Advance Variation · B12 + ▸ после 7.Qd2, ход чёрных 7…O-O ?! 7…Nxd4 2 +1 −1 Sicilian Defense: Open · B56 + + По дебютам + ▾ Sicilian Defense: Grand Prix Attack · B23 11 партий · 2 ? · 1 ?? + 6…Nb6 ? лучше 6…e6 Кузнецов — Вафин 0-1 18.10.2026 + 6…Nb6 ? лучше 6…e6 Ширшов — Вафин 1-0 12.10.2026 + 9…f5 ?? лучше 9…Be7 Гадисов — Вафин 1-0 03.09.2026 + ▸ Sicilian Defense: Nyezhmetdinov-Rossolimo Attack · B30 14 партий · 1 ? + ▸ French Defense · C00 21 партий · 2 ?! +``` + +- **Повторяющиеся** — узлы дерева с отметкой и ≥ 2 партиями; порядок: по числу партий, затем по тяжести. Раскрытие строки показывает партии (как в «По дебютам»). «Счёт» — результат игрока в этих партиях. +- **По дебютам** — по вариантам (самое глубокое имя), внутри — ошибки по партиям: ход с отметкой, «лучше …» (первый ход лучшей линии, подсказка — линия и оценки), партия «Белые — Чёрные», результат, дата. Сортировка семейств — по числу ошибок с весом (?? = 3, ? = 2, ?! = 1), чтобы наверху было самое больное. Неточности показываются, но считаются слабее; выключатель «показывать неточности» — вопрос 11.4. +- **Щелчок** по строке ошибки — доска показывает позицию **до** хода, стрелки: сыгранный ход цветом отметки, лучший — зелёный (как стрелка лучшего хода на экране партии); под доской линия до позиции и строка «6…Nb6 ? — лучше 6…e6 · 0,0 → −1,2». **Enter / двойной щелчок** — партия на этом ходу (у повторяющейся — первая по дате, раскрытие даёт выбрать). +- Ошибки, попавшие за пределы глубины дебюта (строка «Дебют: 10 ходов»), не ищутся — текст в приглашении говорит об этом. +- Если выбран «Оба» — два блока сводки (по цвету) и колонка «Цвет» в списках. + +### 3.9. Доска + +- Виджет `board.rs`, без ввода ходов (щелчок по фигуре ничего не делает; ввод — через «Открыть как партию»). Ориентация — **по цвету игрока** (его фигуры снизу: смотрим его глазами; «Оба» — по цвету выбранного корня); `F` переворачивает, выбор держится до закрытия отчёта. +- Над доской — индикатор очереди хода и «после 3.Bb5» (как в панели доски поиска). Под доской — линия ходов до узла (поток токенов, щелчок по ходу — доска на этот ход, выделение в дереве не меняется), под ней имя дебюта + ECO для этой позиции (слабым), затем кнопки «Открыть как партию» (`Open as a game`) и `⋯`. +- Меню `⋯`: «Играть отсюда…» (`Play on from here…`, тот же диалог, что на экране партии; цвет по умолчанию — сторона на ходу), «Найти позицию в базе» (`Ctrl+Shift+F`, доска поиска библиотеки с этой линией), «Копировать FEN», «Копировать ходы (PGN)». +- Наведение на строку дерева (не выбранную) — синяя стрелка **следующего хода** на текущей доске, если наведённый узел — ребёнок выбранного; иначе ничего (чужая позиция — чужие стрелки). Наведение на строку списка партий — стрелка хода этой партии из позиции (как в Справочнике). +- Мини-доска 160×160 в подсказке — только в строках «Повторяющиеся ошибки» (позиция до хода с двумя стрелками): быстро пробежать список, не щёлкая. В дереве мини-досок нет — рядом большая. + +### 3.10. Список партий + +Таблица как в Справочнике: Белые · Эло · Чёрные · Эло · Рез. · Дата · Дальше · Турнир; плюс после движка колонка **Ошибки** (`Errors`): отметки его ходов в дебюте этой партии «7.? 12.??» (номер хода + значок цветом; пусто — без ошибок; «…» — ещё считается). Игрок — полужирным в своей колонке. + +- Заголовок: «Партии · 271» без выбора; с узлом — «Партии · после 3.Bb5 · 14 ✕»; с дебютом — «Партии · French Defense · 21 ✕»; с ошибкой — «Партии · 6…Nb6 ? · 3 ✕». `✕` снимает выбор (все партии цвета). При переключателе «Оба» — все партии игрока. +- Сортировка по умолчанию — новые сверху; заголовки сортируют. +- **Двойной щелчок / Enter** — партия в обычном экране **на ходе выбранного узла** (у ошибки — на ходе с ошибкой; без узла — на первом ходе). В шапке партии «⬅ К подготовке» (`⬅ Back to preparation`), `Ctrl+W` возвращает к отчёту как был. Отчёт остаётся в стеке так же, как партия из Справочника (`reference.md`, «Открытая из списка партия не закрывает текущую»). +- Открытая партия — обычная: анализ партии `Shift+A`, живой движок, комментарии. Отметки отчёта в нотацию не переносятся (разные кэши; вопрос 11.5). +- В узкой таблице колонки прячутся по очереди: Турнир, Дальше, Дата → Год, Эло (в ячейку имени слабым) — как в `board-search.md` §2.7. + +## 4. Движок: «Найти ошибки в дебютах» + +### 4.1. Кнопка и диалог — а не автозапуск + +| | Сразу в фоне при открытии | **По кнопке с диалогом** | +|---|---|---| +| За | ноль действий; для 271 партии «Быстро» — меньше минуты на ПК | видно, что́ и за сколько; выбор цвета режет время вдвое; на ноутбуке с 4 потоками 5 000 партий «Быстро» — полчаса, автозапуск тут недопустим; это то же правило, что у анализа партии (кнопка, не само) | +| Против | движок занимает ядра, пока тренер только смотрит репертуар; на Mega-фильтре может быть часы; нет момента, когда пользователь выбрал качество и потоки | одно лишнее нажатие | + +**Рекомендация — кнопка с диалогом**, и ровно та же механика, что у анализа партии (`review.rs:706`): первый раз — диалог; после первого запуска из диалога кнопка стартует сразу с теми же параметрами, диалог — через «▾» рядом с кнопкой («Параметры…»). Оценка времени видна и на кнопке («≈ 1 мин»), и в диалоге. + +### 4.2. Диалог + +``` +┌ Ошибки в дебютах ───────────────────────────────────────────┐ +│ Движок оценит первые 10 ходов каждой партии соперника. │ +│ Партии не меняются. │ +│ Движок [Stockfish 19 ▾] │ +│ Цвет (•) Чёрные — 133 партии ( ) Оба — 271 │ +│ Качество [●────────] Быстро · 250 000 узлов │ +│ Потоки [─────●───] 12 / 24 │ +│ Память [──●──────] 256 МБ │ +│ 1 306 позиций, около 30 с · одинаковые позиции считаются │ +│ один раз; 312 уже оценены раньше │ +│ [Отмена] [▌Найти ошибки▐] │ +└──────────────────────────────────────────────────────────────┘ +``` + +- Движок, Потоки, Память — те же элементы и значения, что в диалоге анализа (`settings.review.threads/hash_mb`); Качество — **своя настройка** `settings.prep.quality`, по умолчанию «Быстро» (0): для отметок ≥ 10 % шанса в дебютных позициях хватает (техчасть §5.2), а «Обычно» в 4 раза дольше. Подсказка у ползунка: «Для поиска ошибок в дебюте обычно достаточно «Быстро». «Обычно» — для взрослых баз, в 4 раза дольше». +- Цвет — по переключателю отчёта; «Оба» — если переключатель «Оба». Выбор здесь переключает и отчёт. +- Оценка: `позиции_без_кэша × узлы / (nps_на_поток × потоки)`, `nps_на_поток` — замеренная (`note_live_speed`, как в `review.rs`), до замера 700 000. Позиции — дедуплицированные, минус уже оценённые в кэше (строка «312 уже оценены раньше» — только если > 0). Второй поиск для !!/! не делается — не считается. +- Нет движка — как в анализе партии: «Сначала добавьте движок» и предложение скачать Stockfish (`engine-download.md`). +- Enter — «Найти ошибки», Esc — отмена. + +### 4.3. Во время работы + +Строка переключателей: вместо кнопки — `Ищу ошибки: 812 из 1 306 позиций · ≈ 20 с ▕████▒▒▒▒▏ [Остановить]`. + +- Отметки появляются **по мере оценки** в дереве, таблице дебютов, списке партий и на вкладке «Ошибки» (строка «Повторяющиеся» пересортировывается не чаще раза в секунду; пока курсор над списком — не пересортировывается, как продолжения на доске поиска). +- Порядок оценки — **по дереву в ширину**: сначала частые позиции, поэтому повторяющиеся ошибки видны первыми. +- «Остановить» сохраняет сделанное; строка становится «Проверено 812 из 1 306 позиций · [Продолжить ≈ 12 с]»; частичные счётчики помечены «из проверенных» в подсказке. +- Один процесс движка на всю программу: пока идёт поиск ошибок, «Анализ партии» в открытой из отчёта партии неактивен с подсказкой «Идёт поиск ошибок в дебютах — дождитесь или остановите его в отчёте»; живой анализ (`L`) там ставится на паузу, как при анализе партии (`decisions.md` п. 9). И наоборот: кнопка отчёта неактивна, пока идёт анализ партии. +- Уход с экрана отчёта («⬅ Библиотека») работу **не прерывает**: отчёт в стеке, в библиотеке у карточки базы — ничего (без лишних индикаторов); при возврате в отчёт — прогресс или результат. Выход из программы — вопрос «Идёт поиск ошибок в дебютах. Выйти и остановить?» (сделанное сохранено в кэше). +- Сбой движка — строка красным с «Подробности» и кнопка «Повторить», как у анализа партии. + +### 4.4. После + +Строка: `Ошибки найдены · Stockfish 19 · Быстро · 1 306 позиций · 28.10.2026 [Точнее…] [▾]`. «Точнее…» открывает диалог с качеством «Обычно» (пересчёт только позиций с меньшим качеством). Если дерево изменилось (новые партии в базе, другая глубина, другой цвет) — кнопка «Доразобрать N позиций ≈ …». Кэш по позиции — `~/.cache/chesspenguin/prep/` (техчасть §7.3); второй отчёт по тому же игроку — без движка. + +## 5. Состояния + +| Состояние | Что видно | +|---|---| +| **Партий мало** (< 10 выбранным цветом) | под сводкой строка предупреждения: «Партий мало (7) — проценты и счёт ненадёжны» (`Few games (7): percentages and scores are unreliable`); проценты в узлах с < 5 партиями слабым (§3.6) | +| **Нет партий выбранным цветом** | дерево/таблица: по центру «Чёрными партий нет. Белыми — 138 · [Показать белые]» (`No games as Black. As White — 138 · Show White`); корень «Чёрными · 0» в режиме «Оба» показывается слабым без раскрытия | +| **Нет партий вовсе** (условия библиотеки отсекли всё) | «Партий по условиям нет: {чипы}. [Открыть без условий]» | +| **Сбор идёт** (Mega-фильтр) | на месте дерева «Собираю партии… 37 %» с полосой и «Отмена» (возвращает в библиотеку); шапка уже показывает имя | +| **Книга считается** | колонка «Книга» — «…» в строках, заголовок колонки с процентом «Книга 42 %»; сводка без «из книги…» до конца | +| **Книга не выбрана** | колонки «Книга» нет, в сводке нет «из книги…», в строке переключателей «Книга [Нет ▾]»; подсказка списка объясняет пользу | +| **Книга = эта же база** | колонка называется «В базе» (`In database`), партии самого игрока не считаются (как «сама партия и её копии» в Справочнике) | +| **Книга не открылась** | «Книга: не открылась — {причина}» в строке переключателей, колонки нет, без повторов | +| **Движок не запускался** | вкладка «Ошибки»: по центру «Движок ещё не искал ошибки. Он проверит первые 10 ходов 133 партий чёрными — 1 306 позиций, около 30 с.» и главная кнопка «▶ Найти ошибки в дебютах»; на вкладках «Репертуар»/«Дебюты» колонок ошибок нет (ничего не прячется — их просто ещё нет) | +| **Движок считает** | полоса прогресса в строке переключателей; отметки появляются; на вкладке «Ошибки» — списки растут, сверху «Проверено 812 из 1 306 · ≈ 20 с» | +| **Остановлено** | «Проверено 812 из 1 306 позиций · [Продолжить]»; частичные счётчики с подсказкой «из проверенных позиций» | +| **Готово** | строка состояния §4.4 | +| **Готово, ошибок нет** | вкладка «Ошибки»: «В первых 10 ходах ошибок не нашлось (неточностей 3). [Глубже: 15 ходов] [Точнее…]» | +| **Нет движка** | кнопка активна, диалог предлагает скачать Stockfish (`engine-download.md`) | +| **База изменилась** (дописана, файл заменён) | как в библиотеке — отчёт пересобирается при возврате; оценки из кэша; строка «Доразобрать N позиций» | +| **Игрок — несколько написаний** | «+1 написание» в шапке с подсказкой; в списке партий имя — как в записи | +| **Партии без дат** | «Последняя» — «—», период в шапке пропущен | +| **Партия с FEN или Chess960** | не входит в дерево; в подсказке счётчика шапки «не учтены: с заданной позиции — 2» | + +## 6. Узкие и низкие окна + +Правило `narrow-windows.md` §0: компоновку выбирает размер окна. `W`, `H` — под шапкой отчёта. + +- **Рядом** (как в §3.2), когда `W ≥ BOARD_MIN(220) + 24 + 560` = **804** и `H ≥ 600`: доска `min(H − 120, 420, W − 584)`, но не меньше 220; правая колонка — остальное. +- **Стопка** (`W < 804` или `H < 600`): верхний блок — доска 240 слева, справа от неё линия ходов, имя дебюта и кнопки (вертикально); под ним вкладки и список партий. При `H < 720` доска в стопке скрыта по умолчанию: в строке переключателей кнопка «♙ Доска» (`Board`) открывает её поверх правой нижней части как выдвижную панель 264 × 300 (с тенью, как фильтры в узком окне), закрытие — та же кнопка, `Esc` или щелчок вне. Так при 640 × 480 дереву остаётся ≈ 300 точек высоты — 12 строк. + +``` +640 × 1000 (стопка) 640 × 480 (доска скрыта) +⬅ Библиотека │ Вафин Радель · 271 · … ⚙ ⬅ Библиотека │ Вафин Радель… ⚙ +[Белые│Чёрные│Оба] Книга [Mega ▾] [▶ Ошибки ≈1м] [Белые│Чёрные│Оба] [Mega ▾] [♙] [▶ ≈1м] +Чёрными 133 · 58 % · из книги на 7-м ходу Чёрными 133 · 58 % +┌──────────┐ ○ Ход белых · после 2…Nf6 [Репертуар] Дебюты Ошибки +│ │ 1.e4 c5 2.c3 Nf6 Ход Партий % Счёт +│ доска 240│ Sicilian Defense: Alapin · B22 ▾ Чёрными 133 58 % +│ │ [Открыть как партию] [⋯] ▾ 1.e4 79 59 60 % +└──────────┘ ▾ 1…c5 79 100 60 % +[Репертуар] Дебюты Ошибки ▸ 2.Nf3 39 49 63 % +Ход Дебют Партий % Счёт ▌2.c3 17 22 53 % +▾ Чёрными 133 58 % ────────────────────────────── + ▾ 1.e4 79 59 60 % Партии · после 2.c3 · 17 ✕ + ▾ 1…c5 Sicilian · B20 79 100 60 % Белые Чёрные Рез. Год +``` + +- **Строка переключателей** при нехватке: «Найти ошибки в дебютах ≈ 1 мин» → «▶ Ошибки ≈ 1 мин» → «▶» с подсказкой; «Дебют: 10 ходов» → «10 х.» → в «⋯»; «Книга [имя]» — имя сокращается до 80, затем значок «📖 ▾». Переключатель цвета — всегда целиком. +- **Сводка** — при `W < 804` одна строка выбранного цвета (у «Оба» — две), без «соперники ≈» и «последняя» (они в подсказке строки). +- **Колонки дерева** прячутся по очереди: Книга → Последняя → полоса счёта (остаётся %) → Дебют (имя переезжает в подсказку хода). Никогда: Ход, Партий, %, Счёт-процент. Таблица дебютов: Первые ходы → Последняя → ECO → полоса. Вкладка «Ошибки»: Дебют → Счёт. +- **Диалоги** (§2.2, §4.2) при 640 × 480 — тело прокручивается, кнопки вне прокрутки (как `play-mode.md` §2.5). + +## 7. Клавиатура + +Правило как на доске поиска: клавиши без модификаторов действуют, когда фокус не в текстовом поле. Фокус один из двух: дерево/таблица вкладки или список партий; `Tab` переключает между ними, видимый фокус — полоса ▌ у выделенной строки ярче. + +| Клавиша | Действие | +|---|---| +| `↑` / `↓`, `PgUp` / `PgDn`, `Home` / `End` | строка в текущей таблице | +| `→` | дерево: раскрыть узел; раскрыт — к первому ребёнку. Таблица дебютов: раскрыть семейство | +| `←` | дерево: свернуть; свёрнут — к родителю | +| `Space` | раскрыть/свернуть без перемещения | +| `Enter` | в дереве/дебютах — фокус в список партий (первая строка); в списке партий и во вкладке «Ошибки» — открыть партию на ходе | +| `Ctrl+1` / `Ctrl+2` / `Ctrl+3` | вкладки Репертуар / Дебюты / Ошибки | +| `Ctrl+W` / `Ctrl+B` | цвет Белые / Чёрные (`Ctrl+W` здесь не «закрыть»: закрытие отчёта — «⬅ Библиотека» или `Esc` без выделения) — **вопрос 11.7**; запасной вариант: `Alt+1/2/3` для Белые/Чёрные/Оба | +| `F` | перевернуть доску | +| `Shift+A` | «Найти ошибки в дебютах» (та же клавиша, что «Анализ партии» — то же действие «позвать движок»); во время работы — «Остановить» | +| `Ctrl+Shift+F` | найти позицию доски в базе (доска поиска библиотеки) | +| `Esc` | закрыть меню/подсказку → снять выбор узла (список — все партии) → назад в библиотеку | +| `Ctrl+Shift+P` (библиотека) | «Подготовиться к…» с игроком из фильтра | + +Все действия, кроме стрелок наведения, доступны с клавиатуры; чтение экрана — у отметок текстовые подсказки с названием («Ошибка», «Зевок»). + +## 8. Цвета и значки + +Отметки — как в нотации и в отчёте анализа (`notation::assessment_color` / `assessment_text_color`, `review::judgement_color`): + +| Отметка | NAG | Заливка значка | Текст на светлом | Где | +|---|---|---|---|---| +| `?!` неточность | 6 | `#56b4e9` | `#1f72a8` | значок-пилюля после SAN (дерево, «Сыграл», колонка «Ошибки» списка партий); счётчики текстом | +| `?` ошибка | 2 | `#ffa459` | `#c25700` | то же | +| `??` зевок | 4 | `#fa412d` | `#d2301c` | то же | + +- Значок — пилюля с белым символом, как `move_glyph` в нотации; в счётчиках («3 ? · 1 ??») — текст цветом `assessment_text_color` по теме; `!!`/`!` здесь не ищутся и не показываются. +- Стрелки на доске: сыгранный ход — цвет его отметки (полупрозрачный), лучший — зелёный стрелки движка; наведение — синий полупрозрачный, как на доске поиска. +- Полоса счёта — светлотой (Б светлый, ничьи серый, Ч тёмный) с процентами внутри и подсказкой, без красного/зелёного (`board-search.md` §4.10). Счёт — всегда очки **игрока**, независимо от цвета; подпись колонки «Счёт», подсказка «Очки соперника в этих партиях». +- «Выход из книги» — число цветом `warn_fg_color`, без отдельного значка; «мало партий» — слабый текст. Ни одно состояние не передаётся только цветом: у всех есть число, символ или подсказка. + +## 9. Тексты (ключ EN → RU) + +| EN (ключ) | RU | +|---|---| +| `♟ Prepare against {name}…` | ♟ Подготовиться к {name}… | +| `♟ Prepare against an opponent…` | ♟ Подготовиться к сопернику… | +| `Prepare against ▸` | Подготовиться к сопернику ▸ | +| `Preparing against an opponent` (диалог) | Подготовка к сопернику | +| `Preparing against {name}` (шапка) | Подготовка к сопернику: {name} | +| `Database` (есть) | База | +| `Player` (есть) | Игрок | +| `Similar names — most likely other people` | Похожие имена — скорее всего, другие люди | +| `Selected: {names} · {n}` | Отмечено: {names} · {n} | +| `Tick a player` | Отметьте игрока | +| `+{n} spelling` / `+{n} spellings` | +{n} написание / +{n} написания (`i18n` склонение) | +| `Colour` | Цвет | +| `Both` · `White` · `Black` | Оба · Белые · Чёрные | +| `White — {n}` · `Black — {n}` | Белые — {n} · Чёрные — {n} | +| `As White` · `As Black` (корни дерева) | Белыми · Чёрными | +| `Book` | Книга | +| `None` | Нет | +| `This database (peers)` | Эта же база (сверстники) | +| `A book is a large database that shows up to which move his line is common and where he plays a rare move. A rare move is not a mistake.` | Книга — большая база, по которой видно, до какого хода его линия обычна и где он играет редкий ход. Редкий ход — не ошибка. | +| `Open report` | Открыть отчёт | +| `Opening: {n} moves` | Дебют: {n} ходов | +| `Collecting games… {p} %` | Собираю партии… {p} % | +| `{n} games · {score} % ({w}+ {d}= {l}−) · opponents ≈ {elo} · last {date}` | {n} · {score} % (+{w} ={d} −{l}) · соперники ≈ {elo} · последняя {date} | +| `leaves the book at move {n}, first in {p} % of games` | из книги выходит на {n}-м ходу, первым — в {p} % партий | +| `Opening errors: {i} inaccuracies · {m} mistakes · {b} blunders — in {g} games ({p} %)` | Ошибок в дебюте: неточностей {i} · ошибок {m} · зевков {b} — в {g} партиях ({p} %) | +| `Few games ({n}): percentages and scores are unreliable` | Партий мало ({n}) — проценты и счёт ненадёжны | +| `Few games: percentages are unreliable` | Мало партий — проценты ненадёжны | +| `Repertoire` · `Openings` · `Errors` | Репертуар · Дебюты · Ошибки | +| `Branches from {n} games` | Ветви от {n} партий | +| `Expand all` · `Collapse` | Раскрыть всё · Свернуть | +| `Move` · `Opening` · `Games` · `%` · `Score` · `Last` · `Book` · `In database` | Ход · Дебют · Партий · % · Счёт · Последняя · Книга · В базе | +| `First moves` · `Errors` · `Played` · `Better` · `Position` · `Colour` | Первые ходы · Ошибок · Сыграл · Лучше · Позиция · Цвет | +| `other moves ({n})` | другие ходы ({n}) | +| `no deeper name` | без названия глубже | +| `Reached by another move order too: {orders}` | К позиции приходили и другим порядком: {orders} | +| `Here he leaves the book: in “{book}” this position occurs {n} times` | Здесь он выходит из книги: в «{book}» такая позиция встречается {n} раз | +| `The opponent's points in these games` | Очки соперника в этих партиях | +| `Games · {n}` · `Games · after {move} · {n}` · `Games · {opening} · {n}` · `Games · {move} · {n}` | Партии · {n} · Партии · после {move} · {n} · Партии · {opening} · {n} · Партии · {move} · {n} | +| `Then` (есть) · `Event` (есть) | Дальше · Турнир | +| `Open as a game` | Открыть как партию | +| `Play on from here…` (есть) · `Find this position in a database (Ctrl+Shift+F)` (есть) · `Copy FEN` · `Copy moves (PGN)` | Играть отсюда… · Найти позицию в базе (Ctrl+Shift+F) · Копировать FEN · Копировать ходы (PGN) | +| `⬅ Back to preparation` | ⬅ К подготовке | +| `▶ Find opening errors` · `▶ Find opening errors ≈ {time}` | ▶ Найти ошибки в дебютах · ▶ Найти ошибки в дебютах ≈ {time} | +| `Options…` | Параметры… | +| `Opening errors` (диалог) | Ошибки в дебютах | +| `The engine evaluates the first {n} moves of every game of the opponent. The games are not changed.` | Движок оценит первые {n} ходов каждой партии соперника. Партии не меняются. | +| `Engine` · `Quality` · `Threads` · `Memory` (есть) | Движок · Качество · Потоки · Память | +| `For opening errors “Fast” is usually enough. “Normal” is for adult databases and takes 4 times longer.` | Для поиска ошибок в дебюте обычно достаточно «Быстро». «Обычно» — для взрослых баз, в 4 раза дольше. | +| `{n} positions, about {time}` (есть) | {n} позиций, около {time} | +| `identical positions are counted once; {n} already evaluated earlier` | одинаковые позиции считаются один раз; {n} уже оценены раньше | +| `Find errors` | Найти ошибки | +| `Finding errors: {done} of {total} positions · ≈ {time}` | Ищу ошибки: {done} из {total} позиций · ≈ {time} | +| `Stop` · `Continue ≈ {time}` | Остановить · Продолжить ≈ {time} | +| `Checked {done} of {total} positions` | Проверено {done} из {total} позиций | +| `of the checked positions` | из проверенных позиций | +| `Errors found · {engine} · {quality} · {n} positions · {date}` | Ошибки найдены · {engine} · {quality} · {n} позиций · {date} | +| `More precisely…` · `Analyse {n} more positions ≈ {time}` | Точнее… · Доразобрать {n} позиций ≈ {time} | +| `Opening errors are being searched — wait or stop it in the report` | Идёт поиск ошибок в дебютах — дождитесь или остановите его в отчёте | +| `A game analysis is running — wait for it to finish` | Идёт анализ партии — дождитесь его конца | +| `Opening errors are being searched. Quit and stop?` | Идёт поиск ошибок в дебютах. Выйти и остановить? | +| `The engine has not searched for errors yet. It will check the first {n} moves of {games} games {colour} — {positions} positions, about {time}.` | Движок ещё не искал ошибки. Он проверит первые {n} ходов {games} партий {colour} — {positions} позиций, около {time}. | +| `No errors in the first {n} moves ({i} inaccuracies).` | В первых {n} ходах ошибок не нашлось (неточностей {i}). | +| `Deeper: {n} moves` | Глубже: {n} ходов | +| `Repeated errors — the same position, the same move` | Повторяющиеся ошибки — одна и та же позиция, тот же ход | +| `By opening` | По дебютам | +| `after {move}, {side} to move` | после {move}, ход {side} (белых/чёрных) | +| `{played} — better {best} · {before} → {after}` | {played} — лучше {best} · {before} → {after} | +| `Mistake: better {best} ({before} → {after}) · in {n} games` | Ошибка: лучше {best} (оценка {before} → {after}) · в {n} партиях | +| `Inaccuracy` · `Mistake` · `Blunder` (есть) | Неточность · Ошибка · Зевок | +| `No games as {colour}. As {other} — {n} · Show {other}` | {colour} партий нет. {other} — {n} · Показать {other} | +| `No games match the conditions: {chips} · Open without conditions` | Партий по условиям нет: {chips} · Открыть без условий | +| `Book: could not open — {reason}` | Книга: не открылась — {reason} | +| `not counted: from a set position — {n}` | не учтены: с заданной позиции — {n} | +| `Board` (кнопка в стопке) | Доска | + +Имена игроков нигде не склоняются («Подготовиться к Вафин Радель…»); числа партий — через `i18n::games`. + +## 10. Что меняет разработчик (сводка для `apps/desktop`) + +1. `large_db.rs` `players_group`: кнопка «♟ Подготовиться к…» под строкой цвета; контекстное меню строки — два пункта; `LibraryAction::PrepareAgainst { path, names, side, filter }`. +2. `game_view.rs`: пункт ☰ «Подготовиться к сопернику ▸» и контекстное меню названия; `GameAction::PrepareAgainst`; «⬅ К подготовке» по тому же `previous`-механизму, что «⬅ К партии». +3. Новый `prep_ui.rs` (диалог §2.2, экран §3, диалог движка §4.2 — общий код с `review.rs::dialog`: вынести сетку «Движок · Качество · Потоки · Память» и `format_duration`); данные — крейт `crates/prep` (`PrepReport`, события движка, кэш). +4. `settings.rs`: `prep.quality` (по умолчанию 0 — «Быстро»), `prep.book` (путь), `prep.plies` (20), `prep.branches_from` (3), `prep.chosen`; запомненные объединения написаний — в данных программы. +5. `app.rs`: экран `Screen::Prep` в стеке между библиотекой и партией; один движковый job на программу (взаимные блокировки кнопок §4.3); вопрос при выходе. +6. Снимки для проверки: 1400×1000 (три вкладки, до/во время/после движка, «Оба»), 960×1050, 804/803×900, 640×1000, 640×480 (доска скрыта/открыта), диалоги при 640×480, состояния §5 (мало партий, нет партий цветом, книга «Нет», книга считается, остановлено). + +## 11. Открытые вопросы + +1. **Условия библиотеки в отчёте** (§2.4): брать активные фильтры (годы, Эло, турнир) как условия отчёта при входе из панели — да (рекомендация) или всегда все партии игрока? +2. **Цвет по умолчанию** — «Оба» при входе из партии/строки и цвет фильтра при входе из панели (рекомендация), или всегда спрашивать? Диалог показывает радио в любом случае. +3. **Качество «Быстро» по умолчанию** отдельной настройкой от анализа партии — утвердить (техчасть, вопрос 4). +4. **Неточности `?!`** во вкладке «Ошибки»: показывать всегда (рекомендация, слабее и ниже) или за выключателем «показывать неточности»? +5. **Отметки отчёта в открытой партии**: показывать оценки дебюта из кэша отчёта как слой в нотации (без анализа партии)? Требует общего кэша по позиции с `game-review` (техчасть, вопрос 5). Рекомендую позже. +6. **«Показать в дереве»** из таблицы дебютов и из «Ошибок» — ссылка, переключающая вкладку и выделяющая узел. Дёшево; добавить в первую версию? +7. **Клавиши цвета**: `Ctrl+W`/`Ctrl+B` занимают «закрыть» — предпочитаю `Alt+1/2/3` или вовсе без клавиш (переключатель всегда на виду). Решить. +8. **Мини-доска в подсказке** строк «Повторяющиеся ошибки» — оставить (рекомендация) или достаточно большой доски по щелчку? +9. **Период** (последний год / всё) как переключатель в отчёте — не делаю (объём «только дебюты», фильтр библиотеки закрывает); подтвердить. +10. **«Играть отсюда…» и «Открыть как партию»** с доски отчёта — в первую версию (рекомендация: это существующие действия) или после? + +## Изменения + +- 2026-10-28: первая версия. From 7d041f2a3df258c0c466f3c3b2b0d7dffd9eea7d Mon Sep 17 00:00:00 2001 From: vrubelroman Date: Wed, 28 Oct 2026 12:29:08 +0300 Subject: [PATCH 3/9] Import and review: what the opponent preparation needs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Name queries: the full stop of an initial separates words too, so "Carlsen, M." and "Вафин Р." find the full names (suggestions and filters alike). - `Database::main_line(index, plies)`: the first moves of a game's main line; a ChessBase game is decoded without its tree (microseconds), a PGN game is parsed. `Database::player_name(id)` for both kinds. - `position::theory_end`: the linear/doubling/halving search for where a line leaves a database, taken out of the reference panel's `book_end` so another caller can use it; the panel calls it. - game-review opens `judge` and `terminal_eval`; `Judgement` is serde. Co-Authored-By: Claude Fable 5.1 --- apps/desktop/src/reference.rs | 66 ++----------- crates/chess-import/src/chessbase/base.rs | 44 ++++++++- crates/chess-import/src/lib.rs | 44 +++++++++ crates/chess-import/src/position.rs | 109 ++++++++++++++++++++++ crates/game-review/src/lib.rs | 7 +- crates/game-review/src/report.rs | 8 +- 6 files changed, 212 insertions(+), 66 deletions(-) diff --git a/apps/desktop/src/reference.rs b/apps/desktop/src/reference.rs index fd57fda..a2fa374 100644 --- a/apps/desktop/src/reference.rs +++ b/apps/desktop/src/reference.rs @@ -15,7 +15,9 @@ use std::sync::atomic::AtomicBool; use chess_core::{Game, NodeId}; use chess_import::Database; -use chess_import::position::{Match, MoveStat, PositionOutcome, PositionQuery, Tally}; +use chess_import::position::{ + Match, MoveStat, PositionOutcome, PositionQuery, Tally, theory_end, +}; use egui::{RichText, Sense, Ui, vec2}; use egui_extras::{Column, TableBuilder}; use shakmaty::uci::UciMove; @@ -147,8 +149,6 @@ const MOVES_WITH_GAMES: usize = 12; const PGN_TREE_MATCHES: usize = 5_000; /// Results bigger than the cache kept apart (the start position, 1.e4). const BIG_KEPT: usize = 2; -/// Plies of the theory checked one by one before it is found by halving. -const BOOK_LINEAR: usize = 12; /// Sort of the games table. #[derive(Clone, Copy, Default, PartialEq, Eq)] @@ -654,62 +654,12 @@ fn book_end( ) }; // The first plies one by one (the opening index answers them at once), then by - // doubling and halving: a position is nearly always in the database when a later - // one of the same line is. - // `from`: the plies before it are known already (the game grew past a theory that - // reached its end). - let total = nodes.len(); - let from = from.min(total); - let linear_end = if from > 0 { - from - } else { - total.min(BOOK_LINEAR) - }; - let mut last_known: Option = from.checked_sub(1); - let mut first_unknown = None; - for ply in from..linear_end { - if known(ply)? { - last_known = Some(ply); - } else { - first_unknown = Some(ply); - break; - } - } - if first_unknown.is_none() && total > linear_end { - let mut lo = linear_end - 1; - let mut step = 2; - let mut hi = total; - while lo + step < total { - if known(lo + step)? { - lo += step; - step *= 2; - } else { - hi = lo + step; - break; - } - } - if hi == total && lo + 1 < total { - // Past the last doubling: the end of the line itself. - if known(total - 1)? { - lo = total - 1; - } - } - while hi - lo > 1 { - let mid = (lo + hi) / 2; - if known(mid)? { - lo = mid; - } else { - hi = mid; - } - } - last_known = Some(lo); - if hi < total { - first_unknown = Some(hi); - } - } + // doubling and halving (`theory_end`). `from`: the plies before it are known + // already (the game grew past a theory that reached its end). + let end = theory_end(nodes.len(), from, known)?; Some(BookEnd { - last: last_known.map(|p| nodes[p]), - to_the_end: total > 1 && first_unknown.is_none(), + last: end.last_known.map(|p| nodes[p]), + to_the_end: nodes.len() > 1 && end.first_unknown.is_none(), copies, }) } diff --git a/crates/chess-import/src/chessbase/base.rs b/crates/chess-import/src/chessbase/base.rs index 24a9bd8..3c68a8e 100644 --- a/crates/chess-import/src/chessbase/base.rs +++ b/crates/chess-import/src/chessbase/base.rs @@ -214,10 +214,11 @@ pub fn fold(s: &str) -> String { out } -/// Folded words of a search query; commas separate words too ("Carlsen, M"). +/// Folded words of a search query; commas separate words too ("Carlsen, M"), and so +/// does the full stop of an initial ("Carlsen, M." finds "Carlsen, Magnus"). pub(crate) fn words(query: &str) -> Vec { fold(query) - .split(|c: char| c.is_whitespace() || c == ',') + .split(|c: char| c.is_whitespace() || c == ',' || c == '.') .filter(|w| !w.is_empty()) .map(str::to_owned) .collect() @@ -954,6 +955,39 @@ impl Base { } } + /// The first `max_plies` moves of the main line of game `index`, decoded without + /// building the move tree (see [`moves::main_line`]). `None` for a text, a deleted + /// record or unreadable moves. + pub fn main_line(&self, index: usize, max_plies: usize) -> Option { + let Record::Game(h) = self.header(index)? else { + return None; + }; + let bytes = self.read_moves(h.moves_offset)?; + let walk = |fast: bool| -> Result { + let mut line = crate::MainLine::default(); + let mut first = true; + moves::main_line(&bytes, 0, fast, |pos, step| { + if std::mem::take(&mut first) { + line.standard_start = crate::position::same_position(pos, &shakmaty::Chess::default()); + if !line.standard_start { + return false; + } + } + match step { + moves::Step::Move(m) => { + line.moves.push(*m); + line.moves.len() < max_plies + } + // A null move or the end: the opening line stops here. + moves::Step::Null | moves::Step::End => false, + } + })?; + Ok(line) + }; + // The fast decoder trusts the data: a damaged game is read again carefully. + walk(true).or_else(|_| walk(false)).ok() + } + /// The `.cbg` record at `offset` (its size is in bytes 1-3). fn read_moves(&self, offset: u32) -> Option> { let mut f = self.cbg.lock().ok()?; @@ -1407,6 +1441,9 @@ mod tests { assert_eq!(fold("Hübner, Robert"), "hubner, robert"); assert_eq!(fold("Łukasz Ćwikła"), "lukasz cwikla"); assert_eq!(words(" Carlsen,Magnus "), vec!["carlsen", "magnus"]); + // An initial with its full stop finds the full name. + assert_eq!(words("Вафин, Р."), vec!["вафин", "р"]); + assert_eq!(words("J.R. Capablanca"), vec!["j", "r", "capablanca"]); let names = Names::new(vec![ "Carlsen, Magnus".into(), "Carlsen, Henrik".into(), @@ -1416,6 +1453,9 @@ mod tests { assert_eq!(names.matching("hubner"), vec![false, false, true]); let (list, total) = names.suggest("carl", 1); assert_eq!((list.len(), total), (1, 2)); + let (list, total) = names.suggest("Carlsen, M.", 5); + assert_eq!((list.len(), total), (1, 1)); + assert_eq!(list[0].name, "Carlsen, Magnus"); } #[test] diff --git a/crates/chess-import/src/lib.rs b/crates/chess-import/src/lib.rs index c3a20aa..efa18b4 100644 --- a/crates/chess-import/src/lib.rs +++ b/crates/chess-import/src/lib.rs @@ -171,6 +171,14 @@ impl std::ops::Deref for PgnDb { } } +/// The beginning of a game's main line (see [`Database::main_line`]). +#[derive(Clone, Debug, Default)] +pub struct MainLine { + /// The game starts from the usual position; otherwise `moves` is empty. + pub standard_start: bool, + pub moves: Vec, +} + /// An opened database. pub enum Database { Pgn(PgnDb), @@ -213,6 +221,34 @@ impl Database { } } + /// The first `max_plies` moves of the main line of record `index`, for passes + /// over the openings of many games: a ChessBase game is decoded without its tree + /// (microseconds), a PGN game is parsed. The line stops at a teaching null move. + /// `None` for a text, a deleted record or unreadable moves. + pub fn main_line(&self, index: usize, max_plies: usize) -> Option { + match self { + Database::Pgn(db) => { + let parsed = db.load_game(index)?; + let game = &parsed.game; + let mut line = MainLine { + standard_start: game.start().is_standard(), + moves: Vec::new(), + }; + if !line.standard_start { + return Some(line); + } + for id in game.mainline().into_iter().take(max_plies) { + match game.game_move(id).map(|m| &m.kind) { + Some(chess_core::MoveKind::Normal(m)) => line.moves.push(*m), + _ => break, + } + } + Some(line) + } + Database::ChessBase(b) => b.main_line(index, max_plies), + } + } + /// Bytes that identify record `index` (its content for PGN, its `.cbh` record for /// ChessBase), for remembering viewed games. pub fn identity(&self, index: usize) -> &[u8] { @@ -337,6 +373,14 @@ impl Database { } } + /// The name of player `id` (from a suggestion), as the game list shows it. + pub fn player_name(&self, id: u32) -> &str { + match self { + Database::Pgn(db) => db.catalog().player_name(id), + Database::ChessBase(b) => b.player_name(id), + } + } + pub fn suggest_events( &self, query: &str, diff --git a/crates/chess-import/src/position.rs b/crates/chess-import/src/position.rs index 1c15a15..1f0352a 100644 --- a/crates/chess-import/src/position.rs +++ b/crates/chess-import/src/position.rs @@ -281,6 +281,85 @@ pub fn uci(m: &Move) -> UciMove { m.to_uci(shakmaty::CastlingMode::Standard) } +/// Plies of a line checked one by one by [`theory_end`] before the end of the theory is +/// found by halving (an opening index answers the first plies at once). +pub const THEORY_LINEAR: usize = 12; + +/// Where a line of `total` positions leaves the "theory" of a database, as +/// [`theory_end`] finds it: indices into the line. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub struct TheoryEnd { + /// The last position still known to the database. + pub last_known: Option, + /// The first position it does not know; `None` when the whole line is known. + pub first_unknown: Option, +} + +/// Finds how far a line of `total` positions is known to a database, with as few +/// searches as possible: `known(i)` says whether position `i` is (`None`: cancelled, +/// the search stops too). A position is nearly always known when a later one of the +/// same line is, so the first plies are checked one by one, then the end is found by +/// doubling and halving. `from`: the positions before it are known already (a game +/// that grew past a theory reaching its end checks only the new moves). +pub fn theory_end( + total: usize, + from: usize, + mut known: impl FnMut(usize) -> Option, +) -> Option { + let from = from.min(total); + let linear_end = if from > 0 { + from + } else { + total.min(THEORY_LINEAR) + }; + let mut last_known: Option = from.checked_sub(1); + let mut first_unknown = None; + for ply in from..linear_end { + if known(ply)? { + last_known = Some(ply); + } else { + first_unknown = Some(ply); + break; + } + } + if first_unknown.is_none() && total > linear_end { + let mut lo = linear_end - 1; + let mut step = 2; + let mut hi = total; + while lo + step < total { + if known(lo + step)? { + lo += step; + step *= 2; + } else { + hi = lo + step; + break; + } + } + if hi == total && lo + 1 < total { + // Past the last doubling: the end of the line itself. + if known(total - 1)? { + lo = total - 1; + } + } + while hi - lo > 1 { + let mid = (lo + hi) / 2; + if known(mid)? { + lo = mid; + } else { + hi = mid; + } + } + last_known = Some(lo); + if hi < total { + first_unknown = Some(hi); + } + } + Some(TheoryEnd { + last_known, + first_unknown, + }) +} + #[cfg(test)] mod tests { use super::*; @@ -304,6 +383,36 @@ mod tests { assert!(!same_position(&a, &play(&["d4", "d5"]))); } + #[test] + fn theory_end_finds_the_boundary_with_few_searches() { + for total in [1usize, 5, 12, 13, 20, 40, 100] { + for boundary in 0..=total { + // Positions before `boundary` are known. + let mut asked = 0; + let end = theory_end(total, 0, |i| { + asked += 1; + Some(i < boundary) + }) + .expect("not cancelled"); + let expect_last = boundary.checked_sub(1); + let expect_first = (boundary < total).then_some(boundary); + assert_eq!( + (end.last_known, end.first_unknown), + (expect_last, expect_first), + "total {total}, boundary {boundary}" + ); + assert!(asked <= THEORY_LINEAR + 2 * 8, "{asked} searches"); + } + } + // Cancelled: no answer. + assert_eq!(theory_end(10, 0, |_| None), None); + // Continuing from a known prefix. + let end = theory_end(10, 4, |i| Some(i < 7)).expect("end"); + assert_eq!(end, TheoryEnd { last_known: Some(6), first_unknown: Some(7) }); + let end = theory_end(10, 4, |_| Some(true)).expect("end"); + assert_eq!(end, TheoryEnd { last_known: Some(9), first_unknown: None }); + } + #[test] fn collector_counts_and_names_moves() { let pos = Chess::default(); diff --git a/crates/game-review/src/lib.rs b/crates/game-review/src/lib.rs index 9af96f9..ad7a293 100644 --- a/crates/game-review/src/lib.rs +++ b/crates/game-review/src/lib.rs @@ -23,7 +23,7 @@ pub mod report; pub use features::{MoveFeatures, Rules}; pub use job::{JobEvent, JobFailure, JobSettings, Target, run}; -pub use report::{Eval, Judgement, Phase, Phases, Ply, Report, SideStats}; +pub use report::{Eval, Judgement, Phase, Phases, Ply, Report, SideStats, judge}; /// Engine result for one position of the main line. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -560,8 +560,9 @@ fn position_key(game: &Game, id: NodeId) -> Option<(String, EnginePosition)> { Some((key, pos)) } -/// Evaluation of a position without legal moves. -fn terminal_eval(pos: &Chess) -> Option { +/// Evaluation of a position without legal moves (checkmate or stalemate): no engine +/// is needed for it. +pub fn terminal_eval(pos: &Chess) -> Option { if pos.is_checkmate() { Some(Eval::Mate { white: pos.turn() == Color::Black, diff --git a/crates/game-review/src/report.rs b/crates/game-review/src/report.rs index e797627..8471297 100644 --- a/crates/game-review/src/report.rs +++ b/crates/game-review/src/report.rs @@ -114,7 +114,7 @@ fn move_accuracy(before: f64, after: f64) -> f64 { (raw + 1.0).clamp(0.0, 100.0) } -#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] pub enum Judgement { Inaccuracy, Mistake, @@ -203,8 +203,10 @@ fn note(before: Eval, after: Eval, ply: &Ply, rules: Rules) -> Option .then_some(Judgement::Great) } -/// Judgement of a move from the evaluations before and after it. -fn judge(before: Eval, after: Eval, mover: Color) -> Option { +/// Judgement of a move from the evaluations before and after it: an inaccuracy, a +/// mistake or a blunder by the drop of the mover's winning chances (never for the +/// engine's own best move: the caller rules that out). +pub fn judge(before: Eval, after: Eval, mover: Color) -> Option { use Judgement::*; let (mb, ma) = (before.mate_for(mover), after.mate_for(mover)); if ma == Some(false) && mb != Some(false) { From d54f207889bead8cec8a81f9f3e99b6b06f61f06 Mon Sep 17 00:00:00 2001 From: vrubelroman Date: Wed, 28 Oct 2026 12:32:39 +0300 Subject: [PATCH 4/9] Opponent prep: the `prep` crate (openings only) A new crate shared by the apps, no UI: what a player of a database plays in the opening and where in the opening he goes wrong. - Player: candidates from the database's names (initials with a full stop work), one or several ids, White, Black or both. - Lines: the first N plies (default 20) of the main lines, position keys, UCI/SAN, result from the player's side, full date, opponent's Elo; games from a set-up position are skipped. - Repertoire tree per colour by move order with position keys: games (+/=/-), last date, average opponent Elo, game list, transpositions marked. - Opening names from lichess-org/chess-openings (CC0; revision and SHA-256 pinned, files in crates/prep/data, THIRD_PARTY_NOTICES): the deepest named position of a line, families and variations with their first moves, grouped by name. - Book: a second database (or the same one without the player's games) says where each game left it (first position with fewer than T games, T = 5) and whose move it was. - Engine: every distinct position of the lines once through game_review::run, judged with the game analysis rules for the player's moves only; errors by opening and the repeated ones (same position, same move in two or more games); evaluations cached per position across reports, the report cached by database, player and plies. - examples/prep_report.rs prints it all for a database and a player. Co-Authored-By: Claude Fable 5.1 --- Cargo.lock | 12 + Cargo.toml | 2 + THIRD_PARTY_NOTICES.md | 16 + crates/prep/Cargo.toml | 17 + crates/prep/data/a.tsv | 824 ++++++++++++++++++ crates/prep/data/b.tsv | 782 +++++++++++++++++ crates/prep/data/c.tsv | 1251 +++++++++++++++++++++++++++ crates/prep/data/d.tsv | 645 ++++++++++++++ crates/prep/data/e.tsv | 368 ++++++++ crates/prep/examples/prep_report.rs | 373 ++++++++ crates/prep/src/book.rs | 102 +++ crates/prep/src/errors.rs | 391 +++++++++ crates/prep/src/games.rs | 227 +++++ crates/prep/src/lib.rs | 943 ++++++++++++++++++++ crates/prep/src/openings.rs | 213 +++++ crates/prep/src/players.rs | 92 ++ crates/prep/src/tree.rs | 266 ++++++ 17 files changed, 6524 insertions(+) create mode 100644 crates/prep/Cargo.toml create mode 100644 crates/prep/data/a.tsv create mode 100644 crates/prep/data/b.tsv create mode 100644 crates/prep/data/c.tsv create mode 100644 crates/prep/data/d.tsv create mode 100644 crates/prep/data/e.tsv create mode 100644 crates/prep/examples/prep_report.rs create mode 100644 crates/prep/src/book.rs create mode 100644 crates/prep/src/errors.rs create mode 100644 crates/prep/src/games.rs create mode 100644 crates/prep/src/lib.rs create mode 100644 crates/prep/src/openings.rs create mode 100644 crates/prep/src/players.rs create mode 100644 crates/prep/src/tree.rs diff --git a/Cargo.lock b/Cargo.lock index 7856ae4..babd0ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3427,6 +3427,18 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "196a7c80b9a7652aba7cc070827516c2abe4ccdf53d128e1944003cf5726cff1" +[[package]] +name = "prep" +version = "2.0.0" +dependencies = [ + "chess-core", + "chess-import", + "game-review", + "serde", + "serde_json", + "uci", +] + [[package]] name = "presser" version = "0.3.1" diff --git a/Cargo.toml b/Cargo.toml index ede3ac0..ca8aa65 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ members = [ "crates/maia", "crates/trainer", "crates/play", + "crates/prep", "apps/desktop", ] @@ -47,6 +48,7 @@ online-games = { path = "crates/online-games" } releases = { path = "crates/releases" } trainer = { path = "crates/trainer" } play = { path = "crates/play" } +prep = { path = "crates/prep" } [profile.dev.package."*"] opt-level = 2 diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index 136f4e8..d6eee6c 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -149,6 +149,22 @@ platform into the user's data directory and checks its SHA-256 (pinned in Open Database License (ODbL). - ChessPenguin runs Stockfish as a separate process over the UCI protocol. +## Opening names (preparing against an opponent) + +`crates/prep/data/a.tsv` … `e.tsv` are the five files of the Lichess opening table +https://github.com/lichess-org/chess-openings (the lichess.org contributors), downloaded +unmodified at revision `f06a50d5c7c140e50b068049fa31d289e2c3d347` (2026-10-27) on 2026-10-28 and +embedded in the program. Its README: "As a collection of facts, this data set is in the public +domain … released under the CC0 Public Domain Dedication" (CC0 1.0). SHA-256 of the files: + +| File | SHA-256 | +| --- | --- | +| `a.tsv` | `3282e4c9155289a29224f9a85fba0decb46efa35c2fa5e39662d2ac48fb0f793` | +| `b.tsv` | `4bf2269a8e7571a00a7b346bae4fa86a241a6e7e86beab01783c81acb1622b63` | +| `c.tsv` | `45e843c7b7e79a0d04d5bda879c9bd23f5a10974488bd8615e4f4c5d0749986f` | +| `d.tsv` | `1cf4057a8aece94f27bb3f278ad410ee2844831a642364eeceaafa091dbcceda` | +| `e.tsv` | `48c6f6645b031a5937c8386839debab0e2e48837251687ba1afb6369677f8546` | + ## ChessBase formats - `crates/chess-import/src/cbv.rs` reads ChessBase archives following uncbv diff --git a/crates/prep/Cargo.toml b/crates/prep/Cargo.toml new file mode 100644 index 0000000..3d628c3 --- /dev/null +++ b/crates/prep/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "prep" +description = "Preparing against an opponent: a player's opening repertoire in a database, the names of the openings, where the games leave the book, and the opening errors the engine finds (the desktop and Android apps share it)" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +authors.workspace = true +publish = false + +[dependencies] +chess-core.workspace = true +chess-import.workspace = true +game-review.workspace = true +uci.workspace = true +serde.workspace = true +serde_json.workspace = true diff --git a/crates/prep/data/a.tsv b/crates/prep/data/a.tsv new file mode 100644 index 0000000..5610998 --- /dev/null +++ b/crates/prep/data/a.tsv @@ -0,0 +1,824 @@ +eco name pgn +A00 Amar Opening 1. Nh3 +A00 Amar Opening: Paris Gambit 1. Nh3 d5 2. g3 e5 3. f4 +A00 Amar Opening: Paris Gambit, Gent Gambit 1. Nh3 d5 2. g3 e5 3. f4 Bxh3 4. Bxh3 exf4 5. O-O fxg3 6. hxg3 +A00 Amsterdam Attack 1. e3 e5 2. c4 d6 3. Nc3 Nc6 4. b3 Nf6 +A00 Anderssen's Opening 1. a3 +A00 Anderssen's Opening: Polish Gambit 1. a3 a5 2. b4 +A00 Barnes Opening 1. f3 +A00 Barnes Opening: Fool's Mate 1. f3 e5 2. g4 Qh4# +A00 Barnes Opening: Gedult Gambit 1. f3 d5 2. e4 g6 3. d4 dxe4 4. c3 +A00 Barnes Opening: Gedult Gambit 1. f3 f5 2. e4 fxe4 3. Nc3 +A00 Barnes Opening: Hammerschlag 1. f3 e5 2. Kf2 +A00 Clemenz Opening 1. h3 +A00 Clemenz Opening: Spike Lee Gambit 1. h3 h5 2. g4 +A00 Creepy Crawly Formation: Classical Defense 1. h3 d5 2. a3 e5 +A00 Formation: Hippopotamus Attack 1. a3 e5 2. b3 d5 3. c3 Nf6 4. d3 Nc6 5. e3 Bd6 6. f3 O-O 7. g3 +A00 Formation: Shy Attack 1. a3 e5 2. g3 d5 3. Bg2 Nf6 4. d3 Nc6 5. Nd2 Bd6 6. e3 O-O 7. h3 +A00 Global Opening 1. h3 e5 2. a3 +A00 Grob Opening 1. g4 +A00 Grob Opening: Alessi Gambit 1. g4 f5 +A00 Grob Opening: Double Grob 1. g4 g5 +A00 Grob Opening: Double Grob, Coca-Cola Gambit 1. g4 g5 2. f4 +A00 Grob Opening: Grob Gambit 1. g4 d5 2. Bg2 +A00 Grob Opening: Grob Gambit Declined 1. g4 d5 2. Bg2 c6 +A00 Grob Opening: Grob Gambit, Basman Gambit 1. g4 d5 2. Bg2 h5 3. gxh5 +A00 Grob Opening: Grob Gambit, Fritz Gambit 1. g4 d5 2. Bg2 Bxg4 3. c4 +A00 Grob Opening: Grob Gambit, Fritz Gambit, Romford Countergambit 1. g4 d5 2. Bg2 Bxg4 3. c4 d4 4. Bxb7 Nd7 5. Bxa8 Qxa8 +A00 Grob Opening: Grob Gambit, Keres Gambit 1. g4 d5 2. Bg2 e5 3. d4 exd4 4. c3 +A00 Grob Opening: Grob Gambit, Richter-Grob Gambit 1. g4 d5 2. Bg2 c6 3. c4 dxc4 4. b3 +A00 Grob Opening: Keene Defense 1. g4 d5 2. h3 e5 3. Bg2 c6 +A00 Grob Opening: Keene Defense, Main Line 1. g4 d5 2. h3 e5 3. Bg2 c6 4. d4 e4 5. c4 Bd6 6. Nc3 Ne7 +A00 Grob Opening: London Defense 1. g4 e5 2. h3 Nc6 +A00 Grob Opening: Romford Countergambit 1. g4 d5 2. Bg2 Bxg4 3. c4 d4 +A00 Grob Opening: Spike Attack 1. g4 d5 2. Bg2 c6 3. g5 +A00 Grob Opening: Spike, Hurst Attack 1. g4 e5 2. Bg2 d5 3. c4 +A00 Grob Opening: Zilbermints Gambit 1. g4 d5 2. e4 dxe4 3. Nc3 +A00 Grob Opening: Zilbermints Gambit, Schiller Defense 1. g4 d5 2. e4 dxe4 3. Nc3 h5 +A00 Grob Opening: Zilbermints Gambit, Zilbermints-Hartlaub Gambit 1. g4 d5 2. e4 dxe4 3. Nc3 e5 4. d3 +A00 Hungarian Opening 1. g3 +A00 Hungarian Opening: Asten Gambit 1. g3 Nc6 2. Nc3 d5 3. d4 e5 4. dxe5 d4 5. Ne4 f5 +A00 Hungarian Opening: Burk Gambit 1. g3 e5 2. a3 d5 3. Nf3 e4 4. Nh4 Be7 5. d3 +A00 Hungarian Opening: Bücker Gambit 1. g3 d5 2. Bg2 e5 3. b4 +A00 Hungarian Opening: Catalan Formation 1. g3 d5 2. Bg2 e6 +A00 Hungarian Opening: Dutch Defense 1. g3 f5 +A00 Hungarian Opening: Indian Defense 1. g3 Nf6 +A00 Hungarian Opening: Myers Defense 1. g3 g5 +A00 Hungarian Opening: Pachman Gambit 1. g3 f5 2. e4 fxe4 3. Qh5+ g6 +A00 Hungarian Opening: Paris Gambit 1. g3 e5 2. Nh3 d5 3. f4 Bxh3 4. Bxh3 exf4 5. O-O +A00 Hungarian Opening: Reversed Alekhine 1. g3 e5 2. Nf3 +A00 Hungarian Opening: Reversed Brooklyn Defense, Brooklyn Benko Gambit 1. g3 e5 2. Nf3 e4 3. Ng1 Nf6 4. b4 +A00 Hungarian Opening: Reversed Modern Defense 1. g3 d5 2. Bg2 c5 +A00 Hungarian Opening: Reversed Norwegian Defense 1. g3 e5 2. Nf3 e4 3. Nh4 +A00 Hungarian Opening: Sicilian Invitation 1. g3 c5 +A00 Hungarian Opening: Slav Formation 1. g3 d5 2. Bg2 c6 +A00 Hungarian Opening: Symmetrical Variation 1. g3 g6 +A00 Hungarian Opening: Van Kuijk Gambit 1. g3 h5 2. Nf3 h4 +A00 Hungarian Opening: Winterberg Gambit 1. g3 d5 2. Bg2 e5 3. c4 dxc4 4. b3 +A00 Kádas Opening 1. h4 +A00 Kádas Opening: Beginner's Trap 1. h4 d5 2. Rh3 +A00 Kádas Opening: Koola-Koola Variation 1. h4 a5 +A00 Kádas Opening: Kádas Gambit 1. h4 c5 2. b4 +A00 Kádas Opening: Kádas Gambit 1. h4 d5 2. d4 c5 3. Nf3 cxd4 4. c3 +A00 Kádas Opening: Kádas Gambit 1. h4 e5 2. d4 exd4 3. c3 +A00 Kádas Opening: Myers Variation 1. h4 d5 2. d4 c5 3. e4 +A00 Kádas Opening: Schneider Gambit 1. h4 g5 +A00 Kádas Opening: Steinbok Gambit 1. h4 f5 2. e4 fxe4 3. d3 +A00 Lasker Simul Special 1. g3 h5 +A00 Mieses Opening 1. d3 +A00 Mieses Opening: Myers Spike Attack 1. d3 g6 2. g4 +A00 Mieses Opening: Reversed Rat 1. d3 e5 +A00 Mieses Opening: Venezolana Variation 1. d3 c5 2. Nc3 Nc6 3. g3 +A00 Polish Opening 1. b4 +A00 Polish Opening, with d5 1. b4 d5 +A00 Polish Opening, with d5 1. b4 d5 2. Bb2 Nf6 3. Nf3 +A00 Polish Opening: Baltic Defense 1. b4 d5 2. Bb2 Bf5 +A00 Polish Opening: Birmingham Gambit 1. b4 c5 +A00 Polish Opening: Bugayev Advance Variation 1. b4 e5 2. Bb2 f6 3. b5 +A00 Polish Opening: Bugayev Attack 1. b4 e5 2. a3 +A00 Polish Opening: Czech Defense 1. b4 e5 2. Bb2 d6 +A00 Polish Opening: Dutch Defense 1. b4 f5 +A00 Polish Opening: German Defense 1. b4 d5 2. Bb2 Qd6 +A00 Polish Opening: Grigorian Variation 1. b4 Nc6 +A00 Polish Opening: Karniewski Variation 1. b4 Nh6 +A00 Polish Opening: King's Indian Variation 1. b4 Nf6 2. Bb2 g6 +A00 Polish Opening: King's Indian Variation, Schiffler Attack 1. b4 Nf6 2. Bb2 g6 3. e4 +A00 Polish Opening: King's Indian Variation, Sokolsky Attack 1. b4 Nf6 2. Bb2 g6 3. c4 Bg7 4. e3 d6 5. Nf3 O-O 6. d4 +A00 Polish Opening: Myers Variation 1. b4 d5 2. Bb2 c6 3. a4 +A00 Polish Opening: Outflank Variation 1. b4 c6 +A00 Polish Opening: Outflank Variation, Schuehler Gambit 1. b4 c6 2. Bb2 a5 3. b5 +A00 Polish Opening: Queen's Indian Variation 1. b4 e6 2. Bb2 Nf6 3. b5 b6 +A00 Polish Opening: Queenside Defense 1. b4 e6 2. Bb2 Nf6 3. b5 a6 +A00 Polish Opening: Rooks Swap Line 1. b4 e6 2. Bb2 Nf6 3. b5 a6 4. a4 axb5 5. axb5 Rxa1 6. Bxa1 +A00 Polish Opening: Schiffler-Sokolsky Variation 1. b4 e6 2. Bb2 Nf6 3. b5 d5 4. e3 +A00 Polish Opening: Schuehler Gambit 1. b4 c6 2. Bb2 a5 3. b5 cxb5 4. e4 +A00 Polish Opening: Symmetrical Variation 1. b4 b5 +A00 Polish Opening: Tartakower Gambit 1. b4 e5 2. Bb2 f6 3. e4 +A00 Polish Opening: Wolferts Gambit 1. b4 e5 2. Bb2 c5 +A00 Saragossa Opening 1. c3 +A00 Sodium Attack 1. Na3 +A00 Sodium Attack: Celadon Variation 1. Na3 e5 2. d3 Bxa3 3. bxa3 d5 4. e3 c5 5. Rb1 +A00 Sodium Attack: Chenoboskion Variation 1. Na3 g6 2. g4 +A00 Sodium Attack: Durkin Gambit 1. Na3 e5 2. Nc4 Nc6 3. e4 f5 +A00 Valencia Opening 1. d3 e5 2. Nd2 +A00 Van Geet Opening 1. Nc3 +A00 Van Geet Opening: Battambang Variation 1. a3 e5 2. Nc3 +A00 Van Geet Opening: Billockus-Johansen Gambit 1. Nc3 e5 2. Nf3 Bc5 +A00 Van Geet Opening: Damhaug Gambit 1. Nc3 d5 2. f4 e5 +A00 Van Geet Opening: Dougherty Gambit 1. Nc3 d5 2. e4 dxe4 3. f3 +A00 Van Geet Opening: Dunst-Perrenet Gambit 1. Nc3 d5 2. e4 dxe4 3. d3 +A00 Van Geet Opening: Düsseldorf Gambit 1. Nc3 c5 2. b4 +A00 Van Geet Opening: Gladbacher Gambit 1. Nc3 e5 2. b3 d5 3. e4 dxe4 4. d3 +A00 Van Geet Opening: Hector Gambit 1. Nc3 d5 2. e4 dxe4 3. Bc4 +A00 Van Geet Opening: Hergert Gambit 1. Nc3 d6 2. f4 e5 3. fxe5 Nc6 +A00 Van Geet Opening: Hulsemann Gambit 1. Nc3 e5 2. e3 d5 3. Qh5 Be6 +A00 Van Geet Opening: Jendrossek Gambit 1. Nc3 d5 2. f4 d4 3. Ne4 f5 4. Nf2 Nf6 5. Nf3 c5 6. b4 +A00 Van Geet Opening: Kluever Gambit 1. Nc3 f5 2. e4 fxe4 3. d3 +A00 Van Geet Opening: Laroche Gambit 1. Nc3 b5 +A00 Van Geet Opening: Liebig Gambit 1. Nc3 e5 2. e3 d5 3. Qh5 Nf6 +A00 Van Geet Opening: Melleby Gambit 1. Nc3 d5 2. f4 d4 3. Ne4 c5 +A00 Van Geet Opening: Myers Attack 1. Nc3 g6 2. h4 +A00 Van Geet Opening: Napoleon Attack 1. Nc3 e5 2. Nf3 Nc6 3. d4 +A00 Van Geet Opening: Novosibirsk Variation 1. Nc3 c5 2. d4 cxd4 3. Qxd4 Nc6 4. Qh4 +A00 Van Geet Opening: Nowokunski Gambit 1. Nc3 e5 2. f4 exf4 3. e4 +A00 Van Geet Opening: Pfeiffer Gambit 1. Nc3 d5 2. f4 d4 3. Ne4 e5 +A00 Van Geet Opening: Pfeiffer Gambit, Sleipnir Countergambit 1. Nc3 d5 2. f4 d4 3. Ne4 e5 4. Nf3 +A00 Van Geet Opening: Reversed Nimzowitsch 1. Nc3 e5 +A00 Van Geet Opening: Reversed Scandinavian 1. Nc3 e5 2. d4 exd4 3. Qxd4 Nc6 4. Qa4 +A00 Van Geet Opening: Sicilian Two Knights 1. Nc3 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 +A00 Van Geet Opening: Sleipnir Gambit 1. Nc3 d5 2. e3 e5 3. d4 Bb4 +A00 Van Geet Opening: Twyble Attack 1. Nc3 c5 2. Rb1 +A00 Van Geet Opening: Tübingen Gambit 1. Nc3 Nf6 2. g4 +A00 Van Geet Opening: Venezolana Variation 1. Nc3 d5 2. d3 Nf6 3. g3 +A00 Van Geet Opening: Warsteiner Gambit 1. Nc3 d5 2. f4 g5 +A00 Van't Kruijs Opening 1. e3 +A00 Van't Kruijs Opening: Bouncing Bishop Variation 1. e3 e5 2. Bc4 b5 3. Bb3 +A00 Van't Kruijs Opening: Keoni-Hiva Gambit, Akahi Variation 1. e3 e5 2. Nc3 Nf6 3. f4 exf4 4. Nf3 +A00 Van't Kruijs Opening: Keoni-Hiva Gambit, Alua Variation 1. e3 e5 2. Nc3 Nc6 3. f4 exf4 4. Nf3 +A00 Van't Kruijs Opening: Keoni-Hiva Gambit, Ekolu Variation 1. e3 e5 2. Nc3 d5 3. f4 exf4 4. Nf3 +A00 Ware Opening 1. a4 +A00 Ware Opening: Cologne Gambit 1. a4 b6 2. d4 d5 3. Nc3 Nd7 +A00 Ware Opening: Crab Variation 1. a4 e5 2. h4 +A00 Ware Opening: Meadow Hay Trap 1. a4 e5 2. Ra3 +A00 Ware Opening: Symmetric Variation 1. a4 a5 +A00 Ware Opening: Ware Gambit 1. a4 e5 2. a5 d5 3. e3 f5 4. a6 +A00 Ware Opening: Wing Gambit 1. a4 b5 2. axb5 Bb7 +A01 Nimzo-Larsen Attack 1. b3 +A01 Nimzo-Larsen Attack: Classical Variation 1. b3 d5 +A01 Nimzo-Larsen Attack: Dutch Variation 1. b3 f5 +A01 Nimzo-Larsen Attack: English Variation 1. b3 c5 +A01 Nimzo-Larsen Attack: Graz Attack 1. b3 d5 2. Ba3 +A01 Nimzo-Larsen Attack: Indian Variation 1. b3 Nf6 +A01 Nimzo-Larsen Attack: Modern Variation 1. b3 e5 +A01 Nimzo-Larsen Attack: Modern Variation 1. b3 e5 2. Bb2 Nc6 +A01 Nimzo-Larsen Attack: Modern Variation 1. b3 e5 2. Bb2 Nc6 3. e3 +A01 Nimzo-Larsen Attack: Modern Variation 1. b3 e5 2. Bb2 Nc6 3. c4 Nf6 +A01 Nimzo-Larsen Attack: Pachman Gambit 1. b3 e5 2. Bb2 Nc6 3. f4 +A01 Nimzo-Larsen Attack: Polish Variation 1. b3 b5 +A01 Nimzo-Larsen Attack: Ringelbach Gambit 1. b3 f5 2. Bb2 e6 3. e4 +A01 Nimzo-Larsen Attack: Spike Variation 1. b3 Nf6 2. Bb2 g6 3. g4 +A01 Nimzo-Larsen Attack: Symmetrical Variation 1. b3 b6 +A02 Bird Opening 1. f4 +A02 Bird Opening: Batavo-Polish Attack 1. f4 Nf6 2. Nf3 g6 3. b4 +A02 Bird Opening: Double Duck Formation 1. f4 f5 2. d4 d5 +A02 Bird Opening: From's Gambit 1. f4 e5 +A02 Bird Opening: From's Gambit, Bahr Gambit 1. f4 e5 2. Nc3 +A02 Bird Opening: From's Gambit, Langheld Gambit 1. f4 e5 2. fxe5 d6 3. exd6 Nf6 +A02 Bird Opening: From's Gambit, Lasker Variation 1. f4 e5 2. fxe5 d6 3. exd6 Bxd6 4. Nf3 g5 +A02 Bird Opening: From's Gambit, Lipke Variation 1. f4 e5 2. fxe5 d6 3. exd6 Bxd6 4. Nf3 Nh6 5. d4 +A02 Bird Opening: Hobbs Gambit 1. f4 g5 +A02 Bird Opening: Hobbs-Zilbermints Gambit 1. f4 h6 2. Nf3 g5 +A02 Bird Opening: Horsefly Defense 1. f4 Nh6 +A02 Bird Opening: Lasker Gambit 1. f4 e5 2. fxe5 f6 +A02 Bird Opening: Mujannah 1. f4 Nf6 2. c4 +A02 Bird Opening: Myers Defense 1. f4 b5 +A02 Bird Opening: Platz Gambit 1. f4 e5 2. fxe5 Ne7 +A02 Bird Opening: Schlechter Gambit 1. f4 e5 2. fxe5 Nc6 +A02 Bird Opening: Siegener Gambit 1. f4 e5 2. d4 exd4 3. Nf3 c5 4. c3 +A02 Bird Opening: Swiss Gambit 1. f4 f5 2. e4 fxe4 3. Nc3 Nf6 4. g4 +A02 Bird Opening: Wagner-Zwitersch Gambit 1. f4 f5 2. e4 +A03 Bird Opening: Dutch Variation 1. f4 d5 +A03 Bird Opening: Dutch Variation, Dudweiler Gambit 1. f4 d5 2. g4 +A03 Bird Opening: Lasker Variation 1. f4 d5 2. Nf3 Nf6 3. e3 c5 +A03 Bird Opening: Sturm Gambit 1. f4 d5 2. c4 +A03 Bird Opening: Thomas Gambit 1. f4 d5 2. b3 Nf6 3. Bb2 d4 4. Nf3 c5 5. e3 +A03 Bird Opening: Williams Gambit 1. f4 d5 2. e4 +A03 Bird Opening: Williams Gambit 1. f4 d5 2. e4 dxe4 3. Nc3 Nf6 4. Qe2 +A03 Bird Opening: Williams-Zilbermints Gambit 1. f4 d5 2. e4 dxe4 3. Nc3 Nf6 4. Nge2 +A04 Colle System: Rhamphorhynchus Variation 1. Nf3 c5 2. e3 g6 3. d4 Bg7 4. dxc5 Qa5+ +A04 Modern Defense: Semi-Averbakh Variation, Polish Variation 1. Nf3 c5 2. c4 g6 3. d4 Bg7 4. e4 Qb6 +A04 Modern Defense: Semi-Averbakh Variation, Pterodactyl Variation 1. Nf3 c5 2. c4 g6 3. d4 Bg7 4. e4 Qa5+ +A04 Modern Defense: Semi-Averbakh Variation, Pterodactyl Variation Accepted 1. Nf3 g6 2. d4 Bg7 3. e4 d6 4. c4 c5 5. dxc5 Qa5+ +A04 Zukertort Defense: Kingside Variation 1. Nf3 Nh6 2. d4 g6 +A04 Zukertort Defense: Sicilian Knight Variation 1. Nf3 Na6 2. e4 c5 +A04 Zukertort Opening 1. Nf3 +A04 Zukertort Opening: Arctic Defense 1. Nf3 f6 +A04 Zukertort Opening: Arctic Defense, Drunken Knight Variation 1. Nf3 f6 2. e4 Nh6 3. d4 Nf7 +A04 Zukertort Opening: Basman Defense 1. Nf3 h6 +A04 Zukertort Opening: Black Mustang Defense 1. Nf3 Nc6 +A04 Zukertort Opening: Drunken Cavalry Variation 1. Nf3 Na6 2. e4 Nh6 +A04 Zukertort Opening: Dutch Variation 1. Nf3 f5 +A04 Zukertort Opening: Herrstrom Gambit 1. Nf3 g5 +A04 Zukertort Opening: Kingside Fianchetto 1. Nf3 g6 +A04 Zukertort Opening: Lisitsyn Gambit 1. Nf3 f5 2. e4 +A04 Zukertort Opening: Lisitsyn Gambit Deferred 1. Nf3 f5 2. d3 Nf6 3. e4 +A04 Zukertort Opening: Pirc Invitation 1. Nf3 d6 +A04 Zukertort Opening: Polish Defense 1. Nf3 b5 +A04 Zukertort Opening: Queen's Gambit Invitation 1. Nf3 e6 +A04 Zukertort Opening: Queenside Fianchetto Variation 1. Nf3 b6 +A04 Zukertort Opening: Ross Gambit 1. Nf3 e5 +A04 Zukertort Opening: Shabalov Gambit 1. Nf3 e6 2. c4 a6 3. Nc3 c5 4. g3 b5 +A04 Zukertort Opening: Sicilian Invitation 1. Nf3 c5 +A04 Zukertort Opening: Slav Invitation 1. Nf3 c6 +A04 Zukertort Opening: Speelsmet Gambit 1. Nf3 c5 2. d4 cxd4 3. e3 +A04 Zukertort Opening: St. George Defense 1. Nf3 a6 +A04 Zukertort Opening: The Walrus 1. Nf3 e5 2. Nxe5 Nc6 3. Nxc6 dxc6 +A04 Zukertort Opening: Vos Gambit 1. Nf3 d6 2. d4 e5 +A04 Zukertort Opening: Wade Defense 1. Nf3 d6 2. e4 Bg4 +A04 Zukertort Opening: Ware Defense 1. Nf3 a5 +A05 King's Indian Attack 1. Nf3 Nf6 2. g3 d5 +A05 King's Indian Attack: Smyslov Variation 1. Nf3 Nf6 2. g3 g6 3. b4 +A05 King's Indian Attack: Spassky Variation 1. Nf3 Nf6 2. g3 b5 +A05 King's Indian Attack: Symmetrical Defense 1. Nf3 Nf6 2. g3 g6 +A05 King's Indian Attack: Wahls Defense 1. Nf3 Nf6 2. g3 g6 3. Bg2 Bg7 4. O-O O-O 5. d3 d5 +A05 Polish Opening: Zukertort System 1. Nf3 Nf6 2. b4 g6 3. Bb2 +A05 Zukertort Opening 1. Nf3 Nf6 +A05 Zukertort Opening 1. Nf3 Nf6 2. Nc3 Nc6 +A05 Zukertort Opening: Double Fianchetto Attack 1. Nf3 Nf6 2. g3 g6 3. b3 Bg7 4. Bb2 O-O 5. Bg2 d6 6. O-O +A05 Zukertort Opening: Lemberger Gambit 1. Nf3 Nf6 2. e4 +A05 Zukertort Opening: Myers Polish Attack 1. Nf3 Nf6 2. a4 g6 3. b4 +A05 Zukertort Opening: Nimzo-Larsen Variation 1. Nf3 Nf6 2. b3 +A05 Zukertort Opening: Quiet System 1. Nf3 Nf6 2. e3 +A06 Nimzo-Larsen Attack: Classical Variation 1. Nf3 d5 2. b3 +A06 Nimzo-Larsen Attack: Norfolk Gambit 1. Nf3 d5 2. b3 c5 3. e4 +A06 Nimzo-Larsen Attack: Norfolk Gambit 1. Nf3 d5 2. b3 Nf6 3. Bb2 c5 4. e4 +A06 Zukertort Opening 1. Nf3 d5 +A06 Zukertort Opening: Ampel Variation 1. Nf3 d5 2. Rg1 +A06 Zukertort Opening: Old Indian Attack 1. Nf3 d5 2. d3 +A06 Zukertort Opening: Pachman Gambit 1. Nf3 d5 2. e3 c5 3. c4 dxc4 4. b3 +A06 Zukertort Opening: Regina-Nu Gambit 1. Nf3 d5 2. b3 c5 3. c4 dxc4 4. Nc3 +A06 Zukertort Opening: Reversed Mexican Defense 1. Nf3 d5 2. Nc3 +A06 Zukertort Opening: Santasiere's Folly 1. b4 d5 2. Nf3 +A06 Zukertort Opening: Tennison Gambit 1. e4 d5 2. Nf3 +A06 Zukertort Opening: Tennison Gambit, Brigg's Trap 1. e4 d5 2. Nf3 dxe4 3. Ng5 Nf6 4. Nc3 Bf5 5. Qe2 Qd4 +A06 Zukertort Opening: The Potato 1. Nf3 d5 2. a4 +A07 Hungarian Opening: Wiedenhagen-Beta Gambit 1. g3 d5 2. Nf3 g5 +A07 King's Indian Attack 1. Nf3 d5 2. g3 +A07 King's Indian Attack, with Bf5 1. Nf3 Nf6 2. g3 d5 3. Bg2 c6 4. O-O Bf5 +A07 King's Indian Attack, with Bf5 1. Nf3 Nf6 2. g3 d5 3. Bg2 c6 4. O-O Bf5 5. d3 h6 +A07 King's Indian Attack, with Bf5 1. Nf3 Nf6 2. g3 d5 3. Bg2 c6 4. O-O Bf5 5. d3 h6 6. c4 dxc4 +A07 King's Indian Attack, with Bf5 1. Nf3 Nf6 2. g3 d5 3. Bg2 c6 4. O-O Bf5 5. d3 e6 6. Nbd2 +A07 King's Indian Attack, with Bf5 1. Nf3 Nf6 2. g3 d5 3. Bg2 c6 4. O-O Bf5 5. d3 e6 6. Nh4 +A07 King's Indian Attack, with e6 1. Nf3 Nf6 2. g3 d5 3. Bg2 e6 +A07 King's Indian Attack, with e6 1. Nf3 Nf6 2. g3 d5 3. Bg2 e6 4. O-O Be7 +A07 King's Indian Attack: Double Fianchetto 1. Nf3 d5 2. g3 g6 +A07 King's Indian Attack: Keres Variation 1. Nf3 d5 2. g3 Bg4 +A07 King's Indian Attack: Keres Variation 1. Nf3 d5 2. g3 Bg4 3. Bg2 Nd7 +A07 King's Indian Attack: Keres Variation 1. Nf3 d5 2. g3 c6 3. Bg2 Bg4 4. O-O Nd7 +A07 King's Indian Attack: Keres Variation 1. Nf3 d5 2. g3 c6 3. Bg2 Bg4 4. O-O Nd7 5. d4 Ngf6 6. c4 e6 7. cxd5 exd5 8. Nc3 Bd6 +A07 King's Indian Attack: Omega-Delta Gambit 1. Nf3 d5 2. g3 e5 +A07 King's Indian Attack: Pachman System 1. Nf3 d5 2. g3 g6 3. Bg2 Bg7 4. O-O e5 5. d3 Ne7 +A07 King's Indian Attack: Sicilian Variation 1. Nf3 d5 2. g3 c5 +A07 King's Indian Attack: Yugoslav Variation 1. Nf3 Nf6 2. g3 d5 3. Bg2 c6 4. O-O Bg4 +A07 King's Indian Attack: Yugoslav Variation 1. c4 e6 2. Nf3 d5 3. g3 Nf6 4. Bg2 b6 5. O-O +A08 King's Indian Attack: French Variation 1. Nf3 d5 2. g3 c5 3. Bg2 Nc6 +A08 King's Indian Attack: Sicilian Variation 1. e4 e6 2. d3 d5 3. Nd2 Nf6 4. Ngf3 c5 5. g3 Nc6 6. Bg2 Be7 7. O-O O-O 8. Re1 +A08 King's Indian Attack: Sicilian Variation 1. Nf3 d5 2. g3 c5 3. Bg2 +A08 King's Indian Attack: Sicilian Variation 1. Nf3 d5 2. g3 c5 3. Bg2 Nf6 4. O-O e6 5. d3 +A08 Zukertort Opening: Reversed Grünfeld 1. Nf3 d5 2. g3 c5 3. Bg2 Nc6 4. d4 +A08 Zukertort Opening: Reversed Grünfeld 1. Nf3 d5 2. g3 c5 3. Bg2 Nc6 4. d4 Nf6 +A08 Zukertort Opening: Reversed Grünfeld 1. Nf3 d5 2. g3 c5 3. Bg2 Nc6 4. d4 Nf6 5. O-O +A08 Zukertort Opening: Reversed Grünfeld 1. Nf3 d5 2. g3 c5 3. Bg2 Nc6 4. d4 e6 5. O-O +A09 Réti Opening 1. Nf3 d5 2. c4 +A09 Réti Opening: Advance Variation 1. Nf3 d5 2. c4 d4 +A09 Réti Opening: Advance Variation, Michel Gambit 1. Nf3 d5 2. c4 d4 3. b4 c5 +A09 Réti Opening: Advance Variation, Navara Gambit 1. Nf3 d5 2. c4 d4 3. b4 g5 +A09 Réti Opening: Penguin Variation 1. Nf3 d5 2. c4 d4 3. Rg1 +A09 Réti Opening: Reversed Blumenfeld Gambit 1. Nf3 d5 2. c4 d4 3. e3 c5 4. b4 +A09 Réti Opening: Réti Accepted 1. Nf3 d5 2. c4 dxc4 +A09 Réti Opening: Réti Gambit, Keres Variation 1. Nf3 d5 2. c4 dxc4 3. e3 Be6 +A09 Réti Opening: Zilbermints Gambit 1. Nf3 d5 2. c4 b5 +A10 English Opening 1. c4 +A10 English Opening: Achilles-Omega Gambit 1. c4 Nf6 2. e4 +A10 English Opening: Adorjan Defense 1. c4 g6 2. e4 e5 +A10 English Opening: Anglo-Dutch Defense 1. c4 f5 +A10 English Opening: Anglo-Dutch Defense, Hickmann Gambit 1. c4 f5 2. e4 +A10 English Opening: Anglo-Dutch Variation, Chabanon Gambit 1. c4 f5 2. Nf3 d6 3. e4 +A10 English Opening: Anglo-Dutch Variation, Ferenc Gambit 1. c4 f5 2. Nc3 Nf6 3. e4 +A10 English Opening: Anglo-Lithuanian Variation 1. c4 Nc6 +A10 English Opening: Anglo-Scandinavian Defense 1. c4 d5 +A10 English Opening: Anglo-Scandinavian Defense, Löhn Gambit 1. c4 d5 2. cxd5 e6 +A10 English Opening: Anglo-Scandinavian Defense, Malvinas Variation 1. c4 d5 2. cxd5 Qxd5 3. Nc3 Qa5 +A10 English Opening: Anglo-Scandinavian Defense, Schulz Gambit 1. c4 d5 2. cxd5 Nf6 +A10 English Opening: Great Snake Variation 1. c4 g6 +A10 English Opening: Jaenisch Gambit 1. c4 b5 +A10 English Opening: King's English Variation, Botvinnik System, Prickly Pawn Pass System 1. c4 g6 2. Nc3 Bg7 3. g3 Nf6 4. Bg2 O-O 5. e4 d6 6. Nge2 e5 7. O-O c6 8. d3 a6 +A10 English Opening: Myers Defense 1. c4 g5 +A10 English Opening: Myers Gambit 1. c4 g5 2. d4 Bg7 +A10 English Opening: Porcupine Variation 1. c4 f5 2. Nc3 Nf6 3. e4 fxe4 4. g4 +A10 English Opening: Wade Gambit 1. c4 f5 2. g4 +A10 English Opening: Zilbermints Gambit 1. c4 g5 2. d4 e5 +A11 English Opening: Caro-Kann Defensive System 1. c4 c6 +A11 Réti Opening: Anglo-Slav Variation, Gurevich System 1. c4 c6 2. Nf3 d5 3. e3 +A11 Réti Opening: Anglo-Slav Variation, Gurevich System 1. c4 c6 2. Nf3 d5 3. e3 Nf6 4. Qc2 +A11 Réti Opening: Anglo-Slav Variation, Gurevich System 1. c4 c6 2. Nf3 d5 3. e3 Nf6 4. Nc3 Nbd7 5. Qc2 +A11 Réti Opening: Anglo-Slav Variation, Gurevich System 1. c4 c6 2. Nf3 d5 3. e3 Nf6 4. Nc3 Nbd7 5. b3 e5 +A11 Réti Opening: Anglo-Slav Variation, Gurevich System 1. c4 c6 2. Nf3 d5 3. e3 Nf6 4. Nc3 e6 5. b3 Bd6 +A11 Réti Opening: Anglo-Slav Variation, with g3 1. c4 c6 2. Nf3 d5 3. g3 Nf6 4. b3 g6 +A11 Réti Opening: Anglo-Slav Variation, with g3 1. c4 c6 2. Nf3 d5 3. g3 Nf6 4. Bg2 +A11 Réti Opening: Anglo-Slav Variation, with g3 1. c4 c6 2. Nf3 d5 3. g3 Nf6 4. Bg2 dxc4 +A11 Réti Opening: Anglo-Slav Variation, with g3 1. c4 c6 2. Nf3 d5 3. g3 Nf6 4. Bg2 Bf5 +A11 Réti Opening: Anglo-Slav Variation, with g3 1. c4 c6 2. Nf3 d5 3. g3 Nf6 4. Bg2 Bf5 5. O-O e6 6. d3 +A11 Réti Opening: Anglo-Slav Variation, with g3 1. Nf3 Nf6 2. g3 d5 3. Bg2 c6 4. O-O Bf5 5. d3 h6 6. c4 e6 +A12 Réti Opening: Anglo-Slav Variation 1. c4 Nf6 2. g3 c6 3. Nf3 d5 4. b3 +A12 Réti Opening: Anglo-Slav Variation, Bled Variation 1. Nf3 d5 2. b3 Nf6 3. Bb2 g6 4. c4 c6 +A12 Réti Opening: Anglo-Slav Variation, Bogoljubow Variation 1. Nf3 d5 2. c4 c6 3. b3 +A12 Réti Opening: Anglo-Slav Variation, Bogoljubow Variation 1. Nf3 d5 2. c4 c6 3. b3 Bg4 +A12 Réti Opening: Anglo-Slav Variation, Bogoljubow Variation 1. Nf3 d5 2. c4 c6 3. b3 Bf5 +A12 Réti Opening: Anglo-Slav Variation, Bogoljubow Variation 1. Nf3 d5 2. c4 c6 3. b3 Bf5 4. Bb2 +A12 Réti Opening: Anglo-Slav Variation, Capablanca Variation 1. c4 Nf6 2. Nf3 c6 3. b3 d5 4. Bb2 Bg4 +A12 Réti Opening: Anglo-Slav Variation, Capablanca Variation 1. c4 Nf6 2. Nf3 c6 3. b3 d5 4. Bb2 Bg4 5. e3 +A12 Réti Opening: Anglo-Slav Variation, Capablanca Variation 1. c4 Nf6 2. Nf3 c6 3. b3 d5 4. Bb2 Bg4 5. d3 +A12 Réti Opening: Anglo-Slav Variation, London Defensive System 1. c4 Nf6 2. g3 c6 3. Nf3 d5 4. b3 Bf5 +A12 Réti Opening: Anglo-Slav Variation, London Defensive System 1. c4 Nf6 2. g3 c6 3. Nf3 d5 4. b3 Bf5 5. Bg2 +A12 Réti Opening: Anglo-Slav Variation, London Defensive System 1. c4 Nf6 2. g3 c6 3. Nf3 d5 4. b3 Bf5 5. Bg2 e6 6. Bb2 +A12 Réti Opening: Anglo-Slav Variation, London Defensive System 1. c4 Nf6 2. g3 c6 3. Nf3 d5 4. b3 Bf5 5. Bb2 +A12 Réti Opening: Anglo-Slav Variation, New York System 1. Nf3 Nf6 2. c4 c6 3. b3 d5 4. Bb2 Bf5 +A12 Réti Opening: Anglo-Slav Variation, New York System 1. Nf3 Nf6 2. c4 c6 3. b3 d5 4. Bb2 Bf5 5. e3 +A12 Réti Opening: Anglo-Slav Variation, New York System 1. Nf3 Nf6 2. c4 c6 3. b3 d5 4. Bb2 Bf5 5. d3 +A12 Réti Opening: Anglo-Slav Variation, Torre System 1. c4 Nf6 2. g3 c6 3. Nf3 d5 4. b3 Bg4 +A12 Réti Opening: Anglo-Slav Variation, Torre System 1. c4 Nf6 2. g3 c6 3. Nf3 d5 4. b3 Bg4 5. Bg2 +A12 Réti Opening: Anglo-Slav Variation, Torre System 1. c4 Nf6 2. g3 c6 3. Nf3 d5 4. b3 Bg4 5. Bg2 e6 6. Bb2 +A12 Réti Opening: Anglo-Slav Variation, Torre System 1. c4 Nf6 2. g3 c6 3. Nf3 d5 4. b3 Bg4 5. Bb2 +A12 Réti Opening: Anglo-Slav Variation, with dxc4 1. c4 Nf6 2. g3 c6 3. Nf3 d5 4. b3 dxc4 +A13 English Opening: Agincourt Defense 1. c4 e6 +A13 English Opening: Agincourt Defense 1. c4 e6 2. Nf3 +A13 English Opening: Agincourt Defense 1. c4 e6 2. Nf3 d5 +A13 English Opening: Agincourt Defense 1. c4 e6 2. Nf3 d5 3. b3 Nf6 4. Bb2 Be7 5. e3 O-O +A13 English Opening: Agincourt Defense 1. c4 e6 2. Nf3 d5 3. b3 Nf6 4. Bb2 Be7 5. e3 O-O 6. d4 +A13 English Opening: Agincourt Defense, Bogoljubow Defense 1. c4 e6 2. Nf3 d5 3. g3 Nf6 4. Bg2 Bd6 +A13 English Opening: Agincourt Defense, Catalan Defense 1. c4 e6 2. Nf3 d5 3. g3 b6 4. Bg2 Bb7 5. O-O +A13 English Opening: Agincourt Defense, Catalan Defense 1. c4 e6 2. Nf3 d5 3. g3 c5 +A13 English Opening: Agincourt Defense, Catalan Defense Accepted 1. c4 e6 2. Nf3 Nf6 3. g3 d5 4. Bg2 dxc4 +A13 English Opening: Agincourt Defense, Catalan Defense, Semi-Slav Defense 1. c4 e6 2. Nf3 Nf6 3. g3 d5 4. Bg2 c6 +A13 English Opening: Agincourt Defense, Kurajica Defense 1. c4 e6 2. Nf3 d5 3. g3 c6 +A13 English Opening: Agincourt Defense, Tarrasch Defense 1. c4 e6 2. Nf3 d5 3. g3 Nf6 4. Bg2 c5 5. b3 Nc6 6. O-O Be7 +A13 English Opening: Agincourt Defense, Wimpy System 1. c4 e6 2. Nf3 Nf6 3. b3 d5 4. Bb2 c5 5. e3 +A13 English Opening: Neo-Catalan 1. c4 e6 2. Nf3 d5 3. g3 Nf6 +A13 English Opening: Neo-Catalan Declined 1. c4 e6 2. Nf3 d5 3. g3 Nf6 4. Bg2 Be7 +A13 English Opening: Romanishin Gambit 1. c4 Nf6 2. Nf3 e6 3. g3 a6 4. Bg2 b5 +A14 English Opening: Agincourt Defense, Keres Defense 1. c4 e6 2. Nf3 d5 3. g3 Nf6 4. Bg2 Be7 5. O-O c5 6. cxd5 Nxd5 7. Nc3 Nc6 +A14 English Opening: Agincourt Defense, Neo-Catalan Declined 1. c4 e6 2. Nf3 d5 3. g3 Nf6 4. Bg2 Be7 5. O-O +A14 English Opening: Agincourt Defense, Neo-Catalan Declined 1. c4 e6 2. Nf3 d5 3. g3 Nf6 4. Bg2 Be7 5. O-O O-O 6. b3 +A14 English Opening: Agincourt Defense, Neo-Catalan Declined 1. Nf3 d5 2. g3 Nf6 3. Bg2 e6 4. O-O Be7 5. c4 O-O 6. b3 c5 +A14 English Opening: Agincourt Defense, Neo-Catalan Declined 1. Nf3 d5 2. g3 Nf6 3. Bg2 e6 4. O-O Be7 5. c4 O-O 6. b3 c5 7. e3 +A14 English Opening: Agincourt Defense, Neo-Catalan Declined 1. Nf3 d5 2. g3 Nf6 3. Bg2 e6 4. O-O Be7 5. c4 O-O 6. b3 c5 7. e3 d4 +A14 English Opening: Agincourt Defense, Neo-Catalan Declined 1. Nf3 d5 2. g3 Nf6 3. Bg2 e6 4. O-O Be7 5. c4 O-O 6. b3 c5 7. e3 Nc6 +A14 English Opening: Agincourt Defense, Neo-Catalan Declined, Early b3 1. c4 e6 2. Nf3 d5 3. g3 Nf6 4. Bg2 Be7 5. b3 +A14 English Opening: Agincourt Defense, Neo-Catalan Declined, Early b3 1. c4 e6 2. Nf3 d5 3. g3 Nf6 4. Bg2 Be7 5. b3 b6 +A14 English Opening: Agincourt Defense, Neo-Catalan Declined, Early b3 1. c4 e6 2. Nf3 d5 3. g3 Nf6 4. Bg2 Be7 5. b3 c5 +A14 Réti Opening: Anglo-Slav Variation 1. Nf3 d5 2. c4 c6 3. g3 Nf6 4. Bg2 e6 5. b3 Be7 6. Bb2 +A14 Réti Opening: Anglo-Slav Variation, Bogoljubow Variation, Stonewall Line 1. Nf3 d5 2. c4 e6 3. g3 Nf6 4. Bg2 Be7 5. O-O O-O 6. b3 c6 7. Bb2 +A15 English Opening: Anglo-Indian Defense 1. c4 Nf6 +A15 English Opening: Anglo-Indian Defense, Anti-Anti-Grünfeld 1. c4 Nf6 2. Nc3 g6 3. Nf3 Bg7 4. e4 +A15 English Opening: Anglo-Indian Defense, Grünfeld Formation 1. c4 Nf6 2. Nf3 g6 3. g3 d5 +A15 English Opening: Anglo-Indian Defense, King's Indian Formation 1. c4 Nf6 2. Nf3 g6 +A15 English Opening: Anglo-Indian Defense, King's Indian Formation, Double Fianchetto 1. c4 Nf6 2. Nf3 g6 3. g3 b6 4. Bg2 Bb7 +A15 English Opening: Anglo-Indian Defense, King's Knight Variation 1. c4 Nf6 2. Nf3 +A15 English Opening: Anglo-Indian Defense, Old Indian Formation 1. c4 Nf6 2. Nf3 d6 +A15 English Opening: Anglo-Indian Defense, Queen's Indian Formation 1. c4 Nf6 2. Nf3 b6 +A15 English Opening: Anglo-Indian Defense, Queen's Indian Formation 1. c4 e6 2. Nf3 Nf6 3. g3 b6 4. Bg2 Bb7 +A15 English Opening: Anglo-Indian Defense, Romanishin Variation 1. c4 e6 2. Nf3 Nf6 3. g3 a6 +A15 English Opening: Anglo-Indian Defense, Scandinavian Defense 1. c4 Nf6 2. Nf3 d5 +A15 English Opening: Anglo-Indian Defense, Scandinavian Defense, Exchange Variation 1. c4 Nf6 2. Nf3 d5 3. cxd5 Nxd5 +A15 English Opening: Anglo-Indian Defense, Slav Formation 1. c4 Nf6 2. Nf3 g6 3. g3 c6 +A15 English Orangutan 1. c4 Nf6 2. b4 +A15 English Orangutan 1. c4 Nf6 2. Nf3 g6 3. b4 +A16 English Opening: Anglo-Grünfeld Defense 1. c4 Nf6 2. Nc3 d5 +A16 English Opening: Anglo-Grünfeld Defense, Korchnoi Variation 1. c4 Nf6 2. Nc3 d5 3. cxd5 Nxd5 4. Nf3 g6 5. g3 Bg7 6. Bg2 e5 +A16 English Opening: Anglo-Indian Defense, Anglo-Grünfeld Variation 1. c4 Nf6 2. Nc3 d5 3. cxd5 Nxd5 4. Nf3 +A16 English Opening: Anglo-Indian Defense, Anglo-Grünfeld Variation 1. c4 Nf6 2. Nc3 d5 3. cxd5 Nxd5 4. Nf3 g6 +A16 English Opening: Anglo-Indian Defense, Anglo-Grünfeld Variation 1. c4 Nf6 2. Nc3 d5 3. cxd5 Nxd5 4. g3 g6 5. Bg2 Nb6 +A16 English Opening: Anglo-Indian Defense, Anglo-Grünfeld Variation 1. c4 Nf6 2. Nc3 d5 3. cxd5 Nxd5 4. g3 g6 5. Bg2 Nxc3 +A16 English Opening: Anglo-Indian Defense, Queen's Knight Variation 1. c4 Nf6 2. Nc3 +A17 English Opening: Anglo-Indian Defense 1. c4 Nf6 2. Nc3 d5 3. cxd5 Nxd5 4. Nf3 c5 5. e3 e6 +A17 English Opening: Anglo-Indian Defense, Hedgehog System 1. c4 Nf6 2. Nc3 e6 +A17 English Opening: Anglo-Indian Defense, Nimzo-English 1. c4 Nf6 2. Nc3 e6 3. Nf3 Bb4 +A17 English Opening: Anglo-Indian Defense, Queen's Indian Formation 1. c4 e6 2. Nc3 Nf6 3. Nf3 b6 +A17 English Opening: Anglo-Indian Defense, Queen's Indian Variation 1. c4 e6 2. Nc3 Nf6 3. Nf3 b6 4. e4 Bb7 5. Bd3 +A17 English Opening: Anglo-Indian Defense, Zvjaginsev-Krasenkow Attack 1. c4 e6 2. Nc3 Nf6 3. Nf3 Bb4 4. g4 +A18 English Opening: Mikenas-Carls Variation 1. c4 e6 2. Nc3 Nf6 3. e4 +A18 English Opening: Mikenas-Carls Variation 1. c4 e6 2. Nc3 Nf6 3. e4 Nc6 +A18 English Opening: Mikenas-Carls Variation 1. c4 e6 2. Nc3 Nf6 3. e4 d5 4. e5 +A19 English Opening: Anglo-Indian Defense, Flohr-Mikenas-Carls Variation, Nei Gambit 1. c4 e6 2. Nc3 Nf6 3. e4 c5 4. e5 Ng8 +A19 English Opening: Mikenas-Carls, Sicilian 1. c4 e6 2. Nc3 Nf6 3. e4 c5 +A20 English Opening: Drill Variation 1. c4 e5 2. g3 h5 +A20 English Opening: King's English Variation 1. c4 e5 +A20 English Opening: King's English Variation, Kahiko-Hula Gambit 1. c4 e5 2. e3 Nf6 3. f4 exf4 4. Nf3 +A20 English Opening: King's English Variation, Nimzowitsch Variation 1. c4 e5 2. Nf3 +A20 English Opening: King's English Variation, Nimzowitsch-Flohr Variation 1. c4 e5 2. Nf3 e4 +A21 English Opening: King's English Variation 1. c4 e5 2. Nc3 d6 3. Nf3 +A21 English Opening: King's English Variation, Keres Defense 1. c4 e5 2. Nc3 d6 3. g3 c6 +A21 English Opening: King's English Variation, Kramnik-Shirov Counterattack 1. c4 e5 2. Nc3 Bb4 +A21 English Opening: King's English Variation, Reversed Sicilian 1. c4 e5 2. Nc3 +A21 English Opening: King's English Variation, Smyslov Defense 1. c4 e5 2. Nc3 d6 3. Nf3 Bg4 +A21 English Opening: King's English Variation, Troger Defense 1. c4 e5 2. Nc3 Nc6 3. g3 d6 4. Bg2 Be6 +A22 English Opening: Carls-Bremen System 1. c4 e5 2. Nc3 Nf6 3. g3 +A22 English Opening: King's English Variation, Adhiban Gambit 1. c4 e5 2. Nc3 Nf6 3. Nf3 e4 4. Ng5 c6 +A22 English Opening: King's English Variation, Bellon Gambit 1. c4 e5 2. Nc3 Nf6 3. Nf3 e4 4. Ng5 b5 +A22 English Opening: King's English Variation, Two Knights Variation 1. c4 e5 2. Nc3 Nf6 +A22 English Opening: King's English Variation, Two Knights Variation, Reversed Dragon 1. c4 e5 2. Nc3 Nf6 3. g3 d5 +A22 English Opening: King's English Variation, Two Knights Variation, Smyslov System 1. c4 e5 2. Nc3 Nf6 3. g3 Bb4 +A22 English Opening: King's English, Erbenheimer Gambit 1. c4 e5 2. Nc3 Nf6 3. Nf3 e4 4. Ng5 Ng4 +A22 English Opening: King's English, Mazedonisch 1. c4 e5 2. Nc3 Nf6 3. f4 +A23 English Opening: King's English Variation, Two Knights Variation, Keres Variation 1. c4 e5 2. Nc3 Nf6 3. g3 c6 +A23 English Opening: King's English Variation, Two Knights Variation, Keres Variation 1. c4 e5 2. Nc3 Nf6 3. g3 Bc5 4. Bg2 c6 +A24 English Opening: King's English Variation, Two Knights Variation, Fianchetto Line 1. c4 e5 2. Nc3 Nf6 3. g3 g6 +A25 English Opening: Closed, Taimanov Variation 1. c4 e5 2. Nc3 Nc6 3. g3 g6 4. Rb1 Nh6 5. Bg2 Bg7 +A25 English Opening: Closed, Taimanov Variation 1. c4 e5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. e3 d6 6. Nge2 Nh6 +A25 English Opening: King's English Variation, Bremen-Hort Variation 1. c4 e5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. e3 d6 6. Nge2 Be6 +A25 English Opening: King's English Variation, Closed System 1. c4 e5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. d3 +A25 English Opening: King's English Variation, Hungarian Attack 1. c4 e5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. Rb1 +A25 English Opening: King's English Variation, Reversed Closed Sicilian 1. c4 e5 2. Nc3 Nc6 +A25 English Opening: King's English Variation, Reversed Closed Sicilian 1. c4 e5 2. g3 Nf6 3. Bg2 Nc6 4. Nc3 Bb4 5. Nd5 +A25 English Opening: King's English Variation, Reversed Closed Sicilian 1. c4 e5 2. g3 Nf6 3. Bg2 Nc6 4. Nc3 Bb4 5. e4 d6 6. Nge2 +A25 English Opening: King's English Variation, Reversed Closed Sicilian 1. c4 e5 2. g3 Nf6 3. Bg2 Nc6 4. Nc3 Bb4 5. e4 d6 6. Nge2 Bg4 +A25 English Opening: King's English Variation, Reversed Closed Sicilian 1. c4 e5 2. Nc3 Nf6 3. g3 Bb4 4. e4 O-O 5. Nge2 Nc6 6. Bg2 +A25 English Opening: King's English Variation, Taimanov Variation 1. c4 e5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 +A26 English Opening: King's English Variation, Botvinnik System 1. c4 e5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. d3 d6 6. e4 +A26 English Opening: King's English Variation, Closed System, Full Symmetry 1. c4 e5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. d3 d6 +A27 English Opening: King's English Variation, Three Knights System 1. c4 e5 2. Nc3 Nc6 3. Nf3 +A28 English Opening: Four Knights System, Nimzowitsch Variation 1. c4 e5 2. Nc3 Nf6 3. Nf3 Nc6 4. e4 +A28 English Opening: King's English Variation, Four Knights Variation 1. c4 e5 2. Nc3 Nf6 3. Nf3 Nc6 +A28 English Opening: King's English Variation, Four Knights Variation 1. c4 e5 2. Nc3 Nf6 3. Nf3 Nc6 4. d4 exd4 5. Nxd4 Bb4 6. Bg5 h6 7. Bh4 Bxc3+ 8. bxc3 Ne5 +A28 English Opening: King's English Variation, Four Knights Variation, Bradley Beach Variation 1. c4 e5 2. Nc3 Nf6 3. Nf3 Nc6 4. d4 e4 +A28 English Opening: King's English Variation, Four Knights Variation, Flexible Line 1. c4 e5 2. Nc3 Nf6 3. Nf3 Nc6 4. d3 +A28 English Opening: King's English Variation, Four Knights Variation, Korchnoi Line 1. c4 e5 2. Nc3 Nf6 3. Nf3 Nc6 4. a3 +A28 English Opening: King's English Variation, Four Knights Variation, Quiet Line 1. c4 e5 2. Nc3 Nf6 3. Nf3 Nc6 4. e3 +A28 English Opening: King's English Variation, Four Knights Variation, Quiet Line 1. c4 e5 2. Nc3 Nf6 3. Nf3 Nc6 4. e3 Bb4 5. Qc2 Bxc3 +A28 English Opening: King's English Variation, Four Knights Variation, Quiet Line 1. c4 e5 2. Nc3 Nf6 3. Nf3 Nc6 4. e3 Bb4 5. Qc2 O-O 6. Nd5 Re8 7. Qf5 +A29 English Opening: King's English Variation, Four Knights Variation, Fianchetto Line 1. c4 e5 2. Nc3 Nf6 3. Nf3 Nc6 4. g3 +A29 English Opening: King's English Variation, Four Knights Variation, Fianchetto Line 1. c4 e5 2. Nc3 Nf6 3. Nf3 Nc6 4. g3 Bb4 +A29 English Opening: King's English Variation, Four Knights Variation, Fianchetto Line 1. c4 e5 2. Nc3 Nf6 3. Nf3 Nc6 4. g3 Bb4 5. Bg2 Bxc3 6. dxc3 d6 7. O-O O-O +A29 English Opening: King's English Variation, Four Knights Variation, Fianchetto Line 1. c4 e5 2. g3 Nf6 3. Bg2 d5 4. cxd5 Nxd5 5. Nf3 Nc6 +A29 English Opening: King's English Variation, Four Knights Variation, Fianchetto Line 1. c4 e5 2. g3 Nf6 3. Bg2 d5 4. cxd5 Nxd5 5. Nf3 Nc6 6. d3 +A29 English Opening: King's English Variation, Four Knights Variation, Fianchetto Line 1. c4 e5 2. g3 Nf6 3. Bg2 d5 4. cxd5 Nxd5 5. Nf3 Nc6 6. d3 Be7 7. O-O O-O +A29 English Opening: King's English Variation, Four Knights Variation, Fianchetto Line, Delayed .. Nc6 1. c4 e5 2. Nc3 Nf6 3. g3 Bb4 4. Bg2 O-O 5. Nf3 Re8 6. O-O e4 7. Nd4 Nc6 +A29 English Opening: King's English Variation, Four Knights Variation, Fianchetto Line, with .. d6 1. c4 e5 2. Nc3 Nf6 3. Nf3 Nc6 4. g3 Bc5 5. d3 d6 6. Bg2 +A29 English Opening: King's English Variation, Four Knights Variation, Fianchetto Line, with .. d6 1. c4 e5 2. Nc3 Nf6 3. Nf3 Nc6 4. g3 Bc5 5. d3 d6 6. Bg2 O-O 7. O-O +A29 English Opening: King's English Variation, Four Knights Variation, Fianchetto Line, with .. d6, Be7 1. c4 e5 2. Nc3 Nf6 3. g3 Nc6 4. Bg2 d6 5. d3 Be7 6. Nf3 O-O +A29 English Opening: King's English Variation, Four Knights Variation, Fianchetto Line, with .. d6, a6 1. c4 e5 2. Nc3 Nf6 3. Nf3 Nc6 4. g3 Bc5 5. d3 d6 6. Bg2 a6 +A29 English Opening: King's English Variation, Four Knights Variation, Fianchetto Line, with .. d6, h6 1. c4 e5 2. Nc3 Nf6 3. Nf3 Nc6 4. g3 Bc5 5. d3 d6 6. Bg2 h6 +A29 English Opening: King's English Variation, Four Knights Variation, Fianchetto Line, with Bc5 1. c4 e5 2. Nc3 Nf6 3. Nf3 Nc6 4. g3 d5 5. cxd5 Nxd5 6. Bg2 Bc5 +A29 English Opening: King's English Variation, Four Knights Variation, Fianchetto Line, with Nb6 1. c4 e5 2. Nc3 Nf6 3. Nf3 Nc6 4. g3 d5 5. cxd5 Nxd5 6. Bg2 Nb6 +A30 English Opening: Symmetrical Variation 1. c4 c5 +A30 English Opening: Symmetrical Variation 1. c4 c5 2. Nf3 +A30 English Opening: Symmetrical Variation, Hedgehog Defense 1. c4 e6 2. Nf3 Nf6 3. Nc3 c5 4. g3 b6 5. Bg2 Bb7 6. O-O Be7 +A30 English Opening: Symmetrical Variation, Napolitano Gambit 1. c4 c5 2. Nf3 Nf6 3. b4 +A30 English Opening: Symmetrical, Hedgehog, Flexible Formation 1. c4 e6 2. Nf3 c5 3. Nc3 Nf6 4. g3 b6 5. Bg2 Bb7 6. O-O Be7 7. d4 cxd4 8. Qxd4 d6 9. Rd1 a6 10. b3 Nbd7 +A30 English Opening: Wing Gambit 1. c4 c5 2. b4 +A31 English Opening: Symmetrical Variation, Anti-Benoni Variation 1. c4 Nf6 2. d4 c5 3. Nf3 +A31 English Opening: Symmetrical Variation, Anti-Benoni Variation, Kasparov-Vaganian Gambit 1. d4 Nf6 2. c4 c5 3. Nf3 cxd4 4. Nxd4 e5 5. Nb5 d5 +A32 English Opening: Symmetrical Variation, Anti-Benoni Variation, Spielmann Defense 1. c4 e6 2. d4 c5 3. Nf3 cxd4 4. Nxd4 Nf6 +A33 English Opening: Symmetrical Variation, Anti-Benoni Variation, Geller Variation 1. c4 e6 2. Nf3 Nf6 3. Nc3 c5 4. d4 Nc6 5. g3 cxd4 6. Nxd4 Qb6 +A33 English Opening: Symmetrical Variation, Anti-Benoni Variation, Spielmann Defense 1. c4 e6 2. Nf3 Nf6 3. Nc3 c5 4. d4 cxd4 5. Nxd4 Nc6 +A34 English Opening: Symmetrical Variation 1. c4 c5 2. Nf3 Nf6 3. Nc3 Nc6 4. g3 d5 5. d4 cxd4 +A34 English Opening: Symmetrical Variation, Fianchetto Variation 1. c4 Nf6 2. Nc3 c5 3. g3 +A34 English Opening: Symmetrical Variation, Normal Variation 1. c4 c5 2. Nc3 +A34 English Opening: Symmetrical Variation, Rubinstein Variation 1. c4 Nf6 2. Nc3 c5 3. g3 d5 4. cxd5 Nxd5 5. Bg2 Nc7 +A34 English Opening: Symmetrical Variation, Rubinstein Variation 1. c4 c5 2. Nf3 Nf6 3. Nc3 d5 4. cxd5 Nxd5 5. g3 Nc6 6. Bg2 Nc7 +A34 English Opening: Symmetrical Variation, Three Knights Variation 1. c4 c5 2. Nc3 Nf6 3. Nf3 +A35 English Opening: Symmetrical Variation 1. c4 c5 2. Nc3 Nf6 3. Nf3 e5 +A35 English Opening: Symmetrical Variation, Four Knights Variation 1. c4 c5 2. Nf3 Nf6 3. Nc3 Nc6 +A35 English Opening: Symmetrical Variation, Four Knights Variation, Keres-Parma System 1. c4 c5 2. Nf3 Nf6 3. Nc3 Nc6 4. g3 e6 +A35 English Opening: Symmetrical Variation, Two Knights Variation 1. c4 c5 2. Nc3 Nc6 +A36 English Opening: Symmetrical Variation, Botvinnik System 1. c4 c5 2. e4 Nc6 3. Nc3 g6 4. g3 Bg7 5. Bg2 +A36 English Opening: Symmetrical Variation, Botvinnik System Reversed, with e3 1. c4 c5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. e3 e5 +A36 English Opening: Symmetrical Variation, Two Knights, Fianchetto Variation 1. c4 c5 2. Nc3 Nc6 3. g3 +A36 English Opening: Symmetrical Variation, Ultra-Symmetrical Variation 1. c4 c5 2. g3 g6 3. Bg2 Bg7 4. Nc3 Nc6 +A37 English Opening: Symmetrical Variation, Botvinnik System Reversed, with Nf3 1. c4 c5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. Nf3 e5 +A37 English Opening: Symmetrical Variation, Botvinnik System Reversed, with Nf3 1. c4 c5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. Nf3 e5 6. O-O d6 +A37 English Opening: Symmetrical Variation, Botvinnik System Reversed, with Nf3 1. c4 c5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. Nf3 e5 6. O-O Nge7 +A37 English Opening: Symmetrical Variation, Botvinnik System Reversed, with Nf3 1. c4 c5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. Nf3 e5 6. O-O Nge7 7. a3 +A37 English Opening: Symmetrical Variation, Botvinnik System Reversed, with Nf3 1. c4 c5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. Nf3 e5 6. O-O Nge7 7. d3 +A37 English Opening: Symmetrical Variation, Botvinnik System Reversed, with Nf3 1. c4 c5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. Nf3 e5 6. O-O Nge7 7. d3 d6 +A37 English Opening: Symmetrical Variation, Three Knights, Fianchetto Variation 1. c4 c5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. Nf3 +A37 English Opening: Symmetrical Variation, Three Knights, Fianchetto Variation 1. c4 c5 2. Nf3 Nc6 3. g3 g6 4. Bg2 Bg7 5. O-O d6 6. Nc3 +A37 English Opening: Symmetrical Variation, Three Knights, Fianchetto Variation 1. c4 c5 2. Nf3 Nc6 3. g3 g6 4. Bg2 Bg7 5. O-O e6 6. Nc3 +A38 English Opening: Symmetrical Variation, Double Fianchetto 1. c4 c5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. Nf3 Nf6 6. O-O O-O 7. b3 +A38 English Opening: Symmetrical Variation, Duchamp Variation 1. c4 Nf6 2. Nf3 g6 3. g3 Bg7 4. Bg2 O-O 5. O-O c5 6. Nc3 Nc6 7. d3 +A38 English Opening: Symmetrical Variation, Full Symmetry Line 1. c4 Nf6 2. Nf3 c5 3. Nc3 Nc6 4. g3 g6 5. Bg2 Bg7 +A39 English Opening: Symmetrical Variation, Mecking Variation 1. c4 Nf6 2. Nf3 c5 3. Nc3 Nc6 4. g3 g6 5. Bg2 Bg7 6. O-O O-O 7. d4 +A40 Australian Defense 1. d4 Na6 +A40 Benoni Defense: Franco-Sicilian Hybrid 1. d4 e6 2. c4 c5 3. d5 exd5 4. cxd5 d6 5. Nc3 g6 6. e4 Bg7 7. Nf3 Ne7 +A40 Borg Defense: Borg Gambit 1. d4 g5 +A40 Colle System: Pterodactyl Variation 1. d4 g6 2. Nf3 Bg7 3. e3 c5 4. Bd3 Qa5+ +A40 Colle System: Siroccopteryx Variation 1. d4 g6 2. Nf3 Bg7 3. e3 c5 4. Bd3 cxd4 5. Nxd4 Qa5+ +A40 English Defense 1. d4 b6 +A40 English Defense 1. d4 e6 2. c4 b6 +A40 English Defense: Eastbourne Gambit 1. d4 b6 2. c4 Bb7 3. Nc3 e5 +A40 English Defense: Hartlaub Gambit Accepted 1. c4 e6 2. d4 b6 3. Nc3 Bb7 4. e4 f5 5. exf5 Nf6 +A40 English Defense: Hartlaub Gambit Declined 1. c4 e6 2. d4 b6 3. Nc3 Bb7 4. e4 f5 5. d5 +A40 English Defense: Perrin Variation 1. d4 e6 2. c4 b6 3. e4 Bb7 4. Bd3 Nc6 +A40 English Defense: Poli Gambit 1. d4 e6 2. c4 b6 3. e4 Bb7 4. f3 f5 5. exf5 Nh6 +A40 Englund Gambit 1. d4 e5 +A40 Englund Gambit Declined 1. d4 e5 2. d5 +A40 Englund Gambit Declined: Diemer Counterattack 1. d4 e5 2. d5 Bc5 3. e4 Qh4 +A40 Englund Gambit Declined: Reversed Alekhine 1. d4 e5 2. Nf3 +A40 Englund Gambit Declined: Reversed Brooklyn 1. d4 e5 2. Nf3 e4 3. Ng1 +A40 Englund Gambit Declined: Reversed French 1. d4 e5 2. e3 +A40 Englund Gambit Declined: Reversed Krebs 1. d4 e5 2. Nf3 e4 +A40 Englund Gambit Declined: Reversed Mokele Mbembe 1. d4 e5 2. Nf3 e4 3. Ne5 +A40 Englund Gambit: Felbecker Gambit 1. d4 e5 2. dxe5 Nc6 3. Nf3 Bc5 +A40 Englund Gambit: Hartlaub-Charlick Gambit 1. d4 e5 2. dxe5 d6 +A40 Englund Gambit: Main Line 1. d4 e5 2. dxe5 Nc6 3. Nf3 Qe7 +A40 Englund Gambit: Mosquito Gambit 1. d4 e5 2. dxe5 Qh4 +A40 Englund Gambit: Soller Gambit 1. d4 e5 2. dxe5 f6 +A40 Englund Gambit: Soller Gambit Deferred 1. d4 e5 2. dxe5 Nc6 3. Nf3 f6 +A40 Englund Gambit: Stockholm Variation 1. d4 e5 2. dxe5 Nc6 3. Nf3 Qe7 4. Qd5 +A40 Englund Gambit: Zilbermints Gambit 1. d4 e5 2. dxe5 Nc6 3. Nf3 Nge7 +A40 Horwitz Defense 1. d4 e6 +A40 Horwitz Defense: Zilbermints Gambit 1. d4 e6 2. c4 e5 +A40 Kangaroo Defense 1. d4 e6 2. c4 Bb4+ +A40 Kangaroo Defense: Keres Defense, Transpositional Variation 1. d4 e6 2. c4 Bb4+ 3. Nc3 +A40 Mikenas Defense 1. d4 Nc6 +A40 Mikenas Defense: Cannstatter Variation 1. d4 Nc6 2. c4 e5 3. d5 Nd4 +A40 Mikenas Defense: Lithuanian Variation 1. d4 Nc6 2. c4 e5 3. d5 Nce7 +A40 Mikenas Defense: Pozarek Gambit 1. d4 Nc6 2. c4 e5 3. dxe5 Nxe5 4. Nc3 Nxc4 +A40 Modern Defense: Beefeater Variation 1. d4 g6 2. c4 Bg7 3. Nc3 c5 4. d5 Bxc3+ 5. bxc3 f5 +A40 Modern Defense: Lizard Defense, Pirc-Diemer Gambit 1. d4 g6 2. h4 Nf6 3. h5 +A40 Montevideo Defense 1. d4 Nc6 2. d5 Nb8 +A40 Polish Defense 1. d4 b5 +A40 Polish Defense: Spassky Gambit Accepted 1. d4 b5 2. e4 Bb7 3. Bxb5 +A40 Pterodactyl Defense: Central, Benoni Beefeater Pterodactyl 1. d4 g6 2. c4 Bg7 3. Nc3 c5 4. d5 d6 5. e4 Bxc3+ 6. bxc3 Qa5 +A40 Pterodactyl Defense: Central, Benoni Pterodactyl 1. d4 g6 2. c4 Bg7 3. e4 c5 4. d5 Qa5+ +A40 Pterodactyl Defense: Fianchetto, Queen Benoni Pterodactyl 1. d4 g6 2. c4 Bg7 3. Nc3 c5 4. d5 Qa5 +A40 Pterodactyl Defense: Fianchetto, Queen Pteranodon 1. d4 g6 2. c4 Bg7 3. Nc3 c5 4. d5 Bxc3+ 5. bxc3 Qa5 +A40 Pterodactyl Defense: Fianchetto, Queen Pterodactyl 1. d4 g6 2. Nf3 Bg7 3. g3 c5 4. Bg2 Qa5+ +A40 Pterodactyl Defense: Queen Pterodactyl, Quiet Line 1. d4 g6 2. c4 Bg7 3. Nc3 c5 4. e3 +A40 Queen's Pawn Game 1. d4 +A40 Queen's Pawn Game: Anglo-Slav Opening 1. d4 c6 2. c4 d6 +A40 Queen's Pawn Game: Modern Defense 1. d4 g6 +A40 Slav Indian: Kudischewitsch Gambit 1. d4 c6 2. Nf3 Nf6 3. c4 b5 +A40 Zaire Defense 1. d4 Nc6 2. d5 Nb8 3. e4 Nf6 4. e5 Ng8 +A41 Modern Defense 1. d4 g6 2. c4 Bg7 3. Nc3 d6 +A41 Modern Defense: Neo-Modern Defense 1. d4 g6 2. c4 Bg7 3. e4 e5 +A41 Old Indian Defense 1. d4 d6 2. c4 +A41 Queen's Pawn Game 1. d4 d6 +A41 Queen's Pawn Game: Rossolimo Variation 1. d4 d6 2. Nf3 g6 +A41 Rat Defense: English Rat 1. d4 d6 2. c4 e5 +A41 Rat Defense: English Rat, Lisbon Gambit 1. d4 d6 2. c4 e5 3. dxe5 Nc6 +A41 Rat Defense: English Rat, Pounds Gambit 1. d4 d6 2. c4 e5 3. dxe5 Be6 +A41 Robatsch Defense: Rossolimo Variation 1. d4 d6 2. Nf3 g6 3. c4 Bg7 4. e4 Bg4 +A41 Wade Defense 1. d4 d6 2. Nf3 Bg4 +A41 Zukertort Opening: Wade Defense, Chigorin Plan 1. d4 d6 2. Nf3 Bg4 3. c4 Nd7 4. Qb3 Rb8 +A42 Modern Defense: Averbakh System 1. d4 g6 2. c4 Bg7 3. Nc3 d6 4. e4 +A42 Modern Defense: Averbakh Variation, Pseudo-Sämisch 1. d4 g6 2. c4 Bg7 3. e4 d6 4. Be3 Nf6 5. f3 +A42 Modern Defense: Kotov Variation 1. d4 g6 2. c4 Bg7 3. Nc3 d6 4. e4 Nc6 +A42 Modern Defense: Randspringer Variation 1. d4 g6 2. c4 Bg7 3. Nc3 d6 4. e4 f5 +A42 Pterodactyl Defense 1. Nf3 c5 2. c4 g6 3. d4 Bg7 4. e4 Qa5+ 5. Nc3 d6 +A42 Pterodactyl Defense: Central, Bogolubovia 1. d4 g6 2. c4 Bg7 3. e4 d6 4. Nc3 c5 5. Nge2 Qa5 +A43 Benoni Defense: Benoni Gambit Accepted 1. d4 c5 2. dxc5 +A43 Benoni Defense: Benoni Gambit, Schlenker Defense 1. d4 c5 2. dxc5 Na6 +A43 Benoni Defense: Benoni-Indian Defense 1. d4 c5 2. d5 Nf6 +A43 Benoni Defense: Benoni-Indian Defense, Kingside Move Order 1. d4 c5 2. d5 Nf6 3. Nf3 +A43 Benoni Defense: Benoni-Staunton Gambit 1. d4 c5 2. d5 f5 3. e4 +A43 Benoni Defense: Cormorant Gambit 1. d4 c5 2. dxc5 b6 +A43 Benoni Defense: French Benoni 1. e4 e6 2. d4 c5 3. d5 +A43 Benoni Defense: Hawk Variation 1. d4 Nf6 2. Nf3 c5 3. d5 c4 +A43 Benoni Defense: Old Benoni 1. d4 c5 +A43 Benoni Defense: Old Benoni 1. d4 c5 2. d5 +A43 Benoni Defense: Old Benoni 1. d4 c5 2. d5 d6 +A43 Benoni Defense: Old Benoni, Mujannah Formation 1. d4 c5 2. d5 f5 +A43 Benoni Defense: Old Benoni, Schmid Variation 1. d4 c5 2. d5 d6 3. Nc3 g6 +A43 Benoni Defense: Snail Variation 1. d4 c5 2. d5 Na6 +A43 Benoni Defense: Woozle 1. d4 c5 2. d5 Nf6 3. Nc3 Qa5 +A43 Benoni Defense: Zilbermints-Benoni Gambit 1. d4 c5 2. b4 +A43 Benoni Defense: Zilbermints-Benoni Gambit 1. d4 c5 2. Nf3 cxd4 3. b4 +A43 Benoni Defense: Zilbermints-Benoni Gambit, Tamarkin Countergambit 1. d4 c5 2. Nf3 cxd4 3. b4 e5 +A43 Indian Defense: Pseudo-Benko 1. d4 Nf6 2. Nf3 c5 3. d5 b5 +A43 Queen's Pawn Game: Liedmann Gambit 1. d4 c5 2. c4 cxd4 3. e3 +A44 Benoni Defense: Old Benoni 1. d4 c5 2. d5 e5 +A44 Benoni Defense: Semi-Benoni 1. d4 c5 2. d5 e5 3. e4 d6 +A45 Amazon Attack: Siberian Attack 1. d4 Nf6 2. Nc3 d5 3. Qd3 +A45 Basque Opening 1. d4 Nf6 2. b3 +A45 Canard Opening 1. d4 Nf6 2. f4 +A45 Indian Defense 1. d4 Nf6 +A45 Indian Defense: Accelerated London System 1. d4 Nf6 2. Bf4 +A45 Indian Defense: Gedult Attack 1. d4 Nf6 2. f3 d5 3. g4 +A45 Indian Defense: Gibbins-Weidenhagen Gambit 1. d4 Nf6 2. g4 +A45 Indian Defense: Gibbins-Weidenhagen Gambit Accepted 1. d4 Nf6 2. g4 Nxg4 +A45 Indian Defense: Gibbins-Weidenhagen Gambit, Maltese Falcon 1. d4 Nf6 2. g4 Nxg4 3. f3 Nf6 4. e4 +A45 Indian Defense: Gibbins-Weidenhagen Gambit, Oshima Defense 1. d4 Nf6 2. g4 e5 +A45 Indian Defense: Gibbins-Weidenhagen Gambit, Stummer Gambit 1. d4 Nf6 2. g4 Nxg4 3. e4 d6 4. Be2 Nf6 5. Nc3 +A45 Indian Defense: Lazard Gambit 1. d4 Nf6 2. Nd2 e5 +A45 Indian Defense: Maddigan Gambit 1. d4 Nf6 2. Nc3 e5 +A45 Indian Defense: Omega Gambit 1. d4 Nf6 2. e4 +A45 Indian Defense: Omega Gambit, Arafat Gambit 1. d4 Nf6 2. e4 Nxe4 3. Bd3 Nf6 4. Bg5 +A45 Indian Defense: Paleface Attack, Blackmar-Diemer Gambit Deferred 1. d4 Nf6 2. f3 d5 3. e4 +A45 Indian Defense: Pawn Push Variation 1. d4 Nf6 2. d5 +A45 Indian Defense: Reversed Chigorin Defense 1. d4 Nf6 2. Nc3 c5 +A45 Indian Defense: Tartakower Attack 1. d4 Nf6 2. g3 +A45 Paleface Attack 1. d4 Nf6 2. f3 +A45 Queen's Pawn Game: Chigorin Variation 1. d4 Nf6 2. Nc3 d5 +A45 Queen's Pawn Game: Veresov, Richter Attack 1. d4 Nf6 2. f3 d5 3. Nc3 +A45 Trompowsky Attack 1. d4 Nf6 2. Bg5 +A45 Trompowsky Attack: Borg Variation 1. d4 Nf6 2. Bg5 Ne4 3. Bf4 g5 +A45 Trompowsky Attack: Classical Defense 1. d4 Nf6 2. Bg5 e6 +A45 Trompowsky Attack: Classical Defense, Big Center Variation 1. d4 Nf6 2. Bg5 e6 3. e4 +A45 Trompowsky Attack: Edge Variation 1. d4 Nf6 2. Bg5 Ne4 3. Bh4 +A45 Trompowsky Attack: Edge Variation, Hergert Gambit 1. d4 Nf6 2. Bg5 Ne4 3. Bh4 c6 4. Nd2 Qa5 5. c3 Nxd2 6. Qxd2 d5 7. e4 +A45 Trompowsky Attack: Edge Variation, Hergert Gambit 1. d4 Nf6 2. Bg5 Ne4 3. Bh4 d5 4. f3 Nf6 5. Nc3 Bf5 6. e4 +A45 Trompowsky Attack: Poisoned Pawn Variation 1. d4 Nf6 2. Bg5 c5 3. d5 Qb6 4. Nc3 +A45 Trompowsky Attack: Raptor Variation 1. d4 Nf6 2. Bg5 Ne4 3. h4 +A45 Trompowsky Attack: Raptor Variation, Hergert Gambit 1. d4 Nf6 2. Bg5 Ne4 3. h4 Nxg5 4. hxg5 e5 +A46 Döry Defense 1. d4 Nf6 2. Nf3 Ne4 +A46 Indian Defense: Czech-Indian 1. d4 Nf6 2. Nf3 c6 +A46 Indian Defense: Knights Variation 1. d4 Nf6 2. Nf3 +A46 Indian Defense: Knights Variation, Alburt-Miles Variation 1. d4 Nf6 2. Nf3 a6 +A46 Indian Defense: London System 1. d4 Nf6 2. Nf3 e6 3. Bf4 +A46 Indian Defense: Polish Variation 1. d4 Nf6 2. Nf3 b5 +A46 Indian Defense: Spielmann-Indian 1. d4 Nf6 2. Nf3 c5 +A46 Indian Defense: Wade-Tartakower Defense 1. d4 Nf6 2. Nf3 d6 +A46 Queen's Pawn Game: Torre Attack, Breyer Variation 1. d4 Nf6 2. Nf3 e6 3. Bg5 d5 4. e3 c5 5. c3 Qb6 +A46 Queen's Pawn Game: Veresov Attack, Classical Defense 1. d4 Nf6 2. Nf3 e6 3. Nc3 d5 4. Bg5 +A46 Torre Attack: Classical Defense 1. d4 Nf6 2. Nf3 e6 3. Bg5 +A46 Torre Attack: Classical Defense, Nimzowitsch Variation 1. d4 Nf6 2. Nf3 e6 3. Bg5 h6 +A46 Torre Attack: Classical Defense, Petrosian Gambit 1. d4 Nf6 2. Nf3 e6 3. Bg5 c5 4. e3 b6 5. d5 +A46 Torre Attack: Wagner Gambit 1. d4 Nf6 2. Nf3 e6 3. Bg5 c5 4. e4 +A46 Yusupov-Rubinstein System 1. d4 Nf6 2. Nf3 e6 3. e3 +A47 Indian Defense: Schnepper Gambit 1. d4 Nf6 2. Nf3 b6 3. c3 e5 +A47 Marienbad System 1. d4 Nf6 2. Nf3 b6 3. g3 Bb7 4. Bg2 c5 +A47 Marienbad System: Berg Variation 1. d4 Nf6 2. Nf3 b6 3. g3 Bb7 4. Bg2 c5 5. c4 cxd4 6. Qxd4 +A47 Pseudo Queen's Indian Defense 1. d4 Nf6 2. Nf3 b6 +A47 Pseudo Queen's Indian Defense 1. d4 Nf6 2. Nf3 b6 3. e3 Bb7 4. Bd3 e6 5. Nbd2 c5 6. b3 Be7 +A48 East Indian Defense 1. d4 Nf6 2. Nf3 g6 +A48 Indian Defense: Colle System, King's Indian Variation 1. d4 Nf6 2. Nf3 g6 3. e3 Bg7 4. Bd3 d6 +A48 London System 1. d4 Nf6 2. Nf3 g6 3. Bf4 +A48 London System 1. d4 Nf6 2. Nf3 g6 3. Bf4 Bg7 4. e3 +A48 London System 1. d4 Nf6 2. Nf3 g6 3. Bf4 Bg7 4. e3 d6 +A48 London System, with Bd3 1. d4 Nf6 2. Nf3 g6 3. Bf4 Bg7 4. e3 d6 5. Bd3 +A48 London System, with Be2 1. d4 Nf6 2. Nf3 g6 3. Bf4 Bg7 4. e3 d6 5. Be2 +A48 London System, with Be2 1. d4 Nf6 2. Nf3 g6 3. Bf4 Bg7 4. e3 d6 5. Be2 O-O +A48 London System, with Be2 1. d4 Nf6 2. Nf3 g6 3. Bf4 Bg7 4. e3 d6 5. h3 c5 6. Be2 +A48 Queen's Pawn Game: Barry Attack 1. d4 Nf6 2. Nf3 g6 3. Nc3 d5 4. Bf4 +A48 Queen's Pawn Game: Barry Attack 1. d4 Nf6 2. Nf3 g6 3. Nc3 d5 4. Bf4 Bg7 +A48 Queen's Pawn Game: Barry Attack, Grünfeld Variation 1. d4 Nf6 2. Nf3 g6 3. Nc3 d5 4. Bf4 Bg7 5. e3 O-O 6. Be2 +A48 Queen's Pawn Game: Barry Attack, Tarzan Attack 1. d4 Nf6 2. Nf3 g6 3. Nc3 d5 4. Bf4 Bg7 5. Qd2 +A48 Queen's Pawn Game: Torre Attack, Grünfeld Variation, Main Line 1. d4 Nf6 2. Nf3 g6 3. Bg5 Bg7 4. Nbd2 d5 5. e3 O-O +A48 Torre Attack: Fianchetto Defense 1. d4 Nf6 2. Nf3 g6 3. Bg5 +A48 Torre Attack: Fianchetto Defense, Euwe Variation 1. d4 Nf6 2. Nf3 g6 3. Bg5 Bg7 4. Nbd2 c5 +A49 Indian Defense: Przepiorka Variation 1. d4 Nf6 2. Nf3 g6 3. g3 +A50 Indian Defense: Medusa Gambit 1. d4 Nf6 2. c4 g5 +A50 Indian Defense: Normal Variation 1. d4 Nf6 2. c4 +A50 Indian Defense: Pyrenees Gambit 1. d4 Nf6 2. c4 b5 +A50 Mexican Defense 1. d4 Nf6 2. c4 Nc6 +A50 Mexican Defense: Horsefly Gambit 1. d4 Nf6 2. c4 Nc6 3. d5 Ne5 4. f4 +A50 Queen's Indian Accelerated 1. d4 Nf6 2. c4 b6 +A50 Slav Indian 1. d4 Nf6 2. c4 c6 +A51 Indian Defense: Budapest Gambit 1. d4 Nf6 2. c4 e5 +A51 Indian Defense: Budapest Gambit Accepted 1. d4 Nf6 2. c4 e5 3. dxe5 +A51 Indian Defense: Budapest Gambit Accepted, Fajarowicz Defense 1. d4 Nf6 2. c4 e5 3. dxe5 Ne4 +A51 Indian Defense: Budapest Gambit Accepted, Fajarowicz Defense, Bonsdorf Variation 1. d4 Nf6 2. c4 e5 3. dxe5 Ne4 4. a3 +A51 Indian Defense: Budapest Gambit Accepted, Fajarowicz Defense, Steiner Variation 1. d4 Nf6 2. c4 e5 3. dxe5 Ne4 4. Qc2 +A52 Indian Defense: Budapest Gambit Accepted, Main Line 1. d4 Nf6 2. c4 e5 3. dxe5 Ng4 +A52 Indian Defense: Budapest Gambit Accepted, Main Line, Adler Variation 1. d4 Nf6 2. c4 e5 3. dxe5 Ng4 4. Nf3 +A52 Indian Defense: Budapest Gambit Accepted, Main Line, Alekhine Variation 1. d4 Nf6 2. c4 e5 3. dxe5 Ng4 4. e4 +A52 Indian Defense: Budapest Gambit Accepted, Main Line, Alekhine Variation, Abonyi Variation 1. d4 Nf6 2. c4 e5 3. dxe5 Ng4 4. e4 Nxe5 +A52 Indian Defense: Budapest Gambit Accepted, Main Line, Alekhine Variation, Tartakower Defense 1. d4 Nf6 2. c4 e5 3. dxe5 Ng4 4. e4 d6 +A52 Indian Defense: Budapest Gambit Accepted, Main Line, Rubinstein Variation 1. d4 Nf6 2. c4 e5 3. dxe5 Ng4 4. Bf4 +A53 Old Indian Defense 1. d4 Nf6 2. c4 d6 +A53 Old Indian Defense: Aged Gibbon Gambit 1. d4 Nf6 2. c4 d6 3. g4 +A53 Old Indian Defense: Czech Variation, with Nc3 1. d4 Nf6 2. c4 d6 3. Nc3 c6 +A53 Old Indian Defense: Czech Variation, with Nf3 1. d4 Nf6 2. c4 d6 3. Nf3 c6 +A53 Old Indian Defense: Janowski Variation 1. d4 Nf6 2. c4 d6 3. Nc3 Bf5 +A53 Old Indian Defense: Janowski Variation, Fianchetto Variation 1. d4 Nf6 2. c4 d6 3. Nc3 Bf5 4. g3 +A53 Old Indian Defense: Janowski Variation, Grinberg Gambit 1. d4 Nf6 2. c4 d6 3. Nc3 Bf5 4. e4 +A53 Old Indian Defense: Janowski Variation, Main Line 1. d4 Nf6 2. c4 d6 3. Nc3 Bf5 4. f3 +A54 Old Indian Defense: Duz-Khotimirsky Variation 1. d4 Nf6 2. c4 d6 3. Nc3 e5 4. e3 Nbd7 5. Bd3 +A54 Old Indian Defense: Tartakower-Indian 1. d4 Nf6 2. c4 d6 3. Nf3 Bg4 +A54 Old Indian Defense: Two Knights Variation 1. d4 Nf6 2. c4 d6 3. Nc3 e5 4. Nf3 +A54 Old Indian Defense: Ukrainian Variation 1. d4 Nf6 2. c4 d6 3. Nc3 e5 +A55 Old Indian Defense: Normal Variation 1. d4 Nf6 2. c4 d6 3. Nc3 Nbd7 4. e4 e5 5. Nf3 +A56 Benoni Defense 1. d4 Nf6 2. c4 c5 +A56 Benoni Defense: Czech Benoni Defense 1. d4 Nf6 2. c4 c5 3. d5 e5 +A56 Benoni Defense: Hromádka System 1. d4 Nf6 2. c4 c5 3. d5 d6 +A56 Benoni Defense: King's Indian System 1. d4 Nf6 2. c4 c5 3. d5 e5 4. Nc3 d6 5. e4 g6 +A56 Benoni Defense: Weenink Variation 1. d4 Nf6 2. c4 c5 3. dxc5 e6 +A56 Grünfeld Defense: Three Knights Variation, Burille Variation, Reversed Tarrasch 1. d4 Nf6 2. c4 c5 3. e3 g6 4. Nc3 Bg7 5. Nf3 O-O 6. Be2 cxd4 7. exd4 d5 8. O-O Nc6 +A56 Vulture Defense 1. d4 Nf6 2. c4 c5 3. d5 Ne4 +A57 Benko Gambit 1. d4 Nf6 2. c4 c5 3. d5 b5 +A57 Benko Gambit Accepted 1. d4 Nf6 2. c4 c5 3. d5 b5 4. cxb5 a6 +A57 Benko Gambit Accepted: Dlugy Variation 1. d4 Nf6 2. c4 c5 3. d5 b5 4. cxb5 a6 5. f3 +A57 Benko Gambit Accepted: Modern Variation 1. d4 Nf6 2. c4 c5 3. d5 b5 4. cxb5 a6 5. e3 +A57 Benko Gambit Accepted: Pawn Return Variation 1. d4 Nf6 2. c4 c5 3. d5 b5 4. cxb5 a6 5. b6 +A57 Benko Gambit Declined: Bishop Attack 1. d4 Nf6 2. c4 c5 3. d5 b5 4. Bg5 +A57 Benko Gambit Declined: Hjørring Countergambit 1. d4 Nf6 2. c4 c5 3. d5 b5 4. e4 +A57 Benko Gambit Declined: Main Line 1. d4 Nf6 2. c4 c5 3. d5 b5 4. Nf3 +A57 Benko Gambit Declined: Pseudo-Sämisch 1. d4 Nf6 2. c4 c5 3. d5 b5 4. f3 +A57 Benko Gambit Declined: Quiet Line 1. d4 Nf6 2. c4 c5 3. d5 b5 4. Nd2 +A57 Benko Gambit Declined: Sosonko Variation 1. d4 Nf6 2. c4 c5 3. d5 b5 4. a4 +A57 Benko Gambit: Mutkin Countergambit 1. d4 Nf6 2. c4 c5 3. d5 b5 4. g4 +A57 Benko Gambit: Nescafe Frappe Attack 1. d4 Nf6 2. c4 c5 3. d5 b5 4. cxb5 a6 5. Nc3 axb5 6. e4 b4 7. Nb5 d6 8. Bc4 +A57 Benko Gambit: Zaitsev System 1. d4 Nf6 2. c4 c5 3. d5 b5 4. cxb5 a6 5. Nc3 +A57 Benko Gambit: Zaitsev Variation, Nescafe Frappe Attack 1. d4 Nf6 2. c4 c5 3. d5 b5 4. cxb5 a6 5. Nc3 axb5 6. e4 b4 7. Nb5 +A58 Benko Gambit Accepted: Central Storming Variation 1. d4 Nf6 2. c4 c5 3. d5 b5 4. cxb5 a6 5. bxa6 g6 6. Nc3 Bxa6 7. f4 +A58 Benko Gambit Accepted: Fianchetto Variation 1. d4 Nf6 2. c4 c5 3. d5 b5 4. cxb5 a6 5. bxa6 g6 6. Nc3 Bxa6 7. g3 d6 8. Bg2 Bg7 9. Nf3 +A58 Benko Gambit Accepted: Fully Accepted Variation 1. d4 Nf6 2. c4 c5 3. d5 b5 4. cxb5 a6 5. bxa6 +A58 Benko Gambit: Fianchetto Variation 1. d4 Nf6 2. c4 c5 3. d5 b5 4. cxb5 a6 5. bxa6 Bxa6 6. Nc3 d6 7. Nf3 g6 8. g3 +A58 Benko Gambit: Nd2 Variation 1. d4 Nf6 2. c4 c5 3. d5 b5 4. cxb5 a6 5. bxa6 Bxa6 6. Nc3 d6 7. Nf3 g6 8. Nd2 +A59 Benko Gambit 1. d4 Nf6 2. c4 c5 3. d5 b5 4. cxb5 a6 5. bxa6 g6 6. Nc3 Bxa6 7. e4 Bxf1 8. Kxf1 d6 9. g3 +A59 Benko Gambit Accepted: King Walk Variation 1. d4 Nf6 2. c4 c5 3. d5 b5 4. cxb5 a6 5. bxa6 g6 6. Nc3 Bxa6 7. Nf3 d6 8. e4 Bxf1 9. Kxf1 Bg7 10. g3 O-O 11. Kg2 +A59 Benko Gambit Accepted: Yugoslav 1. d4 Nf6 2. c4 c5 3. d5 b5 4. cxb5 a6 5. bxa6 Bxa6 6. Nc3 d6 7. e4 +A59 Benko Gambit Accepted: Yugoslav 1. d4 Nf6 2. c4 c5 3. d5 b5 4. cxb5 a6 5. bxa6 g6 6. Nc3 Bxa6 7. e4 Bxf1 8. Kxf1 d6 9. Nge2 +A60 Benoni Defense: Modern Variation 1. d4 Nf6 2. c4 c5 3. d5 e6 +A60 Benoni Defense: Modern Variation, Snake Variation 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 Bd6 +A61 Benoni Defense 1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 +A61 Benoni Defense: Fianchetto Variation 1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. g3 +A61 Benoni Defense: Knight's Tour Variation 1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. Nd2 +A61 Benoni Defense: Uhlmann Variation 1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. Bg5 +A62 Benoni Defense: Fianchetto Variation 1. d4 Nf6 2. c4 e6 3. g3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. Bg2 Bg7 8. Nf3 O-O +A63 Benoni Defense: Fianchetto Variation, Hastings Defense 1. d4 Nf6 2. c4 e6 3. g3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. Bg2 Bg7 8. Nf3 O-O 9. O-O Nbd7 +A64 Benoni Defense: Fianchetto Variation, Hastings Defense, Main Line 1. d4 Nf6 2. c4 e6 3. g3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. Bg2 Bg7 8. Nf3 O-O 9. O-O a6 10. a4 Nbd7 11. Nd2 Re8 +A65 Benoni Defense: King's Pawn Line 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 +A65 Benoni Defense: King's Pawn Line 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. f3 Bg7 +A65 Benoni Defense: King's Pawn Line 1. d4 Nf6 2. c4 g6 3. f3 c5 4. d5 d6 5. e4 Bg7 6. Nc3 e6 7. Be3 O-O 8. Qd2 exd5 9. cxd5 +A65 Benoni Defense: King's Pawn Line, with Be3 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. f3 Bg7 8. Be3 +A65 Benoni Defense: King's Pawn Line, with Bg5 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Bg5 c5 7. d5 +A65 Benoni Defense: King's Pawn Line, with Bg5 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. f3 Bg7 8. Bg5 +A65 Benoni Defense: King's Pawn Line, with Bg5 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Bg5 c5 7. d5 e6 8. Qd2 exd5 9. exd5 +A65 Benoni Defense: King's Pawn Line, with Nge2 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. f3 Bg7 8. Nge2 +A65 Benoni Defense: King's Pawn Line, with Nge2 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Nge2 c5 7. d5 e6 8. Ng3 exd5 9. cxd5 +A66 Benoni Defense: Mikenas Variation 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. f4 Bg7 8. e5 +A66 Benoni Defense: Pawn Storm Variation 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. f4 +A67 Benoni Defense: Taimanov Variation 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. f4 Bg7 8. Bb5+ +A68 Benoni Defense: Four Pawns Attack 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. f4 Bg7 8. Nf3 O-O +A68 Benoni Defense: Four Pawns Attack 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. f4 Bg7 8. Nf3 O-O 9. Be2 +A69 Benoni Defense: Four Pawns Attack, Main Line 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. f4 Bg7 8. Nf3 O-O 9. Be2 Re8 +A69 Benoni Defense: Four Pawns Attack, Main Line 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. f4 Bg7 8. Nf3 O-O 9. Be2 Nbd7 10. O-O Re8 +A69 Benoni Defense: Four Pawns Attack, Main Line 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. f4 Bg7 8. Nf3 O-O 9. Be2 Nbd7 10. O-O Re8 11. Nd2 +A69 Benoni Defense: Four Pawns Attack, Main Line 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. f4 Bg7 8. Nf3 O-O 9. Be2 a6 10. a4 Re8 11. Nd2 +A70 Benoni Defense: Classical Variation 1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. e4 +A70 Benoni Defense: Classical Variation, New York Variation 1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. e4 Bg7 8. h3 +A70 Benoni Defense: Classical Variation, Traditional Variation 1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. e4 Bg7 8. Be2 +A71 Benoni Defense: Classical Variation, Averbakh-Grivas Attack 1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. e4 Bg7 8. Bg5 +A72 Benoni Defense: Classical Variation 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. Nf3 Bg7 8. Be2 O-O +A73 Benoni Defense: Classical Variation, Main Line 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. Nf3 Bg7 8. Be2 O-O 9. O-O +A74 Benoni Defense: Classical Variation, Full Line 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. Nf3 Bg7 8. Be2 O-O 9. O-O a6 10. a4 +A75 Benoni Defense: Classical Variation, Argentine Counterattack 1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. e4 Bg7 8. Be2 O-O 9. O-O a6 10. a4 Bg4 +A76 Benoni Defense: Classical Variation, Czerniak Defense 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. Nf3 Bg7 8. Be2 O-O 9. O-O Re8 +A77 Benoni Defense: Classical Variation, Czerniak Defense, Tal Line 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. Nf3 Bg7 8. Be2 O-O 9. O-O Re8 10. Nd2 +A77 Benoni Defense: Classical Variation, Czerniak Defense, Tal Line 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. Nf3 Bg7 8. Be2 O-O 9. O-O Re8 10. Nd2 Nbd7 +A78 Benoni Defense: Classical Variation, Czerniak Defense 1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. e4 Bg7 8. Be2 O-O 9. O-O Re8 10. Nd2 Na6 +A79 Benoni Defense: Classical Variation, Czerniak Defense 1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. Nf3 Bg7 8. Be2 O-O 9. O-O Re8 10. Nd2 Na6 11. f3 +A80 Dutch Defense 1. d4 f5 +A80 Dutch Defense: Alapin Variation 1. d4 f5 2. Qd3 +A80 Dutch Defense: Barcza Variation 1. d4 f5 2. Nf3 Nf6 3. c3 +A80 Dutch Defense: Hevendehl Gambit 1. d4 f5 2. g4 e5 +A80 Dutch Defense: Hopton Attack 1. d4 f5 2. Bg5 +A80 Dutch Defense: Janzen-Korchnoi Gambit 1. d4 f5 2. h3 Nf6 3. g4 +A80 Dutch Defense: Kingfisher Gambit 1. d4 f5 2. Nc3 d5 3. e4 +A80 Dutch Defense: Korchnoi Attack 1. d4 f5 2. h3 +A80 Dutch Defense: Krejcik Gambit 1. d4 f5 2. g4 +A80 Dutch Defense: Krejcik Gambit, Tate Gambit 1. d4 f5 2. g4 fxg4 3. e4 d5 4. Nc3 +A80 Dutch Defense: Manhattan Gambit, Anti-Classical Line 1. d4 f5 2. Qd3 e6 3. g4 +A80 Dutch Defense: Manhattan Gambit, Anti-Leningrad 1. d4 f5 2. Qd3 g6 3. g4 +A80 Dutch Defense: Manhattan Gambit, Anti-Modern 1. d4 f5 2. Qd3 d6 3. g4 +A80 Dutch Defense: Manhattan Gambit, Anti-Stonewall 1. d4 f5 2. Qd3 d5 3. g4 +A80 Dutch Defense: Omega-Isis Gambit 1. d4 f5 2. Nf3 e5 +A80 Dutch Defense: Raphael Variation 1. d4 f5 2. Nc3 +A80 Dutch Defense: Senechaud Gambit 1. d4 f5 2. Bf4 e6 3. g4 +A80 Dutch Defense: Spielmann Gambit 1. d4 f5 2. Nc3 Nf6 3. g4 +A80 Queen's Pawn Game: Veresov Attack, Dutch System 1. d4 f5 2. Nc3 d5 +A81 Dutch Defense: Blackburne Variation 1. d4 f5 2. g3 Nf6 3. Bg2 e6 4. Nh3 +A81 Dutch Defense: Fianchetto Attack 1. d4 f5 2. g3 +A81 Dutch Defense: Leningrad Variation, Carlsbad Variation 1. d4 f5 2. g3 g6 3. Bg2 Bg7 4. Nh3 +A81 Dutch Defense: Leningrad, Basman System 1. d4 f5 2. g3 c6 3. Bg2 g6 4. Nf3 Bg7 5. O-O Nh6 +A81 Dutch Defense: Semi-Leningrad Variation 1. d4 f5 2. g3 Nf6 3. Bg2 g6 +A82 Dutch Defense: Blackmar's Second Gambit 1. d4 f5 2. e4 fxe4 3. Nc3 Nf6 4. f3 +A82 Dutch Defense: Staunton Gambit 1. d4 f5 2. e4 +A82 Dutch Defense: Staunton Gambit Accepted 1. d4 f5 2. e4 fxe4 +A82 Dutch Defense: Staunton Gambit, American Attack 1. d4 f5 2. e4 fxe4 3. Nd2 +A82 Dutch Defense: Staunton Gambit, Tartakower Variation 1. d4 f5 2. e4 fxe4 3. Nc3 Nf6 4. g4 +A82 Rat Defense: Balogh Defense 1. e4 d6 2. d4 f5 +A83 Dutch Defense: Staunton Gambit 1. d4 f5 2. e4 fxe4 3. Nc3 Nf6 4. Bg5 +A83 Dutch Defense: Staunton Gambit, Alekhine Variation 1. d4 f5 2. e4 fxe4 3. Nc3 Nf6 4. Bg5 g6 5. h4 +A83 Dutch Defense: Staunton Gambit, Chigorin Variation 1. d4 f5 2. e4 fxe4 3. Nc3 Nf6 4. Bg5 c6 +A83 Dutch Defense: Staunton Gambit, Lasker Variation 1. d4 f5 2. e4 fxe4 3. Nc3 Nf6 4. Bg5 g6 5. f3 +A83 Dutch Defense: Staunton Gambit, Nimzowitsch Variation 1. d4 f5 2. e4 fxe4 3. Nc3 Nf6 4. Bg5 b6 +A84 Dutch Defense 1. d4 f5 2. c4 +A84 Dutch Defense: Bellon Gambit 1. d4 f5 2. c4 e6 3. e4 +A84 Dutch Defense: Bladel Variation 1. d4 f5 2. c4 g6 3. Nc3 Nh6 +A84 Dutch Defense: Classical Variation 1. d4 f5 2. c4 e6 +A84 Dutch Defense: Krause Variation 1. d4 f5 2. c4 Nf6 3. Nc3 d6 4. Nf3 Nc6 +A84 Dutch Defense: Normal Variation 1. d4 f5 2. c4 Nf6 +A84 Dutch Defense: Rubinstein Variation 1. d4 f5 2. c4 e6 3. Nc3 +A85 Dutch Defense: Queen's Knight Variation 1. d4 f5 2. c4 Nf6 3. Nc3 +A86 Dutch Defense: Fianchetto Variation 1. d4 f5 2. c4 Nf6 3. g3 +A86 Dutch Defense: Hort-Antoshin System 1. d4 f5 2. c4 Nf6 3. g3 d6 4. Bg2 c6 5. Nc3 Qc7 +A86 Dutch Defense: Leningrad Variation 1. d4 f5 2. c4 Nf6 3. g3 g6 +A87 Dutch Defense: Leningrad Variation 1. d4 f5 2. c4 Nf6 3. g3 g6 4. Bg2 Bg7 5. Nf3 +A88 Dutch Defense: Leningrad Variation, Warsaw Variation 1. d4 f5 2. g3 Nf6 3. Bg2 g6 4. Nf3 Bg7 5. O-O O-O 6. c4 d6 7. Nc3 c6 +A89 Dutch Defense: Leningrad Variation, Matulovic Variation 1. d4 f5 2. g3 Nf6 3. Bg2 g6 4. Nf3 Bg7 5. O-O O-O 6. c4 d6 7. Nc3 Nc6 +A90 Dutch Defense: Classical Variation 1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 +A90 Dutch Defense: Classical Variation 1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 d5 5. Nf3 +A90 Dutch Defense: Nimzo-Dutch Variation 1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Bb4+ +A90 Dutch Defense: Nimzo-Dutch Variation, Alekhine Variation 1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Bb4+ 5. Bd2 Be7 +A90 Dutch Defense: Stonewall Variation, Modern Variation 1. d4 f5 2. c4 e6 3. Nf3 Nf6 4. g3 c6 5. Bg2 d5 6. O-O Bd6 +A91 Dutch Defense: Classical Variation 1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 +A91 Dutch Defense: Classical Variation, Blackburne Attack 1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nh3 +A92 Dutch Defense: Alekhine Variation 1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O Ne4 +A92 Dutch Defense: Classical Variation 1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O +A92 Dutch Defense: Stonewall Variation 1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d5 7. Nc3 +A92 Dutch Defense: Stonewall Variation 1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d5 +A93 Dutch Defense: Stonewall Variation, Botvinnik Variation 1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d5 7. b3 +A94 Dutch Defense: Stonewall Variation 1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d5 7. b3 c6 8. Ba3 +A95 Dutch Defense: Stonewall Variation 1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d5 7. Nc3 c6 +A95 Dutch Defense: Stonewall Variation, Chekhover Variation 1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d5 7. Nc3 c6 8. Qc2 Qe8 9. Bg5 +A96 Dutch Defense: Classical Variation 1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d6 +A96 Dutch Defense: Classical Variation, Buenos Aires Variation 1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d6 7. Nc3 a5 +A96 Dutch Defense: Classical Variation, Huisl Variation 1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d6 7. Nc3 Ne4 +A97 Dutch Defense: Classical Variation, Ilyin-Zhenevsky Variation 1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d6 7. Nc3 Qe8 +A97 Dutch Defense: Classical Variation, Ilyin-Zhenevsky Variation, Winter Variation 1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d6 7. Nc3 Qe8 8. Re1 +A98 Dutch Defense: Classical Variation, Ilyin-Zhenevsky Variation, Alatortsev-Lisitsyn Line 1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d6 7. Nc3 Qe8 8. Qc2 +A99 Dutch Defense: Classical Variation, Ilyin-Zhenevsky Variation, Modern Main Line 1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d6 7. Nc3 Qe8 8. b3 diff --git a/crates/prep/data/b.tsv b/crates/prep/data/b.tsv new file mode 100644 index 0000000..ea15fb3 --- /dev/null +++ b/crates/prep/data/b.tsv @@ -0,0 +1,782 @@ +eco name pgn +B00 Barnes Defense 1. e4 f6 +B00 Borg Defense 1. e4 g5 +B00 Borg Defense: Borg Gambit 1. e4 g5 2. d4 Bg7 +B00 Borg Defense: Troon Gambit 1. e4 g5 2. d4 h6 3. h4 g4 +B00 Borg Defense: Zilbermints Gambit 1. e4 g5 2. d4 e5 +B00 Carr Defense 1. e4 h6 +B00 Carr Defense: Zilbermints Gambit 1. e4 h6 2. d4 e5 +B00 Duras Gambit 1. e4 f5 +B00 Fried Fox Defense 1. e4 f6 2. d4 Kf7 +B00 Goldsmith Defense 1. e4 h5 +B00 Goldsmith Defense: Picklepuss Defense 1. e4 h5 2. d4 Nf6 +B00 Hippopotamus Defense 1. e4 Nh6 +B00 Hippopotamus Defense 1. e4 Nh6 2. d4 g6 3. c4 f6 +B00 King's Pawn Game 1. e4 +B00 Lemming Defense 1. e4 Na6 +B00 Lion Defense: Lion's Jaw 1. e4 d6 2. d4 Nf6 3. f3 +B00 Nimzowitsch Defense 1. e4 Nc6 +B00 Nimzowitsch Defense 1. e4 Nc6 2. d4 +B00 Nimzowitsch Defense: Breyer Variation 1. e4 Nc6 2. Nc3 Nf6 3. d4 e5 +B00 Nimzowitsch Defense: Colorado Countergambit 1. e4 Nc6 2. Nf3 f5 +B00 Nimzowitsch Defense: Colorado Countergambit Accepted 1. e4 Nc6 2. Nf3 f5 3. exf5 +B00 Nimzowitsch Defense: Declined Variation 1. e4 Nc6 2. Nf3 +B00 Nimzowitsch Defense: El Columpio Defense 1. e4 Nc6 2. Nf3 Nf6 3. e5 Ng4 +B00 Nimzowitsch Defense: El Columpio Defense, El Columpio Gambit 1. e4 Nc6 2. Nf3 Nf6 3. e5 Ng4 4. d4 d6 5. h3 Nh6 6. e6 +B00 Nimzowitsch Defense: El Columpio Defense, Exchange Variation 1. e4 Nc6 2. Nf3 Nf6 3. e5 Ng4 4. d4 d6 5. h3 Nh6 6. exd6 +B00 Nimzowitsch Defense: El Columpio Defense, Pin Variation 1. e4 Nc6 2. Nf3 Nf6 3. e5 Ng4 4. d4 d6 5. h3 Nh6 6. Bb5 +B00 Nimzowitsch Defense: Franco-Nimzowitsch Variation 1. e4 Nc6 2. Nf3 e6 +B00 Nimzowitsch Defense: French Connection 1. e4 Nc6 2. Nc3 e6 +B00 Nimzowitsch Defense: Hornung Gambit 1. e4 Nc6 2. d4 d5 3. Be3 +B00 Nimzowitsch Defense: Kennedy Variation 1. e4 Nc6 2. d4 e5 +B00 Nimzowitsch Defense: Kennedy Variation, Bielefelder Gambit 1. e4 Nc6 2. d4 e5 3. dxe5 Bc5 +B00 Nimzowitsch Defense: Kennedy Variation, Hammer Gambit 1. e4 Nc6 2. d4 e5 3. dxe5 f6 +B00 Nimzowitsch Defense: Kennedy Variation, Herford Gambit 1. e4 Nc6 2. d4 e5 3. dxe5 Qh4 +B00 Nimzowitsch Defense: Kennedy Variation, Keres Attack 1. e4 Nc6 2. d4 e5 3. dxe5 Nxe5 4. Nc3 +B00 Nimzowitsch Defense: Kennedy Variation, Linksspringer Variation 1. e4 Nc6 2. d4 e5 3. d5 +B00 Nimzowitsch Defense: Kennedy Variation, Main Line 1. e4 Nc6 2. d4 e5 3. dxe5 Nxe5 4. f4 Ng6 +B00 Nimzowitsch Defense: Kennedy Variation, Paulsen Attack 1. e4 Nc6 2. d4 e5 3. dxe5 Nxe5 4. Nf3 +B00 Nimzowitsch Defense: Kennedy Variation, Riemann Defense 1. e4 Nc6 2. d4 e5 3. dxe5 Nxe5 4. f4 Nc6 +B00 Nimzowitsch Defense: Kennedy Variation, de Smet Gambit 1. e4 Nc6 2. d4 e5 3. dxe5 d6 +B00 Nimzowitsch Defense: Mikenas Variation 1. e4 Nc6 2. d4 d6 +B00 Nimzowitsch Defense: Neo-Mongoloid Defense 1. e4 Nc6 2. d4 f6 +B00 Nimzowitsch Defense: Pirc Connection 1. e4 Nc6 2. Nc3 g6 +B00 Nimzowitsch Defense: Pseudo-Spanish Variation 1. e4 Nc6 2. Bb5 +B00 Nimzowitsch Defense: Scandinavian Variation 1. e4 Nc6 2. d4 d5 +B00 Nimzowitsch Defense: Scandinavian Variation, Aachen Gambit 1. e4 Nc6 2. d4 d5 3. exd5 Nb4 +B00 Nimzowitsch Defense: Scandinavian Variation, Advance Variation 1. e4 Nc6 2. d4 d5 3. e5 +B00 Nimzowitsch Defense: Scandinavian Variation, Bogoljubow Variation 1. e4 Nc6 2. d4 d5 3. Nc3 +B00 Nimzowitsch Defense: Scandinavian Variation, Bogoljubow Variation 1. e4 Nc6 2. d4 d5 3. Nc3 dxe4 +B00 Nimzowitsch Defense: Scandinavian Variation, Bogoljubow Variation, Brandics Gambit 1. e4 Nc6 2. d4 d5 3. Nc3 a6 +B00 Nimzowitsch Defense: Scandinavian Variation, Bogoljubow Variation, Erben Gambit 1. e4 Nc6 2. d4 d5 3. Nc3 g6 +B00 Nimzowitsch Defense: Scandinavian Variation, Bogoljubow Variation, Heinola-Deppe Gambit 1. e4 Nc6 2. d4 d5 3. Nc3 e5 +B00 Nimzowitsch Defense: Scandinavian Variation, Bogoljubow Variation, Nimzowitsch Gambit 1. e4 Nc6 2. d4 d5 3. Nc3 dxe4 4. d5 Ne5 +B00 Nimzowitsch Defense: Scandinavian Variation, Bogoljubow Variation, Richter Gambit 1. e4 Nc6 2. d4 d5 3. Nc3 dxe4 4. d5 Nb8 5. f3 +B00 Nimzowitsch Defense: Scandinavian Variation, Bogoljubow Variation, Vehre Variation 1. e4 Nc6 2. d4 d5 3. Nc3 Nf6 +B00 Nimzowitsch Defense: Scandinavian Variation, Exchange Variation 1. e4 Nc6 2. d4 d5 3. exd5 Qxd5 +B00 Nimzowitsch Defense: Scandinavian Variation, Exchange Variation, Marshall Gambit 1. e4 Nc6 2. d4 d5 3. exd5 Qxd5 4. Nc3 +B00 Nimzowitsch Defense: Wheeler Gambit 1. e4 Nc6 2. b4 +B00 Nimzowitsch Defense: Williams Variation 1. e4 Nc6 2. Nf3 d6 +B00 Nimzowitsch Defense: Woodchuck Variation 1. e4 Nc6 2. d4 a6 +B00 Owen Defense 1. e4 b6 +B00 Owen Defense: Guatemala Defense 1. e4 b6 2. d4 Ba6 +B00 Owen Defense: Hekili-Loa Gambit 1. e4 b6 2. d4 c5 3. dxc5 Nc6 +B00 Owen Defense: Matovinsky Gambit 1. e4 b6 2. d4 Bb7 3. Bd3 f5 4. exf5 Bxg2 5. Qh5+ g6 +B00 Owen Defense: Naselwaus Gambit 1. e4 b6 2. d4 Bb7 3. Bg5 +B00 Owen Defense: Smith Gambit 1. e4 b6 2. d4 Bb7 3. Nf3 +B00 Owen Defense: Unicorn Variation 1. e4 f6 2. d4 b6 3. c4 Bb7 +B00 Owen Defense: Wind Gambit 1. e4 b6 2. d4 Bb7 3. f3 e5 +B00 Pirc Defense 1. e4 d6 +B00 Pirc Defense 1. e4 d6 2. d4 +B00 Pirc Defense 1. e4 d6 2. d4 Nf6 +B00 Pirc Defense: Roscher Gambit 1. e4 d6 2. d4 Nf6 3. Nf3 +B00 Rat Defense: Antal Defense 1. e4 d6 2. d4 Nd7 +B00 Rat Defense: Fuller Gambit 1. e4 d6 2. f4 d5 3. exd5 Nf6 +B00 Rat Defense: Harmonist 1. e4 d6 2. f4 +B00 Rat Defense: Petruccioli Attack 1. e4 d6 2. h4 +B00 Rat Defense: Spike Attack 1. e4 d6 2. g4 +B00 St. George Defense 1. e4 a6 +B00 St. George Defense: Polish Variation 1. e4 a6 2. d4 b5 3. Nf3 Bb7 4. Bd3 e6 +B00 St. George Defense: San Jorge Variation 1. e4 a6 2. d4 b5 3. Nf3 Bb7 4. Bd3 d6 5. O-O g6 6. c3 Bg7 +B00 St. George Defense: Zilbermints Gambit 1. e4 a6 2. d4 e5 +B00 Van Geet Opening: Berlin Gambit 1. e4 Nc6 2. d4 d5 3. Nc3 dxe4 4. d5 +B00 Ware Defense 1. e4 a5 +B00 Ware Defense: Snagglepuss Defense 1. e4 a5 2. d4 Nc6 +B01 Scandinavian Defense 1. e4 d5 +B01 Scandinavian Defense 1. e4 d5 2. b3 +B01 Scandinavian Defense: Anderssen Counterattack 1. e4 d5 2. exd5 Qxd5 3. Nc3 Qa5 4. d4 e5 +B01 Scandinavian Defense: Anderssen Counterattack, Collijn Variation 1. e4 d5 2. exd5 Qxd5 3. Nc3 Qa5 4. d4 e5 5. Nf3 Bg4 +B01 Scandinavian Defense: Anderssen Counterattack, Goteborg System 1. e4 d5 2. exd5 Qxd5 3. Nc3 Qa5 4. d4 e5 5. Nf3 +B01 Scandinavian Defense: Anderssen Counterattack, Orthodox Attack 1. e4 d5 2. exd5 Qxd5 3. Nc3 Qa5 4. d4 e5 5. dxe5 Nc6 6. Nf3 Bb4 7. Bd2 +B01 Scandinavian Defense: Blackburne Gambit 1. e4 d5 2. exd5 c6 3. dxc6 Nxc6 +B01 Scandinavian Defense: Blackburne-Kloosterboer Gambit 1. e4 d5 2. exd5 c6 +B01 Scandinavian Defense: Boehnke Gambit 1. e4 d5 2. exd5 e5 3. dxe6 Bxe6 +B01 Scandinavian Defense: Bronstein Variation 1. e4 d5 2. exd5 Qxd5 3. Nc3 Qd6 4. d4 Nf6 5. Nf3 a6 +B01 Scandinavian Defense: Classical Variation 1. e4 d5 2. exd5 Qxd5 3. Nc3 Qa5 4. d4 Nf6 5. Nf3 Bf5 +B01 Scandinavian Defense: Grünfeld Variation 1. e4 d5 2. exd5 Qxd5 3. Nc3 Qa5 4. d4 Nf6 5. Nf3 Bf5 6. Ne5 c6 7. g4 +B01 Scandinavian Defense: Gubinsky-Melts Defense 1. e4 d5 2. exd5 Qxd5 3. Nc3 Qd6 +B01 Scandinavian Defense: Icelandic-Palme Gambit 1. e4 d5 2. exd5 Nf6 3. c4 e6 +B01 Scandinavian Defense: Kiel Variation 1. e4 d5 2. exd5 Nf6 3. d4 Nxd5 4. c4 Nb4 +B01 Scandinavian Defense: Kloosterboer Gambit 1. e4 d5 2. exd5 c6 3. dxc6 e5 +B01 Scandinavian Defense: Kádas Gambit 1. e4 d5 2. exd5 Nf6 3. d4 c6 4. dxc6 e5 +B01 Scandinavian Defense: Lasker Variation 1. e4 d5 2. exd5 Qxd5 3. Nc3 Qa5 4. d4 Nf6 5. Nf3 Bg4 6. h3 +B01 Scandinavian Defense: Main Line 1. e4 d5 2. exd5 Qxd5 3. Nc3 Qa5 +B01 Scandinavian Defense: Main Line, Leonhardt Gambit 1. e4 d5 2. exd5 Qxd5 3. Nc3 Qa5 4. b4 +B01 Scandinavian Defense: Main Line, Mieses Variation 1. e4 d5 2. exd5 Qxd5 3. Nc3 Qa5 4. d4 Nf6 +B01 Scandinavian Defense: Marshall Variation 1. e4 d5 2. exd5 Nf6 3. d4 Nxd5 +B01 Scandinavian Defense: Mieses-Kotroc Variation 1. e4 d5 2. exd5 Qxd5 +B01 Scandinavian Defense: Modern Variation 1. e4 d5 2. exd5 Nf6 +B01 Scandinavian Defense: Modern Variation 1. e4 d5 2. exd5 Nf6 3. d4 +B01 Scandinavian Defense: Modern Variation, Gipslis Variation 1. e4 d5 2. exd5 Nf6 3. d4 Nxd5 4. Nf3 Bg4 +B01 Scandinavian Defense: Modern Variation, Wing Gambit 1. e4 d5 2. exd5 Nf6 3. d4 g6 4. c4 b5 +B01 Scandinavian Defense: Panov Transfer 1. e4 d5 2. exd5 Nf6 3. c4 c6 +B01 Scandinavian Defense: Portuguese Gambit 1. e4 d5 2. exd5 Nf6 3. d4 Bg4 +B01 Scandinavian Defense: Portuguese Gambit, Banker Variation 1. e4 d5 2. exd5 Nf6 3. d4 Bg4 4. f3 Bf5 5. c4 +B01 Scandinavian Defense: Portuguese Gambit, Classical Variation 1. e4 d5 2. exd5 Nf6 3. d4 Bg4 4. Nf3 +B01 Scandinavian Defense: Portuguese Gambit, Correspondence Refutation 1. e4 d5 2. exd5 Nf6 3. d4 Bg4 4. f3 Bf5 5. g4 +B01 Scandinavian Defense: Portuguese Gambit, Elbow Variation 1. e4 d5 2. exd5 Nf6 3. d4 Bg4 4. Bb5+ c6 +B01 Scandinavian Defense: Portuguese Gambit, Jadoul Variation 1. e4 d5 2. exd5 Nf6 3. d4 Bg4 4. f3 Bf5 5. Bb5+ Nbd7 6. c4 +B01 Scandinavian Defense: Portuguese Gambit, Lusophobe Variation 1. e4 d5 2. exd5 Nf6 3. d4 Bg4 4. Bb5+ Nbd7 5. Be2 +B01 Scandinavian Defense: Portuguese Gambit, Melbourne Shuffle Variation 1. e4 d5 2. exd5 Nf6 3. d4 Bg4 4. f3 Bf5 5. Bb5+ Nbd7 6. Nc3 +B01 Scandinavian Defense: Portuguese Gambit, Wuss Variation 1. e4 d5 2. exd5 Nf6 3. d4 Bg4 4. Be2 +B01 Scandinavian Defense: Richter Variation 1. e4 d5 2. exd5 Nf6 3. d4 Nxd5 4. Nf3 g6 +B01 Scandinavian Defense: Richter Variation 1. e4 d5 2. exd5 Nf6 3. d4 g6 +B01 Scandinavian Defense: Schiller-Pytel Variation 1. e4 d5 2. exd5 Qxd5 3. Nc3 Qd6 4. d4 c6 +B01 Scandinavian Defense: Schiller-Pytel Variation, Modern Variation 1. e4 d5 2. exd5 Qxd5 3. Nc3 Qd6 4. d4 Nf6 5. Bc4 c6 6. Nge2 Bf5 7. Bf4 Qb4 +B01 Scandinavian Defense: Valencian Variation 1. e4 d5 2. exd5 Qxd5 3. Nc3 Qd8 +B01 Scandinavian Defense: Valencian Variation, Ilundain Variation 1. e4 d5 2. exd5 Qxd5 3. Nc3 Qd8 4. d4 Nf6 5. Nf3 c6 +B01 Scandinavian Defense: Valencian Variation, Main Line 1. e4 d5 2. exd5 Qxd5 3. Nc3 Qd8 4. d4 Nf6 5. Nf3 Bg4 +B01 Scandinavian Defense: Zilbermints Gambit 1. e4 d5 2. b4 +B01 Van Geet Opening: Grünfeld Defense 1. e4 d5 2. Nc3 dxe4 3. Nxe4 e5 +B02 Alekhine Defense 1. e4 Nf6 +B02 Alekhine Defense: Brooklyn Variation 1. e4 Nf6 2. e5 Ng8 +B02 Alekhine Defense: Brooklyn Variation, Everglades Variation 1. e4 Nf6 2. e5 Ng8 3. d4 f5 +B02 Alekhine Defense: Buckley Attack 1. e4 Nf6 2. e5 Nd5 3. Na3 +B02 Alekhine Defense: Hunt Variation, Lasker Simul Gambit 1. e4 Nf6 2. e5 Nd5 3. c4 Nb6 4. c5 Nd5 5. Bc4 e6 6. Nc3 +B02 Alekhine Defense: Hunt Variation, Matsukevich Gambit 1. e4 Nf6 2. e5 Nd5 3. c4 Nb6 4. c5 Nd5 5. Nc3 Nxc3 6. dxc3 d6 7. Bg5 +B02 Alekhine Defense: Hunt Variation, Mikenas Gambit 1. e4 Nf6 2. e5 Nd5 3. c4 Nb6 4. c5 Nd5 5. Bc4 e6 6. Nc3 d6 7. Nxd5 exd5 8. Bxd5 +B02 Alekhine Defense: Kmoch Variation 1. e4 Nf6 2. e5 Nd5 3. Bc4 Nb6 4. Bb3 c5 5. d3 +B02 Alekhine Defense: Krejcik Variation 1. e4 Nf6 2. Bc4 +B02 Alekhine Defense: Krejcik Variation, Krejcik Gambit 1. e4 Nf6 2. Bc4 Nxe4 3. Bxf7+ +B02 Alekhine Defense: Maróczy Variation 1. e4 Nf6 2. d3 +B02 Alekhine Defense: Mokele Mbembe 1. e4 Nf6 2. e5 Ne4 +B02 Alekhine Defense: Mokele Mbembe, Modern Line 1. e4 Nf6 2. e5 Ne4 3. d4 f6 +B02 Alekhine Defense: Mokele Mbembe, Vavra Defense 1. e4 Nf6 2. e5 Ne4 3. d4 e6 +B02 Alekhine Defense: Normal Variation 1. e4 Nf6 2. e5 Nd5 +B02 Alekhine Defense: Scandinavian Variation 1. e4 Nf6 2. Nc3 d5 +B02 Alekhine Defense: Scandinavian Variation, Geschev Gambit 1. e4 Nf6 2. Nc3 d5 3. exd5 c6 +B02 Alekhine Defense: Scandinavian Variation, Myers Gambit 1. e4 Nf6 2. Nc3 d5 3. d3 dxe4 4. Bg5 +B02 Alekhine Defense: Spielmann Gambit 1. e4 Nf6 2. Nc3 d5 3. e5 Nfd7 4. e6 +B02 Alekhine Defense: Steiner Variation 1. e4 Nf6 2. e5 Nd5 3. c4 Nb6 4. b3 +B02 Alekhine Defense: Sämisch Attack 1. e4 Nf6 2. e5 Nd5 3. Nc3 +B02 Alekhine Defense: The Squirrel 1. e4 Nf6 2. e5 Nd5 3. c4 Nf4 +B02 Alekhine Defense: Two Pawns Attack 1. e4 Nf6 2. e5 Nd5 3. c4 +B02 Alekhine Defense: Two Pawns Attack, Lasker Variation 1. e4 Nf6 2. e5 Nd5 3. c4 Nb6 4. c5 +B02 Alekhine Defense: Two Pawns Attack, Mikenas Variation 1. e4 Nf6 2. e5 Nd5 3. c4 Nb6 4. c5 Nd5 5. Bc4 e6 6. Nc3 d6 +B02 Alekhine Defense: Two Pawns Attack, Tate Variation 1. e4 Nf6 2. e5 Nd5 3. c4 Nb6 4. a4 +B02 Alekhine Defense: Welling Variation 1. e4 Nf6 2. e5 Nd5 3. b3 +B03 Alekhine Defense 1. e4 Nf6 2. e5 Nd5 3. d4 +B03 Alekhine Defense 1. e4 Nf6 2. e5 Nd5 3. d4 d6 +B03 Alekhine Defense 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. c4 +B03 Alekhine Defense: Balogh Variation 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. Bc4 +B03 Alekhine Defense: Exchange Variation 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. c4 Nb6 5. exd6 +B03 Alekhine Defense: Exchange Variation, Karpov Variation 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. c4 Nb6 5. exd6 cxd6 6. Nc3 g6 7. h3 Bg7 8. Nf3 O-O 9. Be2 Nc6 10. O-O Bf5 11. Bf4 +B03 Alekhine Defense: Exchange Variation, Voronezh Variation 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. c4 Nb6 5. exd6 cxd6 6. Nc3 g6 7. Be3 Bg7 8. Rc1 O-O 9. b3 +B03 Alekhine Defense: Four Pawns Attack 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. c4 Nb6 5. f4 +B03 Alekhine Defense: Four Pawns Attack, Cambridge Gambit 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. c4 Nb6 5. f4 g5 +B03 Alekhine Defense: Four Pawns Attack, Fianchetto Variation 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. c4 Nb6 5. f4 g6 +B03 Alekhine Defense: Four Pawns Attack, Ilyin-Zhenevsky Variation 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. c4 Nb6 5. f4 dxe5 6. fxe5 Nc6 7. Nf3 Bg4 8. e6 fxe6 9. c5 +B03 Alekhine Defense: Four Pawns Attack, Korchnoi Variation 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. c4 Nb6 5. f4 dxe5 6. fxe5 Bf5 7. Nc3 e6 8. Nf3 Be7 9. Be2 O-O 10. O-O f6 +B03 Alekhine Defense: Four Pawns Attack, Main Line 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. c4 Nb6 5. f4 dxe5 6. fxe5 Nc6 7. Be3 +B03 Alekhine Defense: Four Pawns Attack, Tartakower Variation 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. c4 Nb6 5. f4 dxe5 6. fxe5 Nc6 7. Be3 Bf5 8. Nc3 e6 9. Nf3 Qd7 10. Be2 O-O-O 11. O-O Be7 +B03 Alekhine Defense: Four Pawns Attack, Trifunovic Variation 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. c4 Nb6 5. f4 Bf5 +B03 Alekhine Defense: Hunt Variation 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. c4 Nb6 5. c5 +B03 Alekhine Defense: Modern Variation, Alekhine Gambit 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. c4 Nb6 5. Nf3 Bg4 6. Be2 +B03 Alekhine Defense: O'Sullivan Gambit 1. e4 Nf6 2. e5 Nd5 3. d4 b5 +B04 Alekhine Defense: Modern Variation 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. Nf3 +B04 Alekhine Defense: Modern Variation, Alburt Variation 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. Nf3 g6 +B04 Alekhine Defense: Modern Variation, Keres Variation 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. Nf3 g6 5. Bc4 Nb6 6. Bb3 Bg7 7. a4 +B04 Alekhine Defense: Modern Variation, Larsen Variation 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. Nf3 dxe5 +B04 Alekhine Defense: Modern Variation, Larsen-Haakert Variation 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. Nf3 Nc6 +B04 Alekhine Defense: Modern Variation, Schmid Variation 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. Nf3 Nb6 +B05 Alekhine Defense: Modern Variation, Alekhine Variation 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. Nf3 Bg4 5. c4 +B05 Alekhine Defense: Modern Variation, Flohr Variation 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. Nf3 Bg4 5. Be2 c6 +B05 Alekhine Defense: Modern Variation, Main Line 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. Nf3 Bg4 +B05 Alekhine Defense: Modern Variation, Panov Variation 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. Nf3 Bg4 5. h3 +B05 Alekhine Defense: Modern Variation, Vitolins Attack 1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. Nf3 Bg4 5. c4 Nb6 6. d5 +B06 Modern Defense 1. e4 g6 +B06 Modern Defense 1. e4 g6 2. d4 Bg7 +B06 Modern Defense: Anti-Modern 1. e4 g6 2. d4 Bg7 3. Nc3 c6 4. Bc4 d6 5. Qe2 +B06 Modern Defense: Bishop Attack 1. e4 g6 2. d4 Bg7 3. Bc4 +B06 Modern Defense: Bishop Attack, Bücker Gambit 1. e4 g6 2. d4 Bg7 3. Bc4 b5 +B06 Modern Defense: Bishop Attack, Monkey's Bum 1. e4 g6 2. Bc4 Bg7 3. Qf3 e6 4. d4 Bxd4 +B06 Modern Defense: Dunworthy Variation 1. e4 g6 2. d4 Bg7 3. c4 d5 4. exd5 c6 5. dxc6 Bxd4 +B06 Modern Defense: Fianchetto Gambit 1. e4 g6 2. d4 f5 +B06 Modern Defense: Gurgenidze Defense 1. e4 g6 2. d4 Bg7 3. Nc3 c6 4. f4 d5 5. e5 h5 +B06 Modern Defense: Lizard Defense, Mittenberger Gambit 1. e4 g6 2. d4 Bg7 3. Nc3 d5 +B06 Modern Defense: Masur Gambit 1. e4 g6 2. d4 Nh6 3. Nc3 f5 4. Bxh6 Bxh6 5. exf5 O-O +B06 Modern Defense: Modern Pterodactyl 1. e4 g6 2. d4 Bg7 3. Nc3 c5 +B06 Modern Defense: Mongredien Defense, with Nc3 1. e4 g6 2. d4 Bg7 3. Nc3 b6 +B06 Modern Defense: Mongredien Defense, with Nf3 1. e4 g6 2. d4 Bg7 3. Nf3 b6 +B06 Modern Defense: Norwegian Defense 1. e4 g6 2. d4 Nf6 +B06 Modern Defense: Norwegian Defense, Norwegian Gambit 1. e4 g6 2. d4 Nf6 3. e5 Nh5 4. Be2 d6 +B06 Modern Defense: Pseudo-Austrian Attack 1. e4 g6 2. d4 Bg7 3. Nc3 d6 4. f4 +B06 Modern Defense: Semi-Averbakh Variation, Pterodactyl Variation Declined 1. e4 g6 2. d4 Bg7 3. c4 c5 4. Nf3 d6 5. Be2 Qa5+ +B06 Modern Defense: Standard Defense 1. e4 g6 2. d4 Bg7 3. Nc3 d6 +B06 Modern Defense: Standard Line 1. e4 g6 2. d4 Bg7 3. Nc3 +B06 Modern Defense: Three Pawns Attack 1. e4 g6 2. d4 Bg7 3. f4 +B06 Modern Defense: Two Knights Variation 1. e4 g6 2. d4 Bg7 3. Nc3 d6 4. Nf3 +B06 Modern Defense: Two Knights Variation, Suttles Variation 1. e4 g6 2. d4 Bg7 3. Nc3 c6 4. Nf3 d6 +B06 Modern Defense: Two Knights Variation, Suttles Variation, Tal Gambit 1. e4 g6 2. d4 Bg7 3. Nc3 d6 4. Nf3 c6 5. Bg5 Qb6 6. Qd2 Qxb2 +B06 Modern Defense: Westermann Gambit 1. e4 g6 2. d4 Bg7 3. Bd2 +B06 Modern Defense: Wind Gambit 1. e4 g6 2. d4 Bg7 3. Bd3 +B06 Pterodactyl Defense: Austrian, Austriadactylus Western 1. e4 g6 2. d4 Bg7 3. f4 c5 4. Nf3 Qa5+ +B06 Pterodactyl Defense: Austrian, Grand Prix Pterodactyl 1. e4 g6 2. Nc3 Bg7 3. f4 c5 4. Nf3 Qa5 +B06 Pterodactyl Defense: Austrian, Pteranodon 1. e4 g6 2. d4 Bg7 3. f4 c5 4. c3 Qa5 +B06 Pterodactyl Defense: Central, Anhanguera 1. e4 g6 2. d4 Bg7 3. c4 c5 4. Nc3 d6 5. Be3 Qa5 +B06 Pterodactyl Defense: Central, Benoni Quetzalcoatlus 1. e4 g6 2. d4 Bg7 3. c4 c5 4. d5 d6 5. Nc3 Qa5 +B06 Pterodactyl Defense: Central, Quetzalcoatlus Gambit 1. e4 g6 2. d4 Bg7 3. c4 c5 4. Nc3 d6 5. dxc5 Qa5 +B06 Pterodactyl Defense: Eastern, Anhanguera 1. e4 g6 2. d4 Bg7 3. Nc3 c5 4. Be3 +B06 Pterodactyl Defense: Eastern, Benoni 1. d4 g6 2. e4 Bg7 3. Nc3 c5 4. d5 +B06 Pterodactyl Defense: Eastern, Benoni Pteranodon 1. e4 g6 2. d4 Bg7 3. Nc3 c5 4. d5 Bxc3+ 5. bxc3 Qa5 +B06 Pterodactyl Defense: Eastern, Benoni Pterodactyl 1. d4 g6 2. Nc3 Bg7 3. e4 c5 4. d5 Qa5 +B06 Pterodactyl Defense: Eastern, Pteranodon 1. e4 g6 2. d4 Bg7 3. Nc3 c5 4. dxc5 Bxc3+ 5. bxc3 Qa5 +B06 Pterodactyl Defense: Eastern, Rhamphorhynchus 1. e4 g6 2. d4 Bg7 3. Nc3 c5 4. dxc5 Qa5 +B06 Pterodactyl Defense: Fianchetto, King Pterodactyl 1. e4 g6 2. d4 Bg7 3. g3 c5 4. Nf3 Qa5+ +B06 Pterodactyl Defense: Fianchetto, Rhamphorhynchus 1. e4 g6 2. d4 Bg7 3. g3 c5 4. dxc5 Qa5+ +B06 Pterodactyl Defense: Sicilian, Quetzalcoatlus 1. e4 g6 2. d4 Bg7 3. Nc3 c5 4. Nf3 Qa5 5. Be2 d6 +B06 Pterodactyl Defense: Sicilian, Siroccopteryx 1. e4 g6 2. d4 Bg7 3. Nc3 c5 4. Nf3 Qa5 5. Bc4 +B06 Pterodactyl Defense: Western, Anhanguera 1. e4 g6 2. d4 Bg7 3. Nf3 c5 4. Be3 Qa5+ +B06 Pterodactyl Defense: Western, Siroccopteryx 1. e4 g6 2. Nf3 Bg7 3. d4 c5 4. Bc4 cxd4 5. Nxd4 Qa5+ +B06 Rat Defense: Accelerated Gurgenidze 1. e4 g6 2. d4 d6 3. Nc3 c6 +B07 Czech Defense 1. e4 d6 2. d4 Nf6 3. Nc3 c6 +B07 King's Pawn Game: Maróczy Defense 1. e4 d6 2. d4 e5 +B07 Lion Defense 1. e4 d6 2. d4 Nf6 3. Nc3 Nbd7 +B07 Lion Defense: Anti-Philidor 1. e4 d6 2. d4 Nf6 3. Nc3 Nbd7 4. f4 +B07 Lion Defense: Anti-Philidor, Lion's Cave 1. e4 d6 2. d4 Nf6 3. Nc3 Nbd7 4. f4 e5 +B07 Lion Defense: Anti-Philidor, Lion's Cave, Lion Claw Gambit 1. e4 d6 2. d4 Nf6 3. Nc3 Nbd7 4. f4 e5 5. Nf3 exd4 6. Qxd4 c6 7. Bc4 d5 +B07 Lion Defense: Bayonet Attack 1. e4 d6 2. d4 Nf6 3. Nc3 Nbd7 4. g4 +B07 Modern Defense: Geller's System 1. e4 g6 2. d4 Bg7 3. Nf3 d6 4. c3 +B07 Pirc Defense 1. e4 d6 2. d4 Nf6 3. Nc3 g6 +B07 Pirc Defense: 150 Attack 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. Be3 c6 5. Qd2 +B07 Pirc Defense: 150 Attack, Inner Doll Defense 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. Be3 c6 5. Qd2 Bg4 +B07 Pirc Defense: 150 Attack, Sveshnikov-Jansa Attack 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. Be3 c6 5. h3 +B07 Pirc Defense: Bayonet Attack 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. Be2 Bg7 5. h4 +B07 Pirc Defense: Byrne Variation 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. Bg5 +B07 Pirc Defense: Chinese Variation 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. Be2 Bg7 5. g4 +B07 Pirc Defense: Kholmov System 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. Bc4 +B07 Pirc Defense: Sveshnikov System 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. g3 +B08 Pirc Defense: Classical Variation 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. Nf3 +B08 Pirc Defense: Classical Variation 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. Nf3 Bg7 +B08 Pirc Defense: Classical Variation, Quiet System 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. Nf3 Bg7 5. Be2 +B08 Pirc Defense: Classical Variation, Quiet System, Chigorin Line 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. Nf3 Bg7 5. Be2 O-O 6. O-O Nc6 +B08 Pirc Defense: Classical Variation, Quiet System, Czech Defense 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. Nf3 Bg7 5. Be2 O-O 6. O-O c6 +B08 Pirc Defense: Classical Variation, Quiet System, Parma Defense 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. Nf3 Bg7 5. Be2 O-O 6. O-O Bg4 +B08 Pirc Defense: Classical Variation, Schlechter Variation 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. Nf3 Bg7 5. h3 +B09 Pirc Defense: Austrian Attack 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. f4 +B09 Pirc Defense: Austrian Attack 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. f4 Bg7 5. Nf3 O-O +B09 Pirc Defense: Austrian Attack, Dragon Formation 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. f4 Bg7 5. Nf3 c5 +B09 Pirc Defense: Austrian Attack, Kurajica Variation 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. f4 Bg7 5. Nf3 O-O 6. Be3 +B09 Pirc Defense: Austrian Attack, Ljubojevic Variation 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. f4 Bg7 5. Bc4 +B09 Pirc Defense: Austrian Attack, Unzicker Attack 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. f4 Bg7 5. Nf3 O-O 6. e5 +B09 Pirc Defense: Austrian Attack, Unzicker Attack, Bronstein Variation 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. f4 Bg7 5. Nf3 O-O 6. e5 Nfd7 7. h4 +B09 Pirc Defense: Austrian Attack, Weiss Variation 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. f4 Bg7 5. Nf3 O-O 6. Bd3 +B10 Caro-Kann Defense 1. e4 c6 +B10 Caro-Kann Defense 1. e4 c6 2. Nc3 +B10 Caro-Kann Defense 1. e4 c6 2. Nc3 d5 +B10 Caro-Kann Defense: Accelerated Panov Attack 1. e4 c6 2. c4 +B10 Caro-Kann Defense: Accelerated Panov Attack 1. e4 c6 2. c4 d5 +B10 Caro-Kann Defense: Accelerated Panov Attack, Modern Variation 1. e4 c6 2. c4 d5 3. exd5 cxd5 4. cxd5 Nf6 +B10 Caro-Kann Defense: Accelerated Panov Attack, Open Variation 1. e4 c6 2. c4 e5 +B10 Caro-Kann Defense: Accelerated Panov Attack, Pseudo-Scandinavian 1. e4 c6 2. c4 d5 3. exd5 cxd5 4. cxd5 Qxd5 +B10 Caro-Kann Defense: Accelerated Panov Attack, Van Weersel Attack 1. e4 c6 2. c4 d5 3. cxd5 cxd5 4. Qb3 +B10 Caro-Kann Defense: Apocalypse Attack 1. e4 c6 2. Nf3 d5 3. exd5 cxd5 4. Ne5 +B10 Caro-Kann Defense: Breyer Variation 1. e4 c6 2. d3 +B10 Caro-Kann Defense: Breyer Variation, Stein Attack 1. e4 c6 2. d3 d5 3. Nd2 g6 4. Ngf3 Bg7 5. g3 e5 6. Bg2 Ne7 7. O-O O-O 8. b4 +B10 Caro-Kann Defense: Dinic Gambit 1. e4 c6 2. Nf3 d5 3. d3 dxe4 4. Ng5 +B10 Caro-Kann Defense: Endgame Offer 1. e4 c6 2. Nf3 d5 3. d3 +B10 Caro-Kann Defense: Endgame Variation 1. e4 c6 2. Nf3 d5 3. d3 dxe4 4. dxe4 Qxd1+ 5. Kxd1 +B10 Caro-Kann Defense: Euwe Attack 1. e4 c6 2. b3 +B10 Caro-Kann Defense: Goldman Variation 1. e4 c6 2. Nc3 d5 3. Qf3 +B10 Caro-Kann Defense: Hector Gambit 1. e4 c6 2. Nc3 d5 3. Nf3 dxe4 4. Ng5 +B10 Caro-Kann Defense: Hillbilly Attack 1. e4 c6 2. Bc4 +B10 Caro-Kann Defense: Hillbilly Attack, Schaeffer Gambit 1. e4 c6 2. Bc4 d5 3. Bb3 dxe4 4. Qh5 +B10 Caro-Kann Defense: Labahn Attack 1. e4 c6 2. b4 +B10 Caro-Kann Defense: Labahn Attack, Double Gambit 1. e4 c6 2. b4 d5 3. b5 +B10 Caro-Kann Defense: Labahn Attack, Polish Variation 1. e4 c6 2. b4 e5 3. Bb2 +B10 Caro-Kann Defense: Scorpion-Horus Gambit 1. e4 c6 2. Nc3 d5 3. d3 dxe4 4. Bg5 +B10 Caro-Kann Defense: Spike Variation 1. e4 c6 2. g4 +B10 Caro-Kann Defense: Spike Variation, Scorpion-Grob Gambit 1. e4 c6 2. g4 d5 3. Nc3 dxe4 4. d3 +B10 Caro-Kann Defense: St. Patrick's Attack 1. e4 c6 2. Nc3 d5 3. h3 +B10 Caro-Kann Defense: Toikkanen Gambit 1. e4 c6 2. c4 d5 3. e5 +B10 Caro-Kann Defense: Two Knights Attack 1. e4 c6 2. Nc3 d5 3. Nf3 +B11 Caro-Kann Defense: Two Knights Attack, Mindeno Variation 1. e4 c6 2. Nc3 d5 3. Nf3 Bg4 +B11 Caro-Kann Defense: Two Knights Attack, Mindeno Variation, Exchange Line 1. e4 c6 2. Nc3 d5 3. Nf3 Bg4 4. h3 Bxf3 +B11 Caro-Kann Defense: Two Knights Attack, Mindeno Variation, Retreat Line 1. e4 c6 2. Nc3 d5 3. Nf3 Bg4 4. h3 Bh5 +B12 Caro-Kann Defense 1. e4 c6 2. d4 +B12 Caro-Kann Defense 1. e4 c6 2. d4 d5 +B12 Caro-Kann Defense: Advance Variation 1. e4 c6 2. d4 d5 3. e5 +B12 Caro-Kann Defense: Advance Variation, Bayonet Attack 1. e4 c6 2. d4 d5 3. e5 Bf5 4. g4 +B12 Caro-Kann Defense: Advance Variation, Botvinnik-Carls Defense 1. e4 c6 2. d4 d5 3. e5 c5 +B12 Caro-Kann Defense: Advance Variation, Bronstein Variation 1. e4 c6 2. d4 d5 3. e5 Bf5 4. Ne2 +B12 Caro-Kann Defense: Advance Variation, Prins Attack 1. e4 c6 2. d4 d5 3. e5 Bf5 4. b4 +B12 Caro-Kann Defense: Advance Variation, Short Variation 1. e4 c6 2. d4 d5 3. e5 Bf5 4. Nf3 +B12 Caro-Kann Defense: Advance Variation, Tal Variation 1. e4 c6 2. d4 d5 3. e5 Bf5 4. h4 +B12 Caro-Kann Defense: Advance Variation, Van der Wiel Attack 1. e4 c6 2. d4 d5 3. e5 Bf5 4. Nc3 +B12 Caro-Kann Defense: Advance Variation, Van der Wiel Attack 1. e4 c6 2. d4 d5 3. e5 Bf5 4. Nc3 e6 5. g4 Bg6 6. Nge2 c5 7. h4 +B12 Caro-Kann Defense: Advance Variation, Van der Wiel Attack, Dreyev Defense 1. e4 c6 2. d4 d5 3. e5 Bf5 4. Nc3 Qb6 +B12 Caro-Kann Defense: Advance, Short Variation 1. e4 c6 2. d4 d5 3. e5 Bf5 4. c3 e6 5. Be2 +B12 Caro-Kann Defense: De Bruycker Defense 1. e4 c6 2. d4 Na6 +B12 Caro-Kann Defense: De Bruycker Defense 1. e4 c6 2. d4 Na6 3. Nc3 Nc7 +B12 Caro-Kann Defense: Edinburgh Variation 1. e4 c6 2. d4 d5 3. Nd2 Qb6 +B12 Caro-Kann Defense: Maróczy Variation 1. e4 c6 2. d4 d5 3. f3 +B12 Caro-Kann Defense: Maróczy Variation, Maróczy Gambit 1. e4 c6 2. d4 d5 3. f3 dxe4 4. fxe4 e5 5. Nf3 exd4 6. Bc4 +B12 Caro-Kann Defense: Masi Variation 1. e4 c6 2. d4 Nf6 +B12 Caro-Kann Defense: Massachusetts Defense 1. e4 c6 2. d4 f5 +B12 Caro-Kann Defense: Mieses Attack, Landau Gambit 1. e4 c6 2. d4 d5 3. Bd3 Nf6 4. e5 Nfd7 5. e6 +B12 Caro-Kann Defense: Mieses Gambit 1. e4 c6 2. d4 d5 3. Be3 +B12 Caro-Kann Defense: Modern Variation 1. e4 c6 2. d4 d5 3. Nd2 +B12 Caro-Kann Defense: Ulysses Gambit 1. e4 c6 2. d4 d5 3. Nf3 dxe4 4. Ng5 +B13 Caro-Kann Defense: Exchange Variation 1. e4 c6 2. d4 d5 3. exd5 +B13 Caro-Kann Defense: Exchange Variation 1. e4 c6 2. d4 d5 3. exd5 cxd5 +B13 Caro-Kann Defense: Exchange Variation 1. e4 c6 2. d4 d5 3. exd5 cxd5 4. Bf4 +B13 Caro-Kann Defense: Exchange Variation 1. e4 c6 2. d4 d5 3. exd5 cxd5 4. Nf3 Nc6 +B13 Caro-Kann Defense: Exchange Variation, Bulla Attack 1. e4 c6 2. d4 d5 3. exd5 cxd5 4. g4 +B13 Caro-Kann Defense: Exchange Variation, Rubinstein Variation 1. e4 c6 2. d4 d5 3. exd5 cxd5 4. Bd3 Nc6 5. c3 Nf6 6. Bf4 +B13 Caro-Kann Defense: Panov Attack 1. e4 c6 2. d4 d5 3. exd5 cxd5 4. c4 +B13 Caro-Kann Defense: Panov Attack 1. e4 c6 2. d4 d5 3. exd5 cxd5 4. c4 Nf6 5. Nc3 +B13 Caro-Kann Defense: Panov Attack, Gunderam Attack 1. e4 c6 2. d4 d5 3. exd5 cxd5 4. c4 Nf6 5. c5 +B13 Caro-Kann Defense: Panov Attack, Modern Defense 1. e4 c6 2. d4 d5 3. exd5 cxd5 4. c4 Nf6 5. Nc3 Nc6 +B13 Caro-Kann Defense: Panov Attack, Modern Defense, Carlsbad Line 1. e4 c6 2. d4 d5 3. exd5 cxd5 4. c4 Nf6 5. Nc3 Nc6 6. Bg5 e6 +B13 Caro-Kann Defense: Panov Attack, Modern Defense, Czerniak Line 1. e4 c6 2. d4 d5 3. exd5 cxd5 4. c4 Nf6 5. Nc3 Nc6 6. Bg5 Qa5 +B13 Caro-Kann Defense: Panov Attack, Modern Defense, Mieses Line 1. e4 c6 2. d4 d5 3. exd5 cxd5 4. c4 Nf6 5. Nc3 Nc6 6. Nf3 Bg4 +B13 Caro-Kann Defense: Panov Attack, Modern Defense, Reifir-Spielmann Line 1. e4 c6 2. d4 d5 3. exd5 cxd5 4. c4 Nf6 5. Nc3 Nc6 6. Bg5 Qb6 +B13 Caro-Kann Defense: Panov-Botvinnik, Herzog Defense 1. e4 c6 2. d4 d5 3. exd5 cxd5 4. c4 Nf6 5. Nc3 Nc6 6. Bg5 dxc4 7. d5 Na5 +B14 Caro-Kann Defense: Panov Attack 1. e4 c6 2. d4 d5 3. exd5 cxd5 4. c4 Nf6 5. Nc3 e6 +B14 Caro-Kann Defense: Panov Attack 1. e4 c6 2. d4 d5 3. exd5 cxd5 4. c4 Nc6 5. Nc3 Nf6 6. Nf3 e6 7. cxd5 exd5 8. Bb5 Bg4 +B14 Caro-Kann Defense: Panov Attack 1. e4 c6 2. d4 d5 3. exd5 cxd5 4. c4 Nc6 5. Nc3 Nf6 6. Nf3 e6 7. cxd5 exd5 8. Bb5 Bd6 9. Bg5 O-O 10. O-O +B14 Caro-Kann Defense: Panov Attack 1. e4 c6 2. d4 d5 3. exd5 cxd5 4. c4 Nf6 5. Nc3 Nc6 6. Nf3 e6 7. c5 +B14 Caro-Kann Defense: Panov Attack, Fianchetto Defense 1. e4 c6 2. d4 d5 3. exd5 cxd5 4. c4 Nf6 5. Nc3 g6 +B14 Caro-Kann Defense: Panov Attack, Fianchetto Defense, Fianchetto Gambit 1. e4 c6 2. d4 d5 3. exd5 cxd5 4. c4 Nf6 5. Nc3 g6 6. cxd5 Bg7 +B14 Caro-Kann Defense: Panov Attack, Main Line 1. e4 c6 2. d4 d5 3. exd5 cxd5 4. c4 Nf6 5. Nc3 e6 6. Nf3 Bb4 +B15 Caro-Kann Defense 1. e4 c6 2. d4 d5 3. Nc3 +B15 Caro-Kann Defense 1. e4 c6 2. d4 d5 3. Nc3 dxe4 +B15 Caro-Kann Defense: Alekhine Gambit 1. e4 c6 2. d4 d5 3. Nc3 dxe4 4. Nxe4 Nf6 5. Bd3 +B15 Caro-Kann Defense: Alien Gambit 1. e4 c6 2. d4 d5 3. Nc3 dxe4 4. Nxe4 Nf6 5. Ng5 h6 6. Nxf7 +B15 Caro-Kann Defense: Campomanes Attack 1. e4 c6 2. d4 d5 3. Nc3 Nf6 +B15 Caro-Kann Defense: Forgacs Variation 1. e4 c6 2. d4 d5 3. Nc3 dxe4 4. Nxe4 Nf6 5. Nxf6+ exf6 6. Bc4 +B15 Caro-Kann Defense: Gurgenidze Counterattack 1. e4 c6 2. d4 d5 3. Nc3 b5 +B15 Caro-Kann Defense: Gurgenidze System 1. e4 c6 2. d4 d5 3. Nc3 g6 +B15 Caro-Kann Defense: Main Line 1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 +B15 Caro-Kann Defense: Rasa-Studier Gambit 1. e4 c6 2. d4 d5 3. Nc3 dxe4 4. f3 +B15 Caro-Kann Defense: Tartakower Variation 1. e4 c6 2. d4 d5 3. Nc3 dxe4 4. Nxe4 Nf6 5. Nxf6+ exf6 +B15 Caro-Kann Defense: Tartakower Variation, Perlis Line 1. e4 c6 2. d4 d5 3. Nc3 dxe4 4. Nxe4 Nf6 5. Nxf6+ exf6 6. c3 Bd6 7. Bd3 O-O 8. Qc2 h6 +B15 Caro-Kann Defense: von Hennig Gambit 1. e4 c6 2. d4 d5 3. Nc3 dxe4 4. Bc4 +B16 Caro-Kann Defense: Bronstein-Larsen Variation 1. e4 c6 2. d4 d5 3. Nc3 dxe4 4. Nxe4 Nf6 5. Nxf6+ gxf6 +B16 Caro-Kann Defense: Finnish Variation 1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 h6 +B17 Caro-Kann Defense: Karpov Variation 1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 Nd7 +B17 Caro-Kann Defense: Karpov Variation, Modern Main Line 1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 Nd7 5. Ng5 Ngf6 6. Bd3 e6 7. N1f3 Bd6 8. Qe2 h6 9. Ne4 Nxe4 10. Qxe4 +B17 Caro-Kann Defense: Karpov Variation, Modern Variation 1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 Nd7 5. Ng5 +B17 Caro-Kann Defense: Karpov Variation, Modern Variation, Ivanchuk Defense 1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 Nd7 5. Ng5 Ndf6 +B17 Caro-Kann Defense: Karpov Variation, Modern Variation, Kasparov Attack 1. e4 c6 2. d4 d5 3. Nc3 dxe4 4. Nxe4 Nd7 5. Nf3 Ngf6 6. Ng3 +B17 Caro-Kann Defense: Karpov Variation, Smyslov Variation 1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 Nd7 5. Bc4 Ngf6 6. Ng5 e6 7. Qe2 Nb6 +B17 Caro-Kann Defense: Karpov Variation, Smyslov Variation, Main Line 1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 Nd7 5. Bc4 Ngf6 6. Ng5 e6 7. Qe2 Nb6 8. Bb3 +B17 Caro-Kann Defense: Karpov Variation, Tiviakov-Fischer Attack 1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 Nd7 5. Bc4 Ngf6 6. Nxf6+ Nxf6 +B18 Caro-Kann Defense: Classical Variation 1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 Bf5 +B18 Caro-Kann Defense: Classical Variation, Flohr Variation 1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 Bf5 5. Ng3 Bg6 6. Nh3 +B18 Caro-Kann Defense: Classical Variation, Main Line 1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 Bf5 5. Ng3 Bg6 6. h4 +B18 Caro-Kann Defense: Classical Variation, Maróczy Attack 1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 Bf5 5. Ng3 Bg6 6. f4 +B18 Caro-Kann Defense: Martian Gambit 1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 Bf5 5. Ng5 Bg6 6. N1f3 h6 7. Ne6 +B19 Caro-Kann Defense: Classical Variation 1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 Bf5 5. Ng3 Bg6 6. h4 h6 7. Nf3 Nd7 +B19 Caro-Kann Defense: Classical Variation, Lobron System 1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 Bf5 5. Ng3 Bg6 6. h4 h6 7. Nf3 Nd7 8. h5 Bh7 9. Bd3 Bxd3 10. Qxd3 e6 11. Bd2 Ngf6 12. O-O-O Be7 +B19 Caro-Kann Defense: Classical Variation, Seirawan Variation 1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 Bf5 5. Ng3 Bg6 6. h4 h6 7. Nf3 Nd7 8. h5 Bh7 9. Bd3 Bxd3 10. Qxd3 Ngf6 11. Bd2 e6 12. O-O-O Bd6 +B19 Caro-Kann Defense: Classical Variation, Spassky Variation 1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 Bf5 5. Ng3 Bg6 6. h4 h6 7. Nf3 Nd7 8. h5 +B20 Sicilian Defense 1. e4 c5 +B20 Sicilian Defense: Amazon Attack 1. e4 c5 2. Qg4 +B20 Sicilian Defense: Big Clamp Formation 1. e4 c5 2. d3 Nc6 3. c3 d6 4. f4 +B20 Sicilian Defense: Bowdler Attack 1. e4 c5 2. Bc4 +B20 Sicilian Defense: Brick Variation 1. e4 c5 2. Nh3 +B20 Sicilian Defense: Czerniak Attack 1. e4 c5 2. b3 +B20 Sicilian Defense: Czerniak Attack, Queen Fianchetto Variation 1. e4 c5 2. b3 b6 +B20 Sicilian Defense: Euwe Attack, Prins Gambit 1. e4 c5 2. b3 d5 3. Bb2 +B20 Sicilian Defense: Gloria Variation 1. e4 c5 2. c4 d6 3. Nc3 Nc6 4. g3 h5 +B20 Sicilian Defense: Grob Variation 1. e4 c5 2. g4 +B20 Sicilian Defense: Keres Variation 1. e4 c5 2. Ne2 +B20 Sicilian Defense: King David's Opening 1. e4 c5 2. Ke2 +B20 Sicilian Defense: Kronberger Variation 1. e4 c5 2. Na3 +B20 Sicilian Defense: Kronberger Variation, Nemeth Gambit 1. e4 c5 2. Na3 Nc6 3. d4 cxd4 4. Bc4 +B20 Sicilian Defense: Lasker-Dunne Attack 1. e4 c5 2. g3 +B20 Sicilian Defense: Mengarini Variation 1. e4 c5 2. a3 +B20 Sicilian Defense: Myers Attack, with a4 1. e4 c5 2. a4 +B20 Sicilian Defense: Myers Attack, with h4 1. e4 c5 2. h4 +B20 Sicilian Defense: Staunton-Cochrane Variation 1. e4 c5 2. c4 +B20 Sicilian Defense: Wing Gambit 1. e4 c5 2. b4 +B20 Sicilian Defense: Wing Gambit, Abrahams Variation 1. e4 c5 2. b4 cxb4 3. Bb2 +B20 Sicilian Defense: Wing Gambit, Carlsbad Variation 1. e4 c5 2. b4 cxb4 3. a3 bxa3 +B20 Sicilian Defense: Wing Gambit, Marienbad Variation 1. e4 c5 2. b4 cxb4 3. a3 d5 4. exd5 Qxd5 5. Bb2 +B20 Sicilian Defense: Wing Gambit, Marshall Variation 1. e4 c5 2. b4 cxb4 3. a3 +B20 Sicilian Defense: Wing Gambit, Nanu Gambit 1. e4 c5 2. b4 cxb4 3. a3 d5 4. exd5 Qxd5 5. Nf3 e5 6. c4 Qe6 7. Bd3 +B20 Sicilian Defense: Wing Gambit, Romanian Defense 1. e4 c5 2. b4 cxb4 3. a3 d5 4. exd5 Qxd5 5. Nf3 e5 6. Bb2 Nc6 7. c4 Qe6 +B20 Sicilian Defense: Wing Gambit, Santasiere Variation 1. e4 c5 2. b4 cxb4 3. c4 +B21 Bird Opening: Dutch Variation, Batavo Gambit 1. e4 c5 2. f4 d5 3. Nf3 dxe4 +B21 Sicilian Defense: Coles Sicilian Gambit 1. e4 c5 2. d4 cxd4 3. Qxd4 Nc6 4. Qd1 Nf6 5. Bc4 +B21 Sicilian Defense: Halasz Gambit 1. e4 c5 2. d4 cxd4 3. f4 +B21 Sicilian Defense: McDonnell Attack 1. e4 c5 2. f4 +B21 Sicilian Defense: McDonnell Attack 1. e4 c5 2. f4 Nc6 3. Nf3 e6 +B21 Sicilian Defense: McDonnell Attack 1. e4 c5 2. f4 Nc6 3. Nf3 e6 4. d3 +B21 Sicilian Defense: McDonnell Attack 1. e4 c5 2. f4 Nc6 3. Nf3 g6 4. Bb5 Bg7 +B21 Sicilian Defense: McDonnell Attack 1. e4 c5 2. f4 Nc6 3. Nf3 g6 4. Bb5 Bg7 5. c3 Nf6 +B21 Sicilian Defense: McDonnell Attack 1. e4 c5 2. f4 Nc6 3. Nf3 g6 4. Bb5 Bg7 5. Bxc6 bxc6 6. O-O d6 7. d3 Nf6 +B21 Sicilian Defense: McDonnell Attack, Tal Gambit 1. e4 c5 2. f4 d5 3. exd5 Nf6 +B21 Sicilian Defense: McDonnell Attack, Toilet Variation 1. e4 c5 2. f4 d5 3. Nc3 +B21 Sicilian Defense: Morphy Gambit 1. e4 c5 2. d4 cxd4 3. Nf3 +B21 Sicilian Defense: Morphy Gambit, Andreaschek Gambit 1. e4 c5 2. d4 cxd4 3. Nf3 e5 4. c3 +B21 Sicilian Defense: Smith-Morra Gambit 1. e4 c5 2. d4 +B21 Sicilian Defense: Smith-Morra Gambit 1. e4 c5 2. d4 cxd4 3. c3 +B21 Sicilian Defense: Smith-Morra Gambit Accepted 1. e4 c5 2. d4 cxd4 3. c3 dxc3 +B21 Sicilian Defense: Smith-Morra Gambit Accepted, Chicago Defense 1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nxc3 Nc6 5. Bc4 e6 6. Nf3 d6 7. O-O a6 8. Qe2 b5 9. Bb3 Ra7 +B21 Sicilian Defense: Smith-Morra Gambit Accepted, Chicago Defense 1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nxc3 d6 5. Nf3 e6 6. Bc4 Nf6 7. O-O a6 +B21 Sicilian Defense: Smith-Morra Gambit Accepted, Classical Formation 1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nxc3 Nc6 5. Nf3 d6 6. Bc4 a6 7. O-O Nf6 +B21 Sicilian Defense: Smith-Morra Gambit Accepted, Danish Variation 1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nf3 +B21 Sicilian Defense: Smith-Morra Gambit Accepted, Fianchetto Defense 1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nxc3 g6 +B21 Sicilian Defense: Smith-Morra Gambit Accepted, Fianchetto Defense 1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nxc3 Nc6 5. Nf3 g6 +B21 Sicilian Defense: Smith-Morra Gambit Accepted, Fianchetto Defense 1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nxc3 Nc6 5. Nf3 d6 6. Bc4 g6 +B21 Sicilian Defense: Smith-Morra Gambit Accepted, Fianchetto Defense 1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nxc3 d6 5. Nf3 g6 +B21 Sicilian Defense: Smith-Morra Gambit Accepted, Finegold Defense 1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nxc3 e6 5. Nf3 d6 6. Bc4 a6 7. O-O Be7 8. Qe2 Nf6 +B21 Sicilian Defense: Smith-Morra Gambit Accepted, Kan Formation 1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nxc3 e6 5. Nf3 a6 +B21 Sicilian Defense: Smith-Morra Gambit Accepted, Larsen Defense 1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nxc3 Nc6 5. Nf3 e6 6. Bc4 Qc7 7. Qe2 a6 8. O-O Bd6 +B21 Sicilian Defense: Smith-Morra Gambit Accepted, Morphy Defense 1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nxc3 Nc6 5. Nf3 e6 6. Bc4 Bc5 +B21 Sicilian Defense: Smith-Morra Gambit Accepted, Morphy Defense Deferred 1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nxc3 Nc6 5. Nf3 e6 6. Bc4 a6 7. O-O b5 8. Bb3 Bc5 +B21 Sicilian Defense: Smith-Morra Gambit Accepted, Paulsen Formation 1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nxc3 Nc6 5. Nf3 e6 6. Bc4 a6 +B21 Sicilian Defense: Smith-Morra Gambit Accepted, Pin Defense 1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nxc3 Nc6 5. Nf3 e6 6. Bc4 Bb4 +B21 Sicilian Defense: Smith-Morra Gambit Accepted, Scheveningen Formation 1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nxc3 Nc6 5. Nf3 d6 6. Bc4 e6 +B21 Sicilian Defense: Smith-Morra Gambit Accepted, Siberian Variation 1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nxc3 Nc6 5. Nf3 e6 6. Bc4 Qc7 +B21 Sicilian Defense: Smith-Morra Gambit Accepted, Siberian Variation, Siberian Trap 1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nxc3 Nc6 5. Nf3 e6 6. Bc4 Qc7 7. Qe2 Nf6 8. O-O Ng4 +B21 Sicilian Defense: Smith-Morra Gambit Accepted, Sozin Formation 1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nxc3 Nc6 5. Bc4 e6 6. Nf3 d6 7. O-O a6 8. Qe2 b5 +B21 Sicilian Defense: Smith-Morra Gambit Accepted, Taimanov Formation 1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nxc3 e6 5. Bc4 a6 6. Nf3 Ne7 +B21 Sicilian Defense: Smith-Morra Gambit Declined, Alapin Formation 1. e4 c5 2. d4 cxd4 3. c3 Nf6 +B21 Sicilian Defense: Smith-Morra Gambit Declined, Center Formation 1. e4 c5 2. d4 cxd4 3. c3 e5 +B21 Sicilian Defense: Smith-Morra Gambit Declined, Dubois Variation 1. e4 c5 2. d4 cxd4 3. c3 d3 4. c4 +B21 Sicilian Defense: Smith-Morra Gambit Declined, Push Variation 1. e4 c5 2. d4 cxd4 3. c3 d3 +B21 Sicilian Defense: Smith-Morra Gambit Declined, Scandinavian Formation 1. e4 c5 2. d4 cxd4 3. c3 d5 +B21 Sicilian Defense: Smith-Morra Gambit Declined, Wing Formation 1. e4 c5 2. d4 cxd4 3. c3 Qa5 +B22 Sicilian Defense: Alapin Variation 1. e4 c5 2. c3 +B22 Sicilian Defense: Alapin Variation, Anti-Alapin Gambit 1. e4 c5 2. c3 d5 3. exd5 Nf6 +B22 Sicilian Defense: Alapin Variation, Barmen Defense 1. e4 c5 2. c3 d5 3. exd5 Qxd5 +B22 Sicilian Defense: Alapin Variation, Barmen Defense 1. e4 c5 2. c3 d5 3. exd5 Qxd5 4. d4 g6 5. Nf3 +B22 Sicilian Defense: Alapin Variation, Barmen Defense 1. e4 c5 2. c3 d5 3. exd5 Qxd5 4. d4 Nc6 5. Nf3 +B22 Sicilian Defense: Alapin Variation, Barmen Defense, Central Exchange 1. e4 c5 2. c3 d5 3. exd5 Qxd5 4. d4 cxd4 5. cxd4 Nc6 6. Nf3 Bg4 +B22 Sicilian Defense: Alapin Variation, Barmen Defense, Endgame Variation 1. e4 c5 2. c3 d5 3. exd5 Qxd5 4. d4 cxd4 5. cxd4 Nc6 6. Nf3 Bg4 7. Nc3 Bxf3 8. gxf3 Qxd4 9. Qxd4 Nxd4 +B22 Sicilian Defense: Alapin Variation, Barmen Defense, Milner-Barry Attack 1. e4 c5 2. c3 d5 3. exd5 Qxd5 4. d4 Nc6 5. Nf3 cxd4 6. cxd4 e5 7. Nc3 Bb4 8. Be2 +B22 Sicilian Defense: Alapin Variation, Barmen Defense, Modern Line 1. e4 c5 2. c3 d5 3. exd5 Qxd5 4. d4 Nf6 5. Nf3 Bg4 +B22 Sicilian Defense: Alapin Variation, Smith-Morra Declined 1. e4 c5 2. c3 Nf6 3. e5 Nd5 4. d4 cxd4 +B22 Sicilian Defense: Alapin Variation, Stoltz Attack 1. e4 c5 2. c3 Nf6 3. e5 Nd5 4. Nf3 Nc6 5. Bc4 Nb6 6. Bb3 +B22 Sicilian Defense: Alapin Variation, Stoltz Attack, Ivanchuk Line 1. e4 c5 2. c3 Nf6 3. e5 Nd5 4. Nf3 Nc6 5. Bc4 Nb6 6. Bb3 c4 7. Bc2 Qc7 8. Qe2 g5 +B22 Sicilian Defense: Delayed Alapin Variation 1. e4 c5 2. Nf3 e6 3. c3 d5 4. exd5 Qxd5 5. d4 Nf6 +B22 Sicilian Defense: Delayed Alapin Variation 1. e4 c5 2. Nf3 e6 3. c3 d5 4. exd5 exd5 5. Bb5+ Nc6 6. O-O Bd6 7. d4 +B22 Sicilian Defense: Heidenfeld Variation 1. e4 c5 2. c3 Nf6 3. e5 Nd5 4. Nf3 Nc6 5. Na3 +B23 Sicilian Defense: Closed 1. e4 c5 2. Nc3 +B23 Sicilian Defense: Closed 1. e4 c5 2. Nc3 e6 +B23 Sicilian Defense: Closed 1. e4 c5 2. Nc3 e6 3. g3 +B23 Sicilian Defense: Closed 1. e4 c5 2. Nc3 e6 3. f4 Nc6 4. Nf3 d5 +B23 Sicilian Defense: Closed 1. e4 c5 2. Nc3 e6 3. f4 Nc6 4. Nf3 d5 5. Bb5 +B23 Sicilian Defense: Closed 1. e4 c5 2. Nc3 e6 3. Nge2 a6 4. g3 +B23 Sicilian Defense: Closed, Carlsen Variation 1. e4 c5 2. Nc3 d6 3. d4 cxd4 4. Qxd4 Nc6 5. Qd2 +B23 Sicilian Defense: Closed, Chameleon Variation 1. e4 c5 2. Nc3 Nc6 3. Nge2 +B23 Sicilian Defense: Closed, Grob Attack 1. e4 c5 2. Nc3 Nc6 3. g4 +B23 Sicilian Defense: Closed, Korchnoi Defense 1. e4 c5 2. Nc3 e6 3. g3 d5 +B23 Sicilian Defense: Closed, Portland Attack 1. e4 c5 2. Nc3 Nc6 3. d3 g6 4. g4 +B23 Sicilian Defense: Closed, Traditional 1. e4 c5 2. Nc3 Nc6 +B23 Sicilian Defense: Grand Prix Attack 1. e4 c5 2. Nc3 Nc6 3. f4 +B23 Sicilian Defense: Grand Prix Attack, Schofman Variation 1. e4 c5 2. Nc3 Nc6 3. f4 g6 4. Nf3 Bg7 5. Bc4 e6 6. f5 +B24 Sicilian Defense: Closed 1. e4 c5 2. Nc3 Nc6 3. g3 g6 +B24 Sicilian Defense: Closed 1. e4 c5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 +B24 Sicilian Defense: Closed, Fianchetto Variation 1. e4 c5 2. Nc3 Nc6 3. g3 +B24 Sicilian Defense: Closed, Smyslov Variation 1. e4 c5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. d3 e6 6. Be3 Nd4 7. Nce2 +B25 Sicilian Defense: Closed 1. e4 c5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. d3 d6 +B25 Sicilian Defense: Closed 1. e4 c5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. d3 d6 6. f4 +B25 Sicilian Defense: Closed, Botvinnik Defense, Edge Variation 1. e4 c5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. d3 d6 6. f4 e5 7. Nh3 Nge7 +B25 Sicilian Defense: Closed, Botvinnik Defense, with Nge2 1. e4 c5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. d3 d6 6. Nge2 e5 +B25 Sicilian Defense: Closed, Botvinnik Defense, with f4 1. e4 c5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. d3 d6 6. f4 e5 +B26 Sicilian Defense: Closed 1. e4 c5 2. Nc3 Nc6 3. g3 g6 4. Bg2 Bg7 5. d3 d6 6. Be3 +B27 Modern Defense: Pterodactyl Variation 1. e4 c5 2. Nf3 g6 3. d4 Bg7 4. Nc3 Qa5 +B27 Pterodactyl Defense: Sicilian, Anhanguera 1. e4 c5 2. Nf3 g6 3. d4 Bg7 4. Nc3 Qa5 5. Be3 +B27 Pterodactyl Defense: Sicilian, Benoni Gambit 1. e4 c5 2. Nf3 g6 3. d4 Bg7 4. Nc3 Qa5 5. d5 +B27 Pterodactyl Defense: Sicilian, Pteranodon 1. e4 c5 2. Nf3 g6 3. d4 Bg7 4. dxc5 Qa5+ 5. Nc3 Bxc3+ 6. bxc3 +B27 Pterodactyl Defense: Sicilian, Rhamphorhynchus 1. e4 c5 2. Nf3 g6 3. d4 Bg7 4. dxc5 Qa5+ 5. Nc3 +B27 Pterodactyl Defense: Sicilian, Unpin 1. e4 c5 2. Nf3 g6 3. d4 Bg7 4. Nc3 Qa5 5. Bd2 +B27 Pterodactyl Defense: Western, Pterodactyl 1. e4 c5 2. Nf3 g6 3. c3 Bg7 4. d4 Qa5 +B27 Pterodactyl Defense: Western, Rhamphorhynchus 1. e4 c5 2. Nf3 g6 3. d4 Bg7 4. dxc5 Qa5+ +B27 Sicilian Defense 1. e4 c5 2. Nf3 +B27 Sicilian Defense: Acton Extension 1. e4 c5 2. Nf3 g6 3. c4 Bh6 +B27 Sicilian Defense: Brussels Gambit 1. e4 c5 2. Nf3 f5 +B27 Sicilian Defense: Bücker Variation 1. e4 c5 2. Nf3 h6 +B27 Sicilian Defense: Double-Dutch Gambit 1. e4 c5 2. Nf3 f5 3. exf5 Nh6 +B27 Sicilian Defense: Frederico Variation 1. e4 c5 2. Nf3 g6 3. d4 f5 +B27 Sicilian Defense: Hyperaccelerated Dragon 1. e4 c5 2. Nf3 g6 +B27 Sicilian Defense: Hyperaccelerated Dragon 1. e4 c5 2. Nf3 g6 3. d4 +B27 Sicilian Defense: Hyperaccelerated Pterodactyl 1. e4 c5 2. Nf3 g6 3. d4 Bg7 +B27 Sicilian Defense: Hyperaccelerated Pterodactyl, Exchange Variation 1. e4 c5 2. Nf3 g6 3. d4 Bg7 4. dxc5 Qa5+ 5. Nc3 Bxc3+ 6. bxc3 Qxc3+ +B27 Sicilian Defense: Jalalabad Variation 1. e4 c5 2. Nf3 e5 +B27 Sicilian Defense: Katalimov Variation 1. e4 c5 2. Nf3 b6 +B27 Sicilian Defense: Mongoose Variation 1. e4 c5 2. Nf3 Qa5 +B27 Sicilian Defense: Polish Gambit 1. e4 c5 2. Nf3 b5 +B27 Sicilian Defense: Quinteros Variation 1. e4 c5 2. Nf3 Qc7 +B28 Sicilian Defense: O'Kelly Variation 1. e4 c5 2. Nf3 a6 +B28 Sicilian Defense: O'Kelly Variation, Aronin System 1. e4 c5 2. Nf3 a6 3. Be2 +B28 Sicilian Defense: O'Kelly Variation, Kieseritzky System 1. e4 c5 2. Nf3 a6 3. b3 +B28 Sicilian Defense: O'Kelly Variation, Maróczy Bind 1. e4 c5 2. Nf3 a6 3. c4 +B28 Sicilian Defense: O'Kelly Variation, Maróczy Bind, Paulsen Line 1. e4 c5 2. Nf3 a6 3. c4 e6 +B28 Sicilian Defense: O'Kelly Variation, Maróczy Bind, Robatsch Line 1. e4 c5 2. Nf3 a6 3. c4 d6 +B28 Sicilian Defense: O'Kelly Variation, Normal System 1. e4 c5 2. Nf3 a6 3. d4 +B28 Sicilian Defense: O'Kelly Variation, Normal System, Cortlever Gambit 1. e4 c5 2. Nf3 a6 3. d4 cxd4 4. Bc4 +B28 Sicilian Defense: O'Kelly Variation, Normal System, Smith-Morra Line 1. e4 c5 2. Nf3 a6 3. d4 cxd4 4. c3 +B28 Sicilian Defense: O'Kelly Variation, Normal System, Taimanov Line 1. e4 c5 2. Nf3 a6 3. d4 cxd4 4. Nxd4 e5 +B28 Sicilian Defense: O'Kelly Variation, Normal System, Zagorovsky Line 1. e4 c5 2. Nf3 a6 3. d4 cxd4 4. Qxd4 +B28 Sicilian Defense: O'Kelly Variation, Quiet System 1. e4 c5 2. Nf3 a6 3. d3 +B28 Sicilian Defense: O'Kelly Variation, Réti System 1. e4 c5 2. Nf3 a6 3. g3 +B28 Sicilian Defense: O'Kelly Variation, Venice System 1. e4 c5 2. Nf3 a6 3. c3 +B28 Sicilian Defense: O'Kelly Variation, Venice System, Barcza Line 1. e4 c5 2. Nf3 a6 3. c3 Nf6 +B28 Sicilian Defense: O'Kelly Variation, Venice System, Gambit Line 1. e4 c5 2. Nf3 a6 3. c3 d5 4. exd5 Nf6 +B28 Sicilian Defense: O'Kelly Variation, Venice System, Ljubojevic Line 1. e4 c5 2. Nf3 a6 3. c3 b5 +B28 Sicilian Defense: O'Kelly Variation, Venice System, Steiner Line 1. e4 c5 2. Nf3 a6 3. c3 d6 +B28 Sicilian Defense: O'Kelly Variation, Wing Gambit 1. e4 c5 2. Nf3 a6 3. b4 +B28 Sicilian Defense: O'Kelly Variation, Yerevan System 1. e4 c5 2. Nf3 a6 3. Nc3 +B29 Sicilian Defense: Nimzowitsch Variation 1. e4 c5 2. Nf3 Nf6 +B29 Sicilian Defense: Nimzowitsch Variation, Advance Variation 1. e4 c5 2. Nf3 Nf6 3. e5 +B29 Sicilian Defense: Nimzowitsch Variation, Closed Variation 1. e4 c5 2. Nf3 Nf6 3. Nc3 +B29 Sicilian Defense: Nimzowitsch Variation, Exchange Variation 1. e4 c5 2. Nf3 Nf6 3. e5 Nd5 4. Nc3 Nxc3 +B29 Sicilian Defense: Nimzowitsch Variation, Main Line 1. e4 c5 2. Nf3 Nf6 3. e5 Nd5 4. Nc3 e6 5. Nxd5 exd5 6. d4 Nc6 +B30 Sicilian Defense: Closed, Anti-Sveshnikov Variation 1. e4 c5 2. Nf3 Nc6 3. Nc3 e5 +B30 Sicilian Defense: Closed, Anti-Sveshnikov Variation, Kharlov-Kramnik Line 1. e4 c5 2. Nf3 Nc6 3. Nc3 e5 4. Bc4 Be7 5. d3 d6 6. Nd2 Bg5 +B30 Sicilian Defense: Closed, Anti-Sveshnikov Variation, with Nf6 1. e4 c5 2. Nf3 Nc6 3. Nc3 e5 4. Bc4 Be7 5. d3 Nf6 +B30 Sicilian Defense: Closed, Anti-Sveshnikov Variation, with d6 1. e4 c5 2. Nf3 Nc6 3. Nc3 e5 4. Bc4 Be7 5. d3 d6 +B30 Sicilian Defense: Nyezhmetdinov-Rossolimo Attack 1. e4 c5 2. Nf3 Nc6 3. Bb5 +B30 Sicilian Defense: Nyezhmetdinov-Rossolimo Attack, Brooklyn Retreat Defense 1. e4 c5 2. Nf3 Nc6 3. Bb5 Nb8 +B30 Sicilian Defense: Nyezhmetdinov-Rossolimo Attack, San Francisco Gambit 1. e4 c5 2. Nf3 Nc6 3. Bb5 Na5 4. b4 +B30 Sicilian Defense: Old Sicilian 1. e4 c5 2. Nf3 Nc6 +B30 Sicilian Defense: Portsmouth Gambit 1. e4 c5 2. Nf3 Nc6 3. b4 +B31 Sicilian Defense: Nyezhmetdinov-Rossolimo Attack, Fianchetto Variation 1. e4 c5 2. Nf3 Nc6 3. Bb5 g6 +B31 Sicilian Defense: Nyezhmetdinov-Rossolimo Attack, Fianchetto Variation, Gufeld Gambit 1. e4 c5 2. Nf3 Nc6 3. Bb5 g6 4. O-O Bg7 5. c3 e5 6. d4 +B31 Sicilian Defense: Nyezhmetdinov-Rossolimo Attack, Fianchetto Variation, Lutikov Gambit 1. e4 c5 2. Nf3 Nc6 3. Bb5 g6 4. O-O Bg7 5. c3 Nf6 6. d4 +B31 Sicilian Defense: Nyezhmetdinov-Rossolimo Attack, Fianchetto Variation, Totsky Attack 1. e4 c5 2. Nf3 Nc6 3. Bb5 g6 4. O-O Bg7 5. c3 Nf6 6. Qa4 +B31 Sicilian Defense: Nyezhmetdinov-Rossolimo Attack, Gurgenidze Variation 1. e4 c5 2. Nf3 Nc6 3. Bb5 g6 4. O-O Bg7 5. Re1 e5 6. b4 +B32 Sicilian Defense: Accelerated Dragon 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 g6 +B32 Sicilian Defense: Flohr Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Qc7 +B32 Sicilian Defense: Franco-Sicilian Variation 1. e4 c5 2. Nf3 Nc6 3. d4 e6 +B32 Sicilian Defense: Godiva Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Qb6 +B32 Sicilian Defense: Kalashnikov Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 e5 5. Nb5 d6 +B32 Sicilian Defense: Löwenthal Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 e5 +B32 Sicilian Defense: Nimzo-American Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 d5 +B32 Sicilian Defense: O'Kelly Variation, Maróczy Bind, Geller Line 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 a6 5. c4 e5 +B32 Sicilian Defense: Open 1. e4 c5 2. Nf3 Nc6 3. d4 +B32 Sicilian Defense: Open 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 +B32 Sicilian Defense: Open 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 +B33 Sicilian Defense: Lasker-Pelikan Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 e5 +B33 Sicilian Defense: Lasker-Pelikan Variation, Bird Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 e5 6. Ndb5 d6 7. Bg5 a6 8. Na3 Be6 +B33 Sicilian Defense: Lasker-Pelikan Variation, Exchange Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 e5 6. Nxc6 +B33 Sicilian Defense: Lasker-Pelikan Variation, Retreat Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 e5 6. Nf3 +B33 Sicilian Defense: Lasker-Pelikan Variation, Schlechter Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 e5 6. Nb3 +B33 Sicilian Defense: Lasker-Pelikan Variation, Sveshnikov Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 e5 6. Ndb5 d6 7. Bg5 a6 8. Na3 b5 +B33 Sicilian Defense: Lasker-Pelikan Variation, Sveshnikov Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 e5 6. Ndb5 d6 7. Bg5 a6 8. Na3 b5 9. Bxf6 gxf6 10. Nd5 f5 +B33 Sicilian Defense: Lasker-Pelikan Variation, Sveshnikov Variation, Chelyabinsk Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 e5 6. Ndb5 d6 7. Bg5 a6 8. Na3 b5 9. Nd5 +B33 Sicilian Defense: Lasker-Pelikan Variation, Sveshnikov Variation, Novosibirsk Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 e5 6. Ndb5 d6 7. Bg5 a6 8. Na3 b5 9. Bxf6 gxf6 10. Nd5 Bg7 +B33 Sicilian Defense: Lasker-Pelikan Variation, Sveshnikov Variation, Peresypkin's Sacrifice 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 e5 6. Ndb5 d6 7. Bg5 a6 8. Na3 b5 9. Bxf6 gxf6 10. Nd5 f5 11. Bxb5 +B33 Sicilian Defense: Open 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 +B34 Sicilian Defense: Accelerated Dragon, Exchange Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 g6 5. Nxc6 +B34 Sicilian Defense: Accelerated Dragon, Modern Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 g6 5. Nc3 +B35 Sicilian Defense: Accelerated Dragon, Modern Bc4 Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 g6 5. Nc3 Bg7 6. Be3 Nf6 7. Bc4 +B35 Sicilian Defense: Dragon Variation, Modern Bc4 Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 g6 5. Nc3 Bg7 6. Be3 Nf6 7. Bc4 d6 +B36 Sicilian Defense: Accelerated Dragon, Maróczy Bind 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 g6 5. c4 +B36 Sicilian Defense: Accelerated Dragon, Maróczy Bind, Gurgenidze Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 g6 5. c4 Nf6 6. Nc3 Nxd4 7. Qxd4 d6 +B37 Sicilian Defense: Accelerated Dragon, Maróczy Bind 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 g6 5. c4 Bg7 +B37 Sicilian Defense: Accelerated Dragon, Simagin Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 g6 5. c4 Bg7 6. Nc2 d6 7. Be2 Nh6 +B38 Sicilian Defense: Accelerated Dragon, Maróczy Bind 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 g6 5. c4 Bg7 6. Be3 +B39 Sicilian Defense: Accelerated Dragon, Maróczy Bind, Breyer Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 g6 5. c4 Bg7 6. Be3 Nf6 7. Nc3 Ng4 +B40 Sicilian Defense: Alapin Variation, Sherzer Variation 1. e4 c5 2. Nf3 e6 3. c3 Nf6 4. e5 Nd5 5. d4 Nc6 +B40 Sicilian Defense: Delayed Alapin Variation, with e6 1. e4 c5 2. Nf3 e6 3. c3 +B40 Sicilian Defense: Drazic Variation 1. e4 c5 2. Nf3 e6 3. d4 a6 +B40 Sicilian Defense: French Variation 1. e4 c5 2. Nf3 e6 +B40 Sicilian Defense: French Variation, Normal 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nf6 +B40 Sicilian Defense: French Variation, Open 1. e4 c5 2. Nf3 e6 3. d4 cxd4 +B40 Sicilian Defense: French Variation, Westerinen Attack 1. e4 c5 2. Nf3 e6 3. b3 +B40 Sicilian Defense: Gaw-Paw Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Qb6 +B40 Sicilian Defense: Kan Variation, Wing Attack, Fianchetto Variation 1. e4 c5 2. Nf3 e6 3. Nc3 a6 4. g3 b5 5. d4 cxd4 6. Nxd4 +B40 Sicilian Defense: Kramnik Variation 1. e4 c5 2. Nf3 e6 3. c4 +B40 Sicilian Defense: Kveinis Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Qb6 +B40 Sicilian Defense: Marshall Counterattack 1. e4 c5 2. Nf3 e6 3. d4 d5 +B40 Sicilian Defense: Paulsen-Basman Defense 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Bc5 +B40 Sicilian Defense: Pin Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Bb4 +B40 Sicilian Defense: Pin Variation, Jaffe Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Bb4 6. Bd3 e5 +B40 Sicilian Defense: Pin Variation, Koch Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Bb4 6. e5 +B40 Sicilian Defense: Smith-Morra Gambit Deferred 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. c3 +B40 Sicilian Defense: Wing Gambit Deferred 1. e4 c5 2. Nf3 e6 3. b4 +B41 Sicilian Defense: Kan Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 a6 +B41 Sicilian Defense: Kan Variation, Maróczy Bind, Bronstein Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 a6 5. c4 Nf6 6. Nc3 Bb4 7. Bd3 Nc6 +B41 Sicilian Defense: Kan Variation, Maróczy Bind, Bronstein Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 a6 5. c4 Nf6 6. Nc3 Bb4 7. Bd3 Nc6 8. Bc2 +B41 Sicilian Defense: Kan Variation, Maróczy Bind, Hedgehog Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 a6 5. c4 g6 +B41 Sicilian Defense: Kan Variation, Maróczy Bind, Réti Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 a6 5. c4 +B42 Sicilian Defense: Kan Variation, Gipslis Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 a6 5. Bd3 Nf6 6. O-O d6 7. c4 g6 +B42 Sicilian Defense: Kan Variation, Modern Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 a6 5. Bd3 +B42 Sicilian Defense: Kan Variation, Polugaevsky Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 a6 5. Bd3 Bc5 +B42 Sicilian Defense: Kan Variation, Swiss Cheese Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 a6 5. Bd3 g6 +B43 Sicilian Defense: Kan Variation, Knight Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 a6 5. Nc3 +B43 Sicilian Defense: Kan Variation, Knight Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 a6 5. Nc3 b5 6. g3 Bb7 7. Bg2 +B43 Sicilian Defense: Kan Variation, Wing Attack 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 a6 5. Nc3 b5 +B43 Sicilian Defense: Kan Variation, Wing Attack, Christiansen's Dream 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 a6 5. Nc3 b5 6. Bd3 Qb6 7. Be3 Bc5 8. Qg4 +B43 Sicilian Defense: Kan Variation, Wing Attack, Spraggett Attack 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 a6 5. Nc3 b5 6. Bd3 Qb6 7. Nf3 +B44 Sicilian Defense: Taimanov Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 +B44 Sicilian Defense: Taimanov Variation, Gary Gambit 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nb5 d6 6. c4 Nf6 7. N1c3 a6 8. Na3 d5 +B44 Sicilian Defense: Taimanov Variation, Modern Line 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nb5 d6 6. c4 Nf6 7. N1c3 a6 8. Na3 Be7 9. Be2 O-O 10. O-O b6 +B44 Sicilian Defense: Taimanov Variation, Szén Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nb5 +B45 Sicilian Defense: Four Knights Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nc3 Nf6 +B45 Sicilian Defense: Four Knights Variation, American Attack 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nc3 Nf6 6. Ndb5 Bb4 7. Nd6+ +B45 Sicilian Defense: Four Knights Variation, Cobra Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nc3 Nf6 6. Ndb5 Bc5 +B45 Sicilian Defense: Four Knights Variation, Exchange Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nc3 Nf6 6. Nxc6 +B45 Sicilian Defense: Four Knights Variation, Sveshnikov Transfer 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nc3 Nf6 6. Ndb5 d6 +B45 Sicilian Defense: Taimanov Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nc3 +B46 Sicilian Defense: Taimanov Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nc3 a6 +B47 Sicilian Defense: Taimanov Variation, Bastrikov Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nc3 Qc7 +B47 Sicilian Defense: Taimanov Variation, Bastrikov Variation, Ponomariov Gambit 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nc3 Qc7 6. Ndb5 Qb8 7. Be3 a6 8. Bb6 +B48 Sicilian Defense: Taimanov Variation, Bastrikov Variation, English Attack 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nc3 Qc7 6. Be3 +B49 Sicilian Defense: Taimanov Variation, Bastrikov Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nc3 Qc7 6. Be3 a6 7. Be2 +B50 Sicilian Defense 1. e4 c5 2. Nf3 d6 3. d4 +B50 Sicilian Defense 1. e4 c5 2. Nf3 d6 3. d4 cxd4 +B50 Sicilian Defense: Delayed Alapin Variation, Basman-Palatnik Double Gambit 1. e4 c5 2. Nf3 d6 3. c3 Nf6 4. Be2 Nc6 5. d4 cxd4 6. cxd4 Nxe4 7. d5 Qa5+ 8. Nc3 Nxc3 9. bxc3 +B50 Sicilian Defense: Delayed Alapin Variation, Basman-Palatnik Gambit 1. e4 c5 2. Nf3 d6 3. c3 Nf6 4. Be2 Nc6 5. d4 cxd4 6. cxd4 Nxe4 +B50 Sicilian Defense: Delayed Alapin Variation, with d6 1. e4 c5 2. Nf3 d6 3. c3 +B50 Sicilian Defense: Kopec System 1. e4 c5 2. Nf3 d6 3. Bd3 +B50 Sicilian Defense: Kotov Gambit 1. e4 c5 2. Nf3 d6 3. g3 b5 +B50 Sicilian Defense: Modern Variations 1. e4 c5 2. Nf3 d6 +B50 Sicilian Defense: Modern Variations, Anti-Qxd4 Move Order 1. e4 c5 2. Nf3 d6 3. d4 Nf6 +B50 Sicilian Defense: Modern Variations, Anti-Qxd4 Move Order Accepted 1. e4 c5 2. Nf3 d6 3. d4 Nf6 4. dxc5 Nxe4 +B50 Sicilian Defense: Modern Variations, Tartakower 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. c3 +B50 Sicilian Defense: Wing Gambit, Deferred Variation 1. e4 c5 2. Nf3 d6 3. b4 +B51 Sicilian Defense: Moscow Variation 1. e4 c5 2. Nf3 d6 3. Bb5+ +B51 Sicilian Defense: Moscow Variation, Dorfman Gambit 1. e4 c5 2. Nf3 d6 3. Bb5+ Nc6 4. O-O Bd7 5. Qe2 g6 6. e5 +B51 Sicilian Defense: Moscow Variation, Moscow Gambit 1. e4 c5 2. Nf3 d6 3. Bb5+ Nc6 4. O-O Bd7 5. c3 Nf6 6. Re1 a6 7. Bxc6 Bxc6 8. d4 Bxe4 9. Bg5 +B52 Sicilian Defense: Moscow Variation, Haag Gambit 1. e4 c5 2. Nf3 d6 3. Bb5+ Bd7 4. Bxd7+ Qxd7 5. O-O Nc6 6. c3 Nf6 7. d4 +B52 Sicilian Defense: Moscow Variation, Main Line 1. e4 c5 2. Nf3 d6 3. Bb5+ Bd7 +B52 Sicilian Defense: Moscow Variation, Sokolsky Variation 1. e4 c5 2. Nf3 d6 3. Bb5+ Bd7 4. Bxd7+ Qxd7 5. c4 +B53 Sicilian Defense: Chekhover Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Qxd4 +B53 Sicilian Defense: Chekhover Variation, Zaitsev Defense 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Qxd4 Nc6 5. Bb5 Qd7 +B54 Sicilian Defense: Dragon Variation, Accelerated Dragon 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 g6 +B54 Sicilian Defense: Modern Variations, Ginsberg Gambit 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Bc4 +B54 Sicilian Defense: Modern Variations, Main Line 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 +B54 Sicilian Defense: Prins Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. f3 +B55 Sicilian Defense: Prins Variation, Venice Attack 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. f3 e5 6. Bb5+ +B56 Sicilian Defense: Classical Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Nc6 +B56 Sicilian Defense: Classical Variation, Fianchetto Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Nc6 6. g3 +B56 Sicilian Defense: Kupreichik Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Bd7 +B56 Sicilian Defense: Spielmann Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Nde2 +B56 Sicilian Defense: Venice Attack 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 e5 6. Bb5+ +B57 Sicilian Defense: Classical Variation, Anti-Sozin Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Bc4 Qb6 +B57 Sicilian Defense: Classical Variation, Sozin Attack 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Nc6 6. Bc4 +B57 Sicilian Defense: Magnus Smith Trap 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Bc4 g6 7. Nxc6 bxc6 8. e5 +B58 Sicilian Defense: Boleslavsky Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Nc6 6. Be2 e5 +B58 Sicilian Defense: Boleslavsky Variation, Louma Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Be2 e5 7. Nxc6 +B58 Sicilian Defense: Classical Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Nc6 6. Be2 +B58 Sicilian Defense: Classical Variation, Dragon Transfer 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Nc6 6. Be2 Nxd4 7. Qxd4 g6 +B59 Sicilian Defense: Boleslavsky Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Be2 e5 7. Nb3 +B60 Sicilian Defense: Richter-Rauzer Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Nc6 6. Bg5 +B60 Sicilian Defense: Richter-Rauzer Variation, Dragon Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Bg5 g6 +B60 Sicilian Defense: Richter-Rauzer Variation, Modern Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Nc6 6. Bg5 Bd7 +B61 Sicilian Defense: Richter-Rauzer Variation, Modern Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Bg5 Bd7 7. Qd2 +B62 Sicilian Defense: Richter-Rauzer Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Nc6 6. Bg5 e6 +B62 Sicilian Defense: Richter-Rauzer Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Nc6 6. Bg5 e6 7. Qd3 +B62 Sicilian Defense: Richter-Rauzer Variation, Exchange Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Nc6 6. Bg5 e6 7. Nxc6 +B62 Sicilian Defense: Richter-Rauzer Variation, Podebrady Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Bg5 e6 7. Nb3 +B62 Sicilian Defense: Richter-Rauzer Variation, Vitolins Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Nc6 6. Bg5 e6 7. Bb5 +B63 Sicilian Defense: Richter-Rauzer Variation, Classical Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Nc6 6. Bg5 e6 7. Qd2 Be7 +B63 Sicilian Defense: Richter-Rauzer Variation, Classical Variation, Kantscher Line 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Nc6 6. Bg5 e6 7. Qd2 Be7 8. O-O-O Nxd4 9. Qxd4 a6 10. f4 b5 +B63 Sicilian Defense: Richter-Rauzer Variation, Ivanov Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Nc6 6. Bg5 e6 7. Qd2 Qb6 +B63 Sicilian Defense: Richter-Rauzer Variation, Traditional Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Nc6 6. Bg5 e6 7. Qd2 +B64 Sicilian Defense: Richter-Rauzer Variation, Classical Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Bg5 e6 7. Qd2 Be7 8. O-O-O O-O 9. f4 e5 +B64 Sicilian Defense: Richter-Rauzer Variation, Classical Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Nc6 6. Bg5 e6 7. Qd2 Be7 8. O-O-O O-O 9. f4 +B65 Sicilian Defense: Richter-Rauzer Variation, Classical Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Nc6 6. Bg5 e6 7. Qd2 Be7 8. O-O-O O-O 9. f4 Nxd4 10. Qxd4 +B65 Sicilian Defense: Richter-Rauzer Variation, Rauzer Attack 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Nc6 6. Bg5 e6 7. Qd2 Be7 8. O-O-O O-O 9. f4 Nxd4 +B66 Sicilian Defense: Richter-Rauzer Variation, Neo-Modern Variation, Early Deviations 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Nc6 6. Bg5 e6 7. Qd2 a6 +B67 Sicilian Defense: Richter-Rauzer Variation, Neo-Modern Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Bg5 e6 7. Qd2 a6 8. O-O-O Bd7 +B68 Sicilian Defense: Richter-Rauzer Variation, Neo-Modern Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Bg5 e6 7. Qd2 a6 8. O-O-O Bd7 9. f4 Be7 +B69 Sicilian Defense: Richter-Rauzer Variation, Neo-Modern Variation, Nyezhmetdinov Attack 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Bg5 e6 7. Qd2 a6 8. O-O-O Bd7 9. f4 Be7 10. Nf3 b5 11. Bxf6 +B70 Sicilian Defense: Dragon Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 +B70 Sicilian Defense: Dragon Variation, Classical Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be2 +B70 Sicilian Defense: Dragon Variation, Fianchetto Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. g3 +B71 Sicilian Defense: Dragon Variation, Levenfish Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. f4 +B71 Sicilian Defense: Dragon Variation, Levenfish Variation, Main Line 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. f4 Nbd7 +B72 Sicilian Defense: Dragon Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 +B72 Sicilian Defense: Dragon Variation, Classical Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. Be2 +B72 Sicilian Defense: Dragon Variation, Classical Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. Be2 Nc6 +B72 Sicilian Defense: Dragon Variation, Classical Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. Be2 Nc6 8. Nb3 +B72 Sicilian Defense: Dragon Variation, Classical Variation, Amsterdam Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Be2 g6 7. Be3 Bg7 8. Qd2 +B72 Sicilian Defense: Dragon Variation, Classical Variation, Grigoriev Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Be2 g6 7. Be3 Bg7 8. Qd2 O-O 9. O-O-O +B73 Sicilian Defense: Dragon Variation, Classical Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be2 Bg7 7. O-O Nc6 8. Be3 +B73 Sicilian Defense: Dragon Variation, Classical Variation, Battery Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be2 Bg7 7. O-O O-O 8. Be3 Nc6 9. Qd2 +B73 Sicilian Defense: Dragon Variation, Classical Variation, Zollner Gambit 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 g6 5. Be3 Bg7 6. Be2 Nf6 7. Nc3 O-O 8. O-O d6 9. f4 Qb6 10. e5 +B74 Sicilian Defense: Dragon Variation, Classical Variation, Alekhine Line 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 g6 5. Nc3 Bg7 6. Be3 Nf6 7. Be2 O-O 8. O-O d6 9. Nb3 a5 +B74 Sicilian Defense: Dragon Variation, Classical Variation, Bernard Defense 1. e4 c5 2. Nf3 g6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Be2 Bg7 7. O-O O-O 8. Be3 Nc6 9. Nb3 Be6 10. f4 Na5 11. f5 Bc4 12. Bd3 Bxd3 13. cxd3 d5 +B74 Sicilian Defense: Dragon Variation, Classical Variation, Maróczy Line 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be2 Bg7 7. O-O O-O 8. Be3 Nc6 9. Nb3 Be6 10. f4 Na5 +B74 Sicilian Defense: Dragon Variation, Classical Variation, Normal Line 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be2 Bg7 7. O-O O-O 8. Be3 Nc6 9. Nb3 +B74 Sicilian Defense: Dragon Variation, Classical Variation, Spielmann Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 g6 5. Nc3 Bg7 6. Be3 Nf6 7. Be2 O-O 8. Nb3 d6 9. O-O Be6 10. f4 Na5 11. f5 Bc4 12. Bd3 +B74 Sicilian Defense: Dragon Variation, Classical Variation, Stockholm Attack 1. e4 c5 2. Nc3 d6 3. f4 Nc6 4. Nf3 g6 5. d4 cxd4 6. Nxd4 Bg7 7. Be3 Nf6 8. Be2 O-O 9. Nb3 Be6 10. O-O Na5 11. f5 Bc4 12. Nxa5 Bxe2 13. Qxe2 Qxa5 14. g4 +B74 Sicilian Defense: Dragon Variation, Classical Variation, Tartakower Line 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be2 Bg7 7. O-O O-O 8. Be3 Nc6 9. Nb3 Be6 10. f4 Qc8 +B75 Sicilian Defense: Dragon Variation, Yugoslav Attack, Belezky Line 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. f3 Nc6 +B75 Sicilian Defense: Dragon Variation, Yugoslav Attack, Early Deviations 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. f3 +B75 Sicilian Defense: Dragon Variation, Yugoslav Attack, Hungarian Dragon 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Nc6 7. f3 h5 +B76 Sicilian Defense: Dragon Variation, Yugoslav Attack 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. f3 O-O +B76 Sicilian Defense: Dragon Variation, Yugoslav Attack 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. f3 O-O 8. Qd2 Nc6 +B76 Sicilian Defense: Dragon Variation, Yugoslav Attack, Modern Line 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. f3 Nc6 8. Qd2 O-O 9. O-O-O +B76 Sicilian Defense: Dragon Variation, Yugoslav Attack, Panov Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. f3 O-O 8. Qd2 Nc6 9. g4 +B77 Sicilian Defense: Dragon Variation, Yugoslav Attack, Byrne Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. f3 O-O 8. Qd2 Nc6 9. Bc4 a5 +B77 Sicilian Defense: Dragon Variation, Yugoslav Attack, Czerniak Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. f3 Nc6 8. Qd2 O-O 9. Bc4 Nxd4 10. Bxd4 Be6 +B77 Sicilian Defense: Dragon Variation, Yugoslav Attack, Czerniak Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. f3 Nc6 8. Qd2 O-O 9. Bc4 Nxd4 10. Bxd4 Be6 11. Bb3 Qa5 +B77 Sicilian Defense: Dragon Variation, Yugoslav Attack, Main Line 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. f3 O-O 8. Qd2 Nc6 9. Bc4 +B77 Sicilian Defense: Dragon Variation, Yugoslav Attack, Main Line 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. f3 O-O 8. Qd2 Nc6 9. Bc4 Bd7 +B77 Sicilian Defense: Dragon Variation, Yugoslav Attack, Main Line 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. f3 O-O 8. Qd2 Nc6 9. Bc4 Bd7 10. Bb3 +B77 Sicilian Defense: Dragon Variation, Yugoslav Attack, Sosonko Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. f3 Nc6 8. Qd2 O-O 9. Bc4 Nd7 +B78 Sicilian Defense: Dragon Variation, Yugoslav Attack 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. f3 O-O 8. Qd2 Nc6 9. Bc4 Bd7 10. O-O-O +B78 Sicilian Defense: Dragon Variation, Yugoslav Attack, Chinese Dragon 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. f3 O-O 8. Qd2 Nc6 9. Bc4 Bd7 10. O-O-O Rb8 +B78 Sicilian Defense: Dragon Variation, Yugoslav Attack, Old Line 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. f3 O-O 8. Qd2 Nc6 9. Bc4 Bd7 10. O-O-O Rc8 +B78 Sicilian Defense: Dragon Variation, Yugoslav Attack, Topalov Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. f3 O-O 8. Qd2 Nc6 9. Bc4 Bd7 10. O-O-O Rc8 11. Bb3 Nxd4 12. Bxd4 +B79 Sicilian Defense: Dragon Variation, Yugoslav Attack 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. f3 O-O 8. Qd2 Nc6 9. Bc4 Bd7 10. h4 Qa5 11. O-O-O Rfc8 12. Bb3 +B79 Sicilian Defense: Dragon Variation, Yugoslav Attack, Soltis Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6 6. Be3 Bg7 7. f3 O-O 8. Qd2 Nc6 9. Bc4 Bd7 10. O-O-O Qa5 11. h4 Rfc8 12. Bb3 h5 +B80 Sicilian Defense: Scheveningen Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 +B80 Sicilian Defense: Scheveningen Variation, English Attack, with Qd2 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be3 e6 7. Qd2 +B80 Sicilian Defense: Scheveningen Variation, Fianchetto Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. g3 +B80 Sicilian Defense: Scheveningen Variation, Vitolins Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Bb5+ +B81 Sicilian Defense: Scheveningen Variation, Keres Attack 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. g4 +B82 Sicilian Defense: Scheveningen Variation, Matanovic Attack 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. f4 +B82 Sicilian Defense: Scheveningen Variation, Tal Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. f4 Nc6 7. Be3 Be7 8. Qf3 +B83 Sicilian Defense: Scheveningen Variation, Classical Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Be2 +B83 Sicilian Defense: Scheveningen Variation, Modern Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nc3 d6 6. Be2 Nf6 +B83 Sicilian Defense: Scheveningen Variation, Modern Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Be2 Be7 7. O-O O-O 8. f4 Nc6 9. Be3 +B83 Sicilian Defense: Scheveningen Variation, Modern Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Be2 Be7 7. O-O O-O 8. f4 Nc6 9. Be3 Bd7 10. Nb3 +B84 Sicilian Defense: Najdorf Variation, Scheveningen Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be2 e6 7. O-O Nbd7 +B84 Sicilian Defense: Scheveningen Variation, Classical Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be2 e6 +B84 Sicilian Defense: Scheveningen Variation, Classical Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be2 e6 7. O-O Qc7 +B85 Sicilian Defense: Scheveningen Variation, Classical Main Line 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nc3 Qc7 6. Be2 a6 7. O-O Nf6 8. Be3 Be7 9. f4 d6 10. Qe1 O-O +B85 Sicilian Defense: Scheveningen Variation, Classical Variation, Paulsen Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. f4 e6 7. Be2 Qc7 8. O-O Nc6 +B85 Sicilian Defense: Scheveningen Variation, Classical Variation, Paulsen Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nc3 Qc7 6. Be2 a6 7. O-O Nf6 8. Be3 d6 9. f4 +B85 Sicilian Defense: Scheveningen Variation, Classical Variation, Paulsen Variation 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nc3 Qc7 6. Be2 a6 7. O-O Nf6 8. Kh1 Be7 9. f4 d6 10. a4 +B86 Sicilian Defense: Sozin Attack 1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Bc4 +B87 Sicilian Defense: Sozin Attack, Flank Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Bc4 e6 7. Bb3 b5 +B88 Sicilian Defense: Sozin Attack, Fischer Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Bc4 e6 7. Bb3 Be7 8. Be3 O-O 9. f4 +B88 Sicilian Defense: Sozin Attack, Leonhardt Variation 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Bc4 e6 +B89 Sicilian Defense: Sozin Attack, Main Line 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Bc4 e6 7. Be3 +B89 Sicilian Defense: Sozin Attack, Main Line, Sherbakov Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 Nc6 6. Bc4 e6 7. Be3 Be7 8. Bb3 O-O 9. O-O Na5 10. f4 b6 +B89 Sicilian Defense: Velimirovic Attack 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Bc4 e6 7. Be3 Be7 8. Qe2 +B90 Sicilian Defense: Najdorf Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 +B90 Sicilian Defense: Najdorf Variation, Adams Attack 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. h3 +B90 Sicilian Defense: Najdorf Variation, Dekker Gambit 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. g4 +B90 Sicilian Defense: Najdorf Variation, English Attack 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be3 +B90 Sicilian Defense: Najdorf Variation, English Attack 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be3 e5 7. Nb3 Be6 8. f3 +B90 Sicilian Defense: Najdorf Variation, English Attack 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be3 e5 7. Nb3 Be7 8. f3 +B90 Sicilian Defense: Najdorf Variation, English Attack 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be3 e5 7. Nb3 Be6 8. h3 +B90 Sicilian Defense: Najdorf Variation, English Attack 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be3 e5 7. Nb3 Be7 8. h3 +B90 Sicilian Defense: Najdorf Variation, English Attack, Anti-English 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be3 Ng4 +B90 Sicilian Defense: Najdorf Variation, Lipnitsky Attack 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Bc4 +B90 Sicilian Defense: Najdorf Variation, Petronić Attack 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Rg1 +B90 Sicilian Defense: Najdorf Variation, Yates Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Bd3 +B90 Sicilian Defense: Scheveningen Variation, Delayed Keres Attack 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be3 e6 7. g4 +B90 Sicilian Defense: Scheveningen Variation, Delayed Keres Attack, Perenyi Gambit 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be3 e6 7. g4 e5 8. Nf5 g6 9. g5 +B90 Sicilian Defense: Scheveningen Variation, English Attack, with f3 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be3 e6 7. f3 +B91 Sicilian Defense: Najdorf Variation, Zagreb Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. g3 +B92 Sicilian Defense: Najdorf Variation, Opocensky Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be2 +B92 Sicilian Defense: Najdorf Variation, Opocensky Variation 1. e4 c5 2. Nf3 Nf6 3. Nc3 d6 4. d4 cxd4 5. Nxd4 a6 6. Be2 e5 7. Nb3 Be6 8. Be3 +B92 Sicilian Defense: Najdorf Variation, Opocensky Variation, Modern Line 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be2 e5 7. Nb3 Be7 8. O-O Be6 +B92 Sicilian Defense: Najdorf Variation, Opocensky Variation, Traditional Line 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be2 e5 7. Nb3 Be7 8. O-O O-O +B93 Sicilian Defense: Najdorf Variation, Amsterdam Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. f4 +B94 Sicilian Defense: Najdorf Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Bg5 +B94 Sicilian Defense: Najdorf Variation, Ivkov Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Bg5 Nbd7 7. Bc4 Qa5 8. Qd2 e6 9. O-O-O b5 10. Bb3 Bb7 11. Rhe1 Nc5 12. e5 +B95 Sicilian Defense: Najdorf Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Bg5 e6 +B96 Sicilian Defense: Najdorf Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Bg5 e6 7. f4 +B96 Sicilian Defense: Najdorf Variation, Neo-Classical Defense 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Bg5 e6 7. f4 Nc6 +B96 Sicilian Defense: Najdorf Variation, Polugaevsky Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Bg5 e6 7. f4 b5 +B96 Sicilian Defense: Najdorf Variation, Polugaevsky Variation, Simagin Line 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Bg5 e6 7. f4 b5 8. e5 dxe5 9. fxe5 Qc7 10. Qe2 +B97 Sicilian Defense: Najdorf Variation, Poisoned Pawn Accepted 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Bg5 e6 7. f4 Qb6 8. Qd2 Qxb2 9. Rb1 Qa3 +B97 Sicilian Defense: Najdorf Variation, Poisoned Pawn Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Bg5 e6 7. f4 Qb6 +B98 Sicilian Defense: Najdorf Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Bg5 e6 7. f4 Be7 +B98 Sicilian Defense: Najdorf Variation, Browne Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Bg5 e6 7. f4 Be7 8. Qf3 h6 9. Bh4 Qc7 +B98 Sicilian Defense: Najdorf Variation, Goteborg Variation 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Bg5 e6 7. f4 Be7 8. Qf3 h6 9. Bh4 g5 +B98 Sicilian Defense: Najdorf Variation, Traditional Line 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Bg5 e6 7. f4 Be7 8. Qf3 Qc7 +B99 Sicilian Defense: Najdorf Variation, Main Line 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Bg5 e6 7. f4 Be7 8. Qf3 Qc7 9. O-O-O Nbd7 diff --git a/crates/prep/data/c.tsv b/crates/prep/data/c.tsv new file mode 100644 index 0000000..4b3d9c9 --- /dev/null +++ b/crates/prep/data/c.tsv @@ -0,0 +1,1251 @@ +eco name pgn +C00 French Defense 1. e4 e6 +C00 French Defense 1. e4 e6 2. d4 d5 +C00 French Defense: Alapin Gambit 1. e4 e6 2. d4 d5 3. Be3 +C00 French Defense: Baeuerle Gambit 1. e4 e6 2. d4 b5 +C00 French Defense: Banzai-Leong Gambit 1. e4 e6 2. b4 +C00 French Defense: Banzai-Leong Gambit, Pinova Gambit 1. e4 e6 2. b4 Bxb4 3. e5 +C00 French Defense: Bird Invitation 1. e4 e6 2. Bb5 +C00 French Defense: Carlson Gambit 1. e4 e6 2. d4 d5 3. Nf3 dxe4 4. Ne5 +C00 French Defense: Chigorin Variation 1. e4 e6 2. Qe2 +C00 French Defense: Diemer-Duhm Gambit 1. e4 e6 2. d4 d5 3. c4 +C00 French Defense: Diemer-Duhm Gambit Accepted 1. e4 e6 2. d4 d5 3. c4 dxe4 +C00 French Defense: Franco-Hiva Gambit 1. e4 e6 2. d4 f5 +C00 French Defense: Franco-Hiva Gambit Accepted 1. e4 e6 2. d4 f5 3. exf5 +C00 French Defense: Franco-Sicilian Defense 1. e4 e6 2. d4 c5 +C00 French Defense: Hoffmann Gambit 1. e4 e6 2. d4 d5 3. Qe2 e5 4. f4 exf4 +C00 French Defense: Horwitz Attack 1. e4 e6 2. b3 +C00 French Defense: Horwitz Attack, Papa-Ticulat Gambit 1. e4 e6 2. b3 d5 3. Bb2 +C00 French Defense: King's Indian Attack 1. e4 e6 2. d3 +C00 French Defense: King's Indian Attack, Franco-Hiva Gambit 1. e4 e6 2. d3 f5 +C00 French Defense: Knight Variation 1. e4 e6 2. Nf3 +C00 French Defense: Knight Variation, Franco-Hiva Gambit 1. e4 e6 2. Nf3 f5 +C00 French Defense: La Bourdonnais Variation 1. e4 e6 2. f4 +C00 French Defense: La Bourdonnais Variation, Reuter Gambit 1. e4 e6 2. f4 d5 3. Nf3 dxe4 +C00 French Defense: Mediterranean Defense 1. e4 e6 2. d4 Nf6 +C00 French Defense: Morphy Gambit 1. e4 e6 2. d4 d5 3. Nh3 +C00 French Defense: Normal Variation 1. e4 e6 2. d4 +C00 French Defense: Orthoschnapp Gambit 1. e4 e6 2. c4 d5 3. cxd5 exd5 4. Qb3 +C00 French Defense: Pelikan Variation 1. e4 e6 2. Nc3 d5 3. f4 +C00 French Defense: Perseus Gambit 1. e4 e6 2. d4 d5 3. Nf3 +C00 French Defense: Queen's Knight 1. e4 e6 2. Nc3 +C00 French Defense: Reversed Philidor Formation 1. e4 e6 2. d3 d5 3. Nd2 Nf6 4. Ngf3 Nc6 5. Be2 +C00 French Defense: Réti-Spielmann Attack 1. e4 e6 2. g3 +C00 French Defense: Schlechter Variation 1. e4 e6 2. d4 d5 3. Bd3 +C00 French Defense: St. George Defense 1. e4 e6 2. d4 a6 +C00 French Defense: St. George Defense, Sanky-George Gambit 1. e4 e6 2. d4 a6 3. c4 b5 +C00 French Defense: St. George Defense, St. George Gambit 1. e4 e6 2. d4 a6 3. c4 b5 4. cxb5 axb5 +C00 French Defense: St. George Defense, Three Pawn Attack 1. e4 e6 2. d4 a6 3. c4 +C00 French Defense: St. George Defense, Traditional Line 1. e4 e6 2. d4 a6 3. Nf3 b5 4. Bd3 c5 5. c3 Bb7 6. O-O Nf6 +C00 French Defense: Steiner Variation 1. e4 e6 2. c4 +C00 French Defense: Steinitz Attack 1. e4 e6 2. e5 +C00 French Defense: Two Knights Variation 1. e4 e6 2. Nf3 d5 3. Nc3 +C00 French Defense: Wing Gambit 1. e4 e6 2. Nf3 d5 3. e5 c5 4. b4 +C00 Rat Defense: Small Center Defense 1. d4 e6 2. e4 d6 +C01 French Defense: Exchange Variation 1. e4 e6 2. d4 d5 3. exd5 +C01 French Defense: Exchange Variation 1. e4 e6 2. d4 d5 3. exd5 exd5 4. Nf3 +C01 French Defense: Exchange Variation 1. e4 e6 2. d4 d5 3. exd5 exd5 4. Nc3 +C01 French Defense: Exchange Variation, Bogoljubow Variation 1. e4 e6 2. d4 d5 3. exd5 exd5 4. Nc3 Nf6 5. Bg5 Nc6 +C01 French Defense: Exchange Variation, Monte Carlo Variation 1. e4 e6 2. d4 d5 3. exd5 exd5 4. c4 +C01 French Defense: Exchange Variation, Svenonius Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. exd5 exd5 5. Bg5 +C02 French Defense: Advance Variation 1. e4 e6 2. d4 d5 3. e5 +C02 French Defense: Advance Variation 1. e4 e6 2. d4 d5 3. e5 c5 +C02 French Defense: Advance Variation 1. e4 e6 2. d4 d5 3. e5 c5 4. c3 +C02 French Defense: Advance Variation 1. e4 e6 2. d4 d5 3. e5 c5 4. c3 Nc6 +C02 French Defense: Advance Variation, Euwe Variation 1. e4 e6 2. d4 d5 3. e5 c5 4. c3 Nc6 5. Nf3 Bd7 +C02 French Defense: Advance Variation, Extended Bishop Swap 1. e4 e6 2. d4 d5 3. e5 Bd7 +C02 French Defense: Advance Variation, Frenkel Gambit 1. e4 e6 2. d4 d5 3. e5 c5 4. b4 +C02 French Defense: Advance Variation, Kupreichik Variation 1. e4 e6 2. d4 d5 3. e5 c5 4. c3 Nc6 5. Be3 +C02 French Defense: Advance Variation, Lputian Variation 1. e4 e6 2. d4 d5 3. e5 c5 4. c3 Nc6 5. Nf3 Qb6 6. a3 Nh6 +C02 French Defense: Advance Variation, Main Line 1. e4 e6 2. d4 d5 3. e5 c5 4. c3 Nc6 5. Nf3 Qb6 6. a3 +C02 French Defense: Advance Variation, Milner-Barry Gambit 1. e4 e6 2. d4 d5 3. e5 c5 4. c3 Nc6 5. Nf3 Qb6 6. Bd3 +C02 French Defense: Advance Variation, Milner-Barry Gambit, Hector Variation 1. e4 e6 2. d4 d5 3. e5 c5 4. c3 Nc6 5. Nf3 Qb6 6. Bd3 cxd4 7. O-O +C02 French Defense: Advance Variation, Milner-Barry Gambit, Hector Variation 1. e4 e6 2. d4 d5 3. e5 c5 4. c3 Nc6 5. Nf3 Qb6 6. Bd3 cxd4 7. O-O Bd7 8. Re1 +C02 French Defense: Advance Variation, Milner-Barry Gambit, Main Line 1. e4 e6 2. d4 d5 3. e5 c5 4. c3 Nc6 5. Nf3 Qb6 6. Bd3 cxd4 7. cxd4 Bd7 8. O-O +C02 French Defense: Advance Variation, Milner-Barry Gambit, Sørensen Variation 1. e4 e6 2. d4 d5 3. e5 c5 4. c3 Nc6 5. Nf3 Qb6 6. Bd3 cxd4 7. cxd4 Bd7 8. O-O Nxd4 9. Ng5 +C02 French Defense: Advance Variation, Nimzowitsch Attack 1. e4 e6 2. d4 d5 3. e5 c5 4. Qg4 +C02 French Defense: Advance Variation, Nimzowitsch Gambit 1. e4 e6 2. d4 d5 3. e5 c5 4. Qg4 cxd4 5. Nf3 +C02 French Defense: Advance Variation, Nimzowitsch System 1. e4 e6 2. d4 d5 3. e5 c5 4. Nf3 +C02 French Defense: Advance Variation, Paulsen Attack 1. e4 e6 2. d4 d5 3. e5 c5 4. c3 Nc6 5. Nf3 +C02 French Defense: Advance Variation, Ruisdonk Gambit 1. e4 e6 2. d4 d5 3. e5 c5 4. Nf3 cxd4 5. Bd3 +C02 French Defense: Advance Variation, Steinitz Variation 1. e4 e6 2. d4 d5 3. e5 c5 4. dxc5 +C02 French Defense: Advance Variation, Wade Variation 1. e4 e6 2. d4 d5 3. e5 c5 4. c3 Qb6 5. Nf3 Bd7 +C03 French Defense: Tarrasch Variation 1. e4 e6 2. d4 d5 3. Nd2 +C03 French Defense: Tarrasch Variation, Guimard Defense 1. e4 e6 2. d4 d5 3. Nd2 Nc6 +C03 French Defense: Tarrasch Variation, Guimard Defense, Thunderbunny Variation 1. e4 e6 2. d4 d5 3. Nd2 Nc6 4. c3 dxe4 5. Nxe4 e5 +C03 French Defense: Tarrasch Variation, Haberditz Variation 1. e4 e6 2. d4 d5 3. Nd2 f5 +C03 French Defense: Tarrasch Variation, Modern System 1. e4 e6 2. d4 d5 3. Nd2 a6 +C03 French Defense: Tarrasch Variation, Morozevich Variation 1. e4 e6 2. d4 d5 3. Nd2 Be7 +C04 French Defense: Tarrasch Variation, Guimard Defense, Main Line 1. e4 e6 2. d4 d5 3. Nd2 Nc6 4. Ngf3 Nf6 +C05 French Defense: Tarrasch Variation, Botvinnik Variation 1. e4 e6 2. d4 d5 3. Nd2 Nf6 4. e5 Nfd7 5. Bd3 c5 6. c3 b6 +C05 French Defense: Tarrasch Variation, Closed Variation 1. e4 e6 2. d4 d5 3. Nd2 Nf6 +C05 French Defense: Tarrasch Variation, Closed Variation 1. e4 e6 2. d4 d5 3. Nd2 Nf6 4. e5 Nfd7 5. Bd3 c5 6. c3 Nc6 +C05 French Defense: Tarrasch Variation, Pawn Center Variation 1. e4 e6 2. d4 d5 3. Nd2 Nf6 4. e5 Nfd7 5. f4 +C06 French Defense: Tarrasch Variation, Closed Variation, Main Line 1. e4 e6 2. d4 d5 3. Nd2 Nf6 4. e5 Nfd7 5. Bd3 c5 6. c3 Nc6 7. Ne2 cxd4 8. cxd4 +C06 French Defense: Tarrasch Variation, Leningrad Variation 1. e4 e6 2. d4 d5 3. Nd2 Nf6 4. e5 Nfd7 5. Bd3 c5 6. c3 Nc6 7. Ne2 cxd4 8. cxd4 Nb6 +C07 French Defense: Tarrasch Variation, Chistyakov Defense 1. e4 e6 2. d4 d5 3. Nd2 c5 4. exd5 Qxd5 +C07 French Defense: Tarrasch Variation, Chistyakov Defense, Modern Line 1. e4 e6 2. d4 d5 3. Nd2 c5 4. exd5 Qxd5 5. Ngf3 cxd4 6. Bc4 Qd6 7. O-O Nf6 8. Nb3 Nc6 9. Nbxd4 Nxd4 10. Nxd4 a6 +C07 French Defense: Tarrasch Variation, Eliskases Variation 1. e4 e6 2. d4 d5 3. Nd2 c5 4. exd5 Qxd5 5. Ngf3 cxd4 6. Bc4 Qd8 +C07 French Defense: Tarrasch Variation, Open System 1. e4 e6 2. d4 d5 3. Nd2 c5 +C07 French Defense: Tarrasch Variation, Open System, Euwe-Keres Line 1. e4 e6 2. d4 d5 3. Nd2 c5 4. Ngf3 +C07 French Defense: Tarrasch Variation, Open System, Shaposhnikov Gambit 1. e4 e6 2. d4 d5 3. Nd2 c5 4. exd5 Nf6 +C07 French Defense: Tarrasch Variation, Open System, Süchting Line 1. e4 e6 2. d4 d5 3. Nd2 c5 4. c3 +C08 French Defense: Tarrasch Variation, Open System 1. e4 e6 2. d4 d5 3. Nd2 c5 4. exd5 exd5 +C08 French Defense: Tarrasch Variation, Open System, Advance Line 1. e4 e6 2. d4 d5 3. Nd2 c5 4. exd5 exd5 5. Ngf3 c4 +C09 French Defense: Tarrasch Variation, Open System, Main Line 1. e4 e6 2. d4 d5 3. Nd2 c5 4. exd5 exd5 5. Ngf3 Nc6 +C09 French Defense: Tarrasch Variation, Open System, Main Line 1. e4 e6 2. d4 d5 3. Nd2 c5 4. exd5 exd5 5. Ngf3 Nc6 6. Bb5 Bd6 7. dxc5 Bxc5 8. O-O Ne7 9. c3 +C10 French Defense: Hecht-Reefschläger Variation 1. e4 e6 2. d4 d5 3. Nc3 Nc6 +C10 French Defense: Marshall Gambit 1. e4 e6 2. d4 d5 3. Nc3 c5 +C10 French Defense: Paulsen Variation 1. e4 e6 2. d4 d5 3. Nc3 +C10 French Defense: Rubinstein Variation 1. e4 e6 2. d4 d5 3. Nc3 dxe4 +C10 French Defense: Rubinstein Variation, Blackburne Defense 1. e4 e6 2. d4 d5 3. Nc3 dxe4 4. Nxe4 Nd7 +C10 French Defense: Rubinstein Variation, Capablanca Line 1. e4 e6 2. d4 d5 3. Nc3 dxe4 4. Nxe4 Nd7 5. Nf3 Ngf6 6. Nxf6+ Nxf6 7. Ne5 +C10 French Defense: Rubinstein Variation, Ellis Gambit 1. e4 e6 2. d4 d5 3. Nc3 dxe4 4. Nxe4 e5 +C10 French Defense: Rubinstein Variation, Fort Knox Variation 1. e4 e6 2. d4 d5 3. Nc3 dxe4 4. Nxe4 Bd7 5. Nf3 Bc6 +C10 French Defense: Rubinstein Variation, Kasparov Attack 1. e4 e6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 Nd7 5. Nf3 Ngf6 6. Nxf6+ Nxf6 7. c3 +C10 French Defense: Rubinstein Variation, Maric Variation 1. e4 e6 2. d4 d5 3. Nc3 dxe4 4. Nxe4 Qd5 +C11 French Defense: Classical Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 +C11 French Defense: Classical Variation, Delayed Exchange Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. exd5 +C11 French Defense: Classical Variation, Shirov-Anand Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. e5 Nfd7 5. Nce2 +C11 French Defense: Classical Variation, Steinitz Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. e5 +C11 French Defense: Classical Variation, Swiss Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bd3 +C11 French Defense: Henneberger Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Be3 +C11 French Defense: Steinitz Variation 1. e4 e6 2. d4 d5 3. Nc3 a6 4. Nf3 Nf6 5. e5 Nfd7 +C11 French Defense: Steinitz Variation 1. e4 e6 2. d4 d5 3. Nc3 a6 4. Nf3 Nf6 5. e5 Nfd7 6. a3 +C11 French Defense: Steinitz Variation 1. e4 e6 2. d4 d5 3. Nc3 a6 4. Nf3 Nf6 5. e5 Nfd7 6. Ne2 +C11 French Defense: Steinitz Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. e5 Nfd7 5. f4 c5 6. dxc5 Nc6 +C11 French Defense: Steinitz Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. e5 Nfd7 5. f4 c5 6. Nf3 +C11 French Defense: Steinitz Variation, Boleslavsky Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. e5 Nfd7 5. f4 c5 6. Nf3 Nc6 7. Be3 +C11 French Defense: Steinitz Variation, Bradford Attack Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. e5 Nfd7 5. f4 c5 6. dxc5 Bxc5 7. Qg4 +C11 French Defense: Steinitz Variation, Brodsky-Jones Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. e5 Nfd7 5. f4 c5 6. dxc5 Nc6 7. a3 Bxc5 8. Qg4 O-O 9. Nf3 f6 +C11 French Defense: Steinitz Variation, Gledhill Attack 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. e5 Nfd7 5. Qg4 +C12 French Defense, Classical, 4. Bg5 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 +C12 French Defense: McCutcheon Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Bb4 +C12 French Defense: McCutcheon Variation, Advance Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Bb4 5. e5 +C12 French Defense: McCutcheon Variation, Bernstein Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Bb4 5. e5 h6 6. Bh4 +C12 French Defense: McCutcheon Variation, Bogoljubow Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Bb4 5. exd5 Qxd5 6. Bxf6 gxf6 7. Qd2 Qa5 +C12 French Defense: McCutcheon Variation, Chigorin Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Bb4 5. e5 h6 6. exf6 +C12 French Defense: McCutcheon Variation, Dr. Olland Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Bb4 5. e5 h6 6. Bc1 +C12 French Defense: McCutcheon Variation, Duras Variation 1. e4 e6 2. Nc3 d5 3. d4 Nf6 4. Bg5 Bb4 5. e5 h6 6. Bd2 Bxc3 7. bxc3 Ne4 8. Qg4 Kf8 9. Bc1 +C12 French Defense: McCutcheon Variation, Exchange Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Bb4 5. exd5 +C12 French Defense: McCutcheon Variation, Grigoriev Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Bb4 5. e5 h6 6. exf6 hxg5 7. fxg7 Rg8 8. h4 gxh4 9. Qg4 +C12 French Defense: McCutcheon Variation, Janowski Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Bb4 5. e5 h6 6. Be3 +C12 French Defense: McCutcheon Variation, Lasker Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Bb4 5. e5 h6 6. Bd2 Bxc3 +C12 French Defense: McCutcheon Variation, Lasker Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Bb4 5. e5 h6 6. Bd2 Bxc3 7. bxc3 Ne4 8. Qg4 g6 +C12 French Defense: McCutcheon Variation, Tartakower Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Bb4 5. e5 h6 6. Bd2 Nfd7 +C13 French Defense: Alekhine-Chatard Attack 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7 5. e5 Nfd7 6. h4 +C13 French Defense: Alekhine-Chatard Attack, Albin-Chatard Gambit 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7 5. e5 Nfd7 6. h4 Bxg5 7. hxg5 Qxg5 +C13 French Defense: Alekhine-Chatard Attack, Breyer Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7 5. e5 Nfd7 6. h4 c5 +C13 French Defense: Alekhine-Chatard Attack, Maróczy Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7 5. e5 Nfd7 6. h4 a6 +C13 French Defense: Alekhine-Chatard Attack, Spielmann Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7 5. e5 Nfd7 6. h4 O-O +C13 French Defense: Alekhine-Chatard Attack, Teichmann Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7 5. e5 Nfd7 6. h4 f6 +C13 French Defense: Classical Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 dxe4 5. Nxe4 Be7 +C13 French Defense: Classical Variation, Burn Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 dxe4 +C13 French Defense: Classical Variation, Burn Variation, Main Line 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 dxe4 5. Nxe4 Be7 6. Bxf6 Bxf6 7. Nf3 O-O +C13 French Defense: Classical Variation, Burn Variation, Morozevich Line 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 dxe4 5. Nxe4 Be7 6. Bxf6 gxf6 +C13 French Defense: Classical Variation, Frankfurt Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7 5. e5 Ng8 6. Be3 b6 +C13 French Defense: Classical Variation, Normal Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7 +C13 French Defense: Classical Variation, Richter Attack 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7 5. Bxf6 +C13 French Defense: Classical Variation, Richter Attack 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7 5. Bxf6 Bxf6 6. e5 Be7 7. Qg4 +C13 French Defense: Classical Variation, Tartakower Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7 5. e5 Ne4 +C13 French Defense: Classical Variation, Vistaneckis Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7 5. e5 Ng8 +C14 French Defense: Classical Variation 1. e4 e6 2. d4 d5 3. Nc3 a6 4. Nf3 Nf6 5. e5 Nfd7 6. Bg5 +C14 French Defense: Classical Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7 5. e5 Nfd7 6. Bxe7 Qxe7 +C14 French Defense: Classical Variation, Alapin Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7 5. e5 Nfd7 6. Bxe7 Qxe7 7. Nb5 +C14 French Defense: Classical Variation, Pollock Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7 5. e5 Nfd7 6. Bxe7 Qxe7 7. Qg4 +C14 French Defense: Classical Variation, Rubinstein Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7 5. e5 Nfd7 6. Bxe7 Qxe7 7. Qd2 +C14 French Defense: Classical Variation, Stahlberg Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7 5. e5 Nfd7 6. Bxe7 Qxe7 7. f4 O-O 8. Nf3 c5 9. Qd2 Nc6 10. O-O-O c4 +C14 French Defense: Classical Variation, Steinitz Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7 5. e5 Nfd7 6. Bxe7 Qxe7 7. f4 +C14 French Defense: Classical Variation, Tarrasch Variation 1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7 5. e5 Nfd7 6. Bxe7 Qxe7 7. Bd3 +C15 French Defense: McCutcheon Variation, Wolf Gambit 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. Ne2 Nf6 5. Bg5 +C15 French Defense: Winawer Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 +C15 French Defense: Winawer Variation, Alekhine Gambit Accepted 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. Ne2 dxe4 5. a3 Bxc3+ +C15 French Defense: Winawer Variation, Alekhine Gambit, Alatortsev Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. Ne2 dxe4 5. a3 Be7 6. Nxe4 Nf6 7. N2g3 O-O 8. Be2 Nc6 +C15 French Defense: Winawer Variation, Alekhine Gambit, Kan Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. Ne2 dxe4 5. a3 Bxc3+ 6. Nxc3 Nc6 +C15 French Defense: Winawer Variation, Alekhine-Maróczy Gambit 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. Ne2 +C15 French Defense: Winawer Variation, Delayed Exchange Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. exd5 +C15 French Defense: Winawer Variation, Exchange Variation, Canal Attack 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. exd5 exd5 5. Bd3 Ne7 6. Qh5 +C15 French Defense: Winawer Variation, Fingerslip Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. Bd2 +C15 French Defense: Winawer Variation, Fingerslip Variation, Kunin Double Gambit 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. Bd2 dxe4 5. Qg4 Qxd4 +C15 French Defense: Winawer Variation, Fingerslip Variation, Main Line 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. Bd2 dxe4 5. Qg4 Nf6 6. Qxg7 Rg8 7. Qh6 +C15 French Defense: Winawer Variation, Fingerslip Variation, Schwarz's Line 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. Bd2 Ne7 5. Nb1 +C15 French Defense: Winawer Variation, Kondratiyev Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. Bd3 c5 5. exd5 Qxd5 6. Bd2 +C15 French Defense: Winawer Variation, Winckelmann-Reimer Gambit 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. a3 Bxc3+ 5. bxc3 dxe4 6. f3 +C16 French Defense: Winawer Variation, Advance Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 +C16 French Defense: Winawer Variation, Petrosian Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 Qd7 +C17 French Defense: Winawer Variation, Advance Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 +C17 French Defense: Winawer Variation, Advance Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 +C17 French Defense: Winawer Variation, Advance Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 cxd4 6. axb4 dxc3 7. Nf3 +C17 French Defense: Winawer Variation, Advance Variation, Moscow Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. Qg4 +C17 French Defense: Winawer Variation, Bogoljubow Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. Bd2 +C17 French Defense: Winawer Variation, Bogoljubow Variation, Icelandic Defense 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. Bd2 Ne7 6. f4 +C17 French Defense: Winawer Variation, Maróczy-Wallis Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 cxd4 6. axb4 dxc3 +C17 French Defense: Winawer Variation, Retreat Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Ba5 +C17 French Defense: Winawer Variation, Retreat Variation, Armenian Line 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Ba5 6. b4 cxd4 +C18 French Defense: Winawer Variation, Advance Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 +C18 French Defense: Winawer Variation, Advance Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 +C18 French Defense: Winawer Variation, Advance Variation, with Bd3 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. Bd3 +C18 French Defense: Winawer Variation, Advance Variation, with Bd3 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. Bd3 Qc7 +C18 French Defense: Winawer Variation, Advance Variation, with h4 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. h4 +C18 French Defense: Winawer Variation, Advance Variation, with h4 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. h4 Qc7 +C18 French Defense: Winawer Variation, Classical Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Qc7 +C18 French Defense: Winawer Variation, Eingorn Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. Qg4 Kf8 +C18 French Defense: Winawer Variation, Poisoned Pawn Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. Qg4 Qc7 +C18 French Defense: Winawer Variation, Poisoned Pawn Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. Qg4 cxd4 8. Qxg7 +C18 French Defense: Winawer Variation, Poisoned Pawn Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. Qg4 cxd4 8. Qxg7 Rg8 9. Qxh7 Nbc6 +C18 French Defense: Winawer Variation, Poisoned Pawn Variation Declined 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. Qg4 Qc7 8. Bd3 +C18 French Defense: Winawer Variation, Poisoned Pawn Variation, Main Line 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. Qg4 Qc7 8. Qxg7 Rg8 9. Qxh7 cxd4 10. Ne2 +C18 French Defense: Winawer Variation, Poisoned Pawn Variation, Paoli Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. Qg4 Qc7 8. Qxg7 Rg8 9. Qxh7 cxd4 10. Kd1 +C18 French Defense: Winawer Variation, Portisch-Hook Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Qa5 +C18 French Defense: Winawer Variation, Warsaw Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. Qg4 O-O +C19 French Defense: Winawer Variation, Advance Variation, Smyslov Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 Ne7 5. a3 Bxc3+ 6. bxc3 c5 7. a4 +C19 French Defense: Winawer Variation, Advance Variation, Smyslov Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 Ne7 5. a3 Bxc3+ 6. bxc3 c5 7. a4 Qc7 +C19 French Defense: Winawer Variation, Positional Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. a4 Nbc6 8. Nf3 +C19 French Defense: Winawer Variation, Positional Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. a4 Nbc6 8. Nf3 Qa5 9. Qd2 +C19 French Defense: Winawer Variation, Positional Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. a4 Nbc6 8. Nf3 Qa5 9. Qd2 Bd7 +C19 French Defense: Winawer Variation, Positional Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. a4 Nbc6 8. Nf3 Qa5 9. Bd2 +C19 French Defense: Winawer Variation, Positional Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. a4 Nbc6 8. Nf3 Qa5 9. Bd2 Bd7 +C19 French Defense: Winawer Variation, Positional Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. a4 Nbc6 8. Nf3 Qa5 9. Bd2 c4 +C19 French Defense: Winawer Variation, Positional Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. Nf3 +C19 French Defense: Winawer Variation, Positional Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Nc6 7. Nf3 Nge7 +C19 French Defense: Winawer Variation, Positional Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. Nf3 Qc7 +C19 French Defense: Winawer Variation, Positional Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. Nf3 Qc7 8. h4 +C19 French Defense: Winawer Variation, Positional Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7 7. Bd3 Nbc6 8. Nf3 +C19 French Defense: Winawer Variation, Positional Variation 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Nc6 7. Nf3 Qa5 8. Bd2 Nge7 +C20 Barnes Opening: Walkerling 1. f3 e5 2. e4 Nf6 3. Bc4 +C20 Bongcloud Attack 1. e4 e5 2. Ke2 +C20 Center Game 1. e4 e5 2. d4 +C20 English Opening: The Whale 1. e4 e5 2. c4 +C20 King's Pawn Game 1. e4 e5 +C20 King's Pawn Game: Alapin Opening 1. e4 e5 2. Ne2 +C20 King's Pawn Game: Bavarian Gambit 1. e4 e5 2. c4 d5 +C20 King's Pawn Game: Beyer Gambit 1. e4 e5 2. d4 d5 +C20 King's Pawn Game: Clam Variation, King's Gambit Reversed 1. e4 e5 2. d3 f5 +C20 King's Pawn Game: Clam Variation, Radisch Gambit 1. e4 e5 2. d3 Nf6 3. f4 Bc5 +C20 King's Pawn Game: King's Head Opening 1. e4 e5 2. f3 +C20 King's Pawn Game: King's Head Opening 1. e4 e5 2. f3 Nf6 3. Nc3 +C20 King's Pawn Game: Leonardis Variation 1. e4 e5 2. d3 +C20 King's Pawn Game: MacLeod Attack 1. e4 e5 2. c3 +C20 King's Pawn Game: MacLeod Attack, Lasa Gambit 1. e4 e5 2. c3 f5 +C20 King's Pawn Game: MacLeod Attack, Norwalde Gambit 1. e4 e5 2. c3 d5 3. Qh5 Bd6 +C20 King's Pawn Game: Mengarini's Opening 1. e4 e5 2. a3 +C20 King's Pawn Game: Napoleon Attack 1. e4 e5 2. Qf3 +C20 King's Pawn Game: Philidor Gambit 1. e4 e5 2. d4 d6 3. dxe5 Bd7 +C20 King's Pawn Game: Tortoise Opening 1. e4 e5 2. Bd3 +C20 King's Pawn Game: Wayward Queen Attack 1. e4 e5 2. Qh5 +C20 King's Pawn Game: Wayward Queen Attack, Kiddie Countergambit 1. e4 e5 2. Qh5 Nf6 +C20 King's Pawn Game: Wayward Queen Attack, Mellon Gambit 1. e4 e5 2. Qh5 Nc6 3. Bc4 Nh6 4. d3 g6 5. Qf3 f6 6. Ne2 d5 +C20 King's Pawn Game: Weber Gambit 1. e4 e5 2. d3 d5 3. exd5 c6 4. dxc6 Nxc6 +C20 King's Pawn Opening 1. e4 e5 2. b3 +C20 King's Pawn Opening: Speers 1. e4 e5 2. Qg4 Nf6 3. Qf5 +C20 King's Pawn Opening: Van Hooydoon Gambit 1. e4 e5 2. Qe2 Nc6 3. c3 Nf6 4. Nf3 Bc5 5. d4 exd4 6. cxd4 Nxd4 +C20 Portuguese Opening 1. e4 e5 2. Bb5 +C20 Portuguese Opening: Miguel Gambit 1. e4 e5 2. Bb5 Bc5 3. b4 +C20 Portuguese Opening: Portuguese Gambit 1. e4 e5 2. Bb5 Nf6 3. d4 +C21 Center Game 1. e4 e5 2. d4 exd4 3. Qxd4 +C21 Center Game Accepted 1. e4 e5 2. d4 exd4 +C21 Center Game: Halasz-McDonnell Gambit 1. e4 e5 2. d4 exd4 3. f4 +C21 Center Game: Halasz-McDonnell Gambit, Crocodile Variation 1. e4 e5 2. d4 exd4 3. f4 Bc5 4. Nf3 Nc6 5. c3 +C21 Center Game: Kieseritzky Variation 1. e4 e5 2. d4 exd4 3. Nf3 +C21 Center Game: Kieseritzky Variation 1. e4 e5 2. d4 exd4 3. Nf3 c5 +C21 Center Game: Kieseritzky Variation 1. e4 e5 2. d4 exd4 3. Nf3 c5 4. Bc4 +C21 Center Game: Lanc-Arnold Gambit 1. e4 e5 2. d4 exd4 3. Nf3 Bc5 4. c3 +C21 Center Game: Lanc-Arnold Gambit, Schippler Gambit 1. e4 e5 2. d4 exd4 3. Nf3 Bc5 4. c3 dxc3 5. Bc4 +C21 Center Game: Ross Gambit 1. e4 e5 2. d4 exd4 3. Bd3 +C21 Center Game: von der Lasa Gambit 1. e4 e5 2. d4 exd4 3. Bc4 +C21 Danish Gambit 1. e4 e5 2. d4 exd4 3. c3 +C21 Danish Gambit Accepted 1. e4 e5 2. d4 exd4 3. c3 dxc3 +C21 Danish Gambit Accepted: Chigorin Defense 1. e4 e5 2. d4 exd4 3. c3 dxc3 4. Bc4 cxb2 5. Bxb2 Qe7 +C21 Danish Gambit Accepted: Classical Defense 1. e4 e5 2. d4 exd4 3. c3 dxc3 4. Bc4 cxb2 5. Bxb2 Nf6 +C21 Danish Gambit Accepted: Copenhagen Defense 1. e4 e5 2. d4 exd4 3. c3 dxc3 4. Bc4 cxb2 5. Bxb2 Bb4+ +C21 Danish Gambit Accepted: Schlechter Defense 1. e4 e5 2. d4 exd4 3. c3 dxc3 4. Bc4 cxb2 5. Bxb2 d5 +C21 Danish Gambit Accepted: Svenonius Defense 1. e4 e5 2. d4 exd4 3. c3 Ne7 +C21 Danish Gambit Declined: Sörensen Defense 1. e4 e5 2. d4 exd4 3. c3 d5 +C22 Center Game: Berger Variation 1. e4 e5 2. d4 exd4 3. Qxd4 Nc6 4. Qe3 Nf6 +C22 Center Game: Charousek Variation 1. e4 e5 2. d4 exd4 3. Qxd4 Nc6 4. Qe3 Bb4+ 5. c3 Be7 +C22 Center Game: Hall Variation 1. e4 e5 2. d4 exd4 3. Qxd4 Nc6 4. Qc4 +C22 Center Game: Kupreichik Variation 1. e4 e5 2. d4 exd4 3. Qxd4 Nc6 4. Qe3 Nf6 5. Nc3 Bb4 6. Bd2 O-O 7. O-O-O Re8 8. Bc4 d6 9. Nh3 +C22 Center Game: Normal Variation 1. e4 e5 2. d4 exd4 3. Qxd4 Nc6 +C22 Center Game: Paulsen Attack Variation 1. e4 e5 2. d4 exd4 3. Qxd4 Nc6 4. Qe3 +C22 Center Game: l'Hermet Variation 1. e4 e5 2. d4 exd4 3. Qxd4 Nc6 4. Qe3 f5 +C23 Bishop's Opening 1. e4 e5 2. Bc4 +C23 Bishop's Opening: Anderssen Gambit 1. e4 e5 2. Bc4 b5 3. Bxb5 c6 +C23 Bishop's Opening: Boi Variation 1. e4 e5 2. Bc4 Bc5 +C23 Bishop's Opening: Calabrese Countergambit 1. e4 e5 2. Bc4 f5 +C23 Bishop's Opening: Calabrese Countergambit, Jaenisch Variation 1. e4 e5 2. Bc4 f5 3. d3 +C23 Bishop's Opening: Four Pawns Gambit 1. e4 e5 2. Bc4 Bc5 3. b4 Bxb4 4. f4 exf4 5. Nf3 Be7 6. d4 Bh4+ 7. g3 fxg3 8. O-O gxh2+ 9. Kh1 +C23 Bishop's Opening: Khan Gambit 1. e4 e5 2. Bc4 d5 +C23 Bishop's Opening: Lewis Countergambit 1. e4 e5 2. Bc4 Bc5 3. c3 d5 +C23 Bishop's Opening: Lewis Countergambit 1. e4 e5 2. Bc4 Bc5 3. c3 d5 4. Bxd5 Nf6 +C23 Bishop's Opening: Lewis Countergambit, Walker Variation 1. e4 e5 2. Bc4 Bc5 3. c3 d5 4. Bxd5 Nf6 5. d4 +C23 Bishop's Opening: Lewis Gambit 1. e4 e5 2. Bc4 Bc5 3. d4 +C23 Bishop's Opening: Lisitsyn Variation 1. e4 e5 2. Bc4 c6 3. d4 d5 4. exd5 cxd5 5. Bb5+ Bd7 6. Bxd7+ Nxd7 7. dxe5 Nxe5 8. Ne2 +C23 Bishop's Opening: Lopez Gambit 1. e4 e5 2. Bc4 Bc5 3. Qe2 Nc6 4. c3 Nf6 5. f4 +C23 Bishop's Opening: Lopez Variation 1. e4 e5 2. Bc4 Bc5 3. Qe2 +C23 Bishop's Opening: Lopez Variation, Lopez Gambit 1. e4 e5 2. Bc4 Bc5 3. Qe2 Nf6 4. f4 +C23 Bishop's Opening: McDonnell Gambit 1. e4 e5 2. Bc4 Bc5 3. b4 +C23 Bishop's Opening: McDonnell Gambit, La Bourdonnais-Denker Gambit 1. e4 e5 2. Bc4 Bc5 3. b4 Bxb4 4. c3 +C23 Bishop's Opening: McDonnell Gambit, McDonnell Double Gambit 1. e4 e5 2. Bc4 Bc5 3. b4 Bxb4 4. f4 +C23 Bishop's Opening: Philidor Counterattack 1. e4 e5 2. Bc4 c6 +C23 Bishop's Opening: Philidor Variation 1. e4 e5 2. Bc4 Bc5 3. c3 +C23 Bishop's Opening: Pratt Variation 1. e4 e5 2. Bc4 Bc5 3. c3 Nf6 4. d4 exd4 5. e5 d5 6. exf6 dxc4 7. Qh5 O-O +C23 Bishop's Opening: Stein Gambit 1. e4 e5 2. Bc4 Bc5 3. f4 +C23 Bishop's Opening: Thorold Gambit 1. e4 e5 2. Bc4 b5 3. Bxb5 f5 +C23 Bishop's Opening: del Rio Variation 1. e4 e5 2. Bc4 Bc5 3. c3 Qg5 +C24 Bishop's Opening: Berlin Defense 1. e4 e5 2. Bc4 Nf6 +C24 Bishop's Opening: Berlin Defense, Greco Gambit 1. e4 e5 2. Bc4 Nf6 3. f4 +C24 Bishop's Opening: Kitchener Folly 1. e4 e5 2. Bc4 Nf6 3. d3 Be7 4. Nf3 O-O +C24 Bishop's Opening: Krejcik Gambit 1. e4 e5 2. Bc4 Nf6 3. f3 Bc5 4. Ne2 Nc6 5. b4 +C24 Bishop's Opening: Pachman Gambit 1. e4 e5 2. Bc4 Nf6 3. Ne2 Nxe4 4. Nec3 +C24 Bishop's Opening: Paulsen Defense 1. e4 e5 2. Bc4 Nf6 3. d3 c6 +C24 Bishop's Opening: Ponziani Gambit 1. e4 e5 2. Bc4 Nf6 3. d4 +C24 Bishop's Opening: Urusov Gambit, Panov Variation 1. e4 e5 2. Bc4 Nf6 3. d4 exd4 4. Nf3 d5 5. exd5 Bb4+ 6. c3 Qe7+ +C24 Bishop's Opening: Vienna Hybrid 1. e4 e5 2. Bc4 Nf6 3. d3 Nc6 4. Nc3 +C24 Bishop's Opening: Warsaw Gambit 1. e4 e5 2. Bc4 Nf6 3. d4 exd4 4. c3 +C25 Vienna Gambit, with Max Lange Defense 1. e4 e5 2. Nc3 Nc6 3. f4 +C25 Vienna Gambit, with Max Lange Defense: Cunningham Defense 1. e4 e5 2. Nc3 Nc6 3. f4 exf4 4. Nf3 Be7 +C25 Vienna Gambit, with Max Lange Defense: Hamppe-Allgaier Gambit 1. e4 e5 2. Nc3 Nc6 3. f4 exf4 4. Nf3 g5 5. h4 g4 6. Ng5 +C25 Vienna Gambit, with Max Lange Defense: Hamppe-Allgaier Gambit, Alapin Variation 1. e4 e5 2. Nc3 Nc6 3. f4 exf4 4. Nf3 g5 5. h4 g4 6. Ng5 d6 +C25 Vienna Gambit, with Max Lange Defense: Hamppe-Allgaier Gambit, Thorold Variation 1. e4 e5 2. f4 exf4 3. Nf3 Nc6 4. Nc3 g5 5. h4 g4 6. Ng5 h6 7. Nxf7 Kxf7 8. d4 +C25 Vienna Gambit, with Max Lange Defense: Hamppe-Muzio Gambit 1. e4 e5 2. Nc3 Nc6 3. f4 exf4 4. Nf3 g5 5. Bc4 g4 6. O-O gxf3 +C25 Vienna Gambit, with Max Lange Defense: Knight Variation 1. e4 e5 2. Nc3 Nc6 3. f4 exf4 4. Nf3 +C25 Vienna Gambit, with Max Lange Defense: Pierce Gambit 1. e4 e5 2. Nc3 Nc6 3. f4 exf4 4. Nf3 g5 5. d4 +C25 Vienna Gambit, with Max Lange Defense: Quelle Gambit 1. e4 e5 2. Nc3 Nc6 3. f4 Bc5 4. fxe5 d6 +C25 Vienna Gambit, with Max Lange Defense: Steinitz Gambit 1. e4 e5 2. Nc3 Nc6 3. f4 exf4 4. d4 +C25 Vienna Gambit, with Max Lange Defense: Steinitz Gambit, Fraser-Minckwitz Defense 1. e4 e5 2. Nc3 Nc6 3. f4 exf4 4. d4 Qh4+ 5. Ke2 b6 +C25 Vienna Gambit, with Max Lange Defense: Steinitz Gambit, Main Line 1. e4 e5 2. Nc3 Nc6 3. f4 exf4 4. d4 Qh4+ 5. Ke2 +C25 Vienna Gambit, with Max Lange Defense: Steinitz Gambit, Paulsen Defense 1. e4 e5 2. Nc3 Nc6 3. f4 exf4 4. d4 Qh4+ 5. Ke2 d6 +C25 Vienna Gambit, with Max Lange Defense: Steinitz Gambit, Sörensen Defense 1. e4 e5 2. Nc3 Nc6 3. f4 exf4 4. d4 Qh4+ 5. Ke2 g5 +C25 Vienna Gambit, with Max Lange Defense: Steinitz Gambit, Zukertort Defense 1. e4 e5 2. Nc3 Nc6 3. f4 exf4 4. d4 Qh4+ 5. Ke2 d5 +C25 Vienna Game 1. e4 e5 2. Nc3 +C25 Vienna Game: Anderssen Defense 1. e4 e5 2. Nc3 Bc5 +C25 Vienna Game: Fyfe Gambit 1. e4 e5 2. Nc3 Nc6 3. d4 +C25 Vienna Game: Giraffe Attack 1. e4 e5 2. Nc3 Bc5 3. Qg4 +C25 Vienna Game: Hamppe-Meitner Variation 1. e4 e5 2. Nc3 Bc5 3. Na4 +C25 Vienna Game: Hamppe-Muzio Gambit 1. e4 e5 2. Nc3 Nc6 3. f4 exf4 4. Nf3 g5 5. Bc4 g4 6. O-O +C25 Vienna Game: Hamppe-Muzio, Dubois Variation 1. e4 e5 2. Nc3 Nc6 3. f4 exf4 4. Nf3 g5 5. Bc4 g4 6. O-O gxf3 7. Qxf3 Ne5 8. Qxf4 Qf6 +C25 Vienna Game: Max Lange Defense 1. e4 e5 2. Nc3 Nc6 +C25 Vienna Game: Omaha Gambit 1. e4 e5 2. Nc3 d6 3. f4 +C25 Vienna Game: Paulsen Variation 1. e4 e5 2. Nc3 Nc6 3. g3 +C25 Vienna Game: Paulsen Variation 1. e4 e5 2. Nc3 Nc6 3. g3 Nf6 4. Bg2 Bc5 5. Nge2 d5 +C25 Vienna Game: Paulsen Variation, Mariotti Gambit 1. e4 e5 2. Nc3 Nc6 3. g3 Bc5 4. Bg2 h5 5. Nf3 h4 +C25 Vienna Game: Philidor Countergambit 1. e4 e5 2. Nc3 Nc6 3. d4 f5 +C25 Vienna Game: Pierce Gambit, Rushmere Attack 1. e4 e5 2. Nc3 Nc6 3. f4 exf4 4. Nf3 g5 5. d4 g4 6. Bc4 gxf3 7. O-O d5 8. exd5 Bg4 9. dxc6 +C25 Vienna Game: Stanley Variation, Meitner-Mieses Gambit 1. e4 e5 2. Nc3 Nc6 3. Bc4 Bc5 4. Qg4 Qf6 5. Nd5 +C25 Vienna Game: Zhuravlev Countergambit 1. e4 e5 2. Nc3 Bb4 3. Qg4 Nf6 +C26 Bishop's Opening: Horwitz Gambit 1. e4 e5 2. Bc4 Nf6 3. Nc3 b5 +C26 Bishop's Opening: Vienna Hybrid, Spielmann Attack 1. e4 e5 2. Nc3 Nf6 3. Bc4 Bc5 4. d3 +C26 Vienna Game: Falkbeer Variation 1. e4 e5 2. Nc3 Nf6 +C26 Vienna Game: Mengarini Variation 1. e4 e5 2. Nc3 Nf6 3. a3 +C26 Vienna Game: Mieses Variation 1. e4 e5 2. Nc3 Nf6 3. g3 +C26 Vienna Game: Mieses Variation, Erben Gambit 1. e4 e5 2. Nc3 Nf6 3. g3 d5 4. exd5 c6 +C26 Vienna Game: Paulsen Variation, Pollock Gambit 1. e4 e5 2. Nc3 Nf6 3. g3 Bc5 4. Bg2 Nc6 5. Nge2 d5 6. exd5 +C26 Vienna Game: Stanley Variation 1. e4 e5 2. Nc3 Nf6 3. Bc4 +C26 Vienna Game: Stanley Variation, Eifel Gambit 1. e4 e5 2. Nc3 Nf6 3. Bc4 Bc5 4. Nge2 b5 +C26 Vienna Game: Stanley Variation, Reversed Spanish 1. e4 e5 2. Nc3 Nf6 3. Bc4 Bb4 +C27 Bishop's Opening: Boden-Kieseritzky Gambit 1. e4 e5 2. Nf3 Nf6 3. Bc4 Nxe4 4. Nc3 +C27 Bishop's Opening: Boden-Kieseritzky Gambit, Lichtenhein Defense 1. e4 e5 2. Nf3 Nf6 3. Bc4 Nxe4 4. Nc3 d5 +C27 Vienna Game: Adams' Gambit 1. e4 e5 2. Nc3 Nf6 3. Bc4 Nxe4 4. Qh5 Nd6 5. Bb3 Nc6 6. d4 +C27 Vienna Game: Frankenstein-Dracula Variation 1. e4 e5 2. Nc3 Nf6 3. Bc4 Nxe4 +C27 Vienna Game: Stanley Variation, Alekhine Variation 1. e4 e5 2. Nc3 Nf6 3. Bc4 Nxe4 4. Qh5 Nd6 5. Bb3 Be7 6. Nf3 Nc6 7. Nxe5 +C27 Vienna Game: Stanley Variation, Frankenstein-Dracula Variation 1. e4 e5 2. Nc3 Nf6 3. Bc4 Nxe4 4. Qh5 Nd6 5. Bb3 Nc6 6. Nb5 g6 7. Qf3 f5 8. Qd5 Qe7 9. Nxc7+ Kd8 10. Nxa8 b6 +C27 Vienna Game: Stanley Variation, Monster Declined 1. e4 e5 2. Nc3 Nf6 3. Bc4 Nxe4 4. Qh5 Nd6 5. Bb3 Be7 +C28 Bishop's Opening: Vienna Hybrid, Hromádka Variation 1. e4 e5 2. Nc3 Nc6 3. Bc4 Nf6 4. d3 Bb4 5. Ne2 +C28 Vienna Game: Stanley Variation, Bronstein Gambit 1. e4 e5 2. Nc3 Nc6 3. Bc4 Nf6 4. f4 Nxe4 5. Nf3 +C28 Vienna Game: Stanley Variation, Three Knights Variation 1. e4 e5 2. Nc3 Nc6 3. Bc4 Nf6 +C29 Vienna Game: Heyde Variation 1. e4 e5 2. Nc3 Nf6 3. f4 d5 4. fxe5 Nxe4 5. Qf3 f5 6. d4 +C29 Vienna Game: Vienna Gambit 1. e4 e5 2. Nc3 Nf6 3. f4 +C29 Vienna Game: Vienna Gambit, Bardeleben Variation 1. e4 e5 2. Nc3 Nf6 3. f4 d5 4. fxe5 Nxe4 5. Qf3 f5 +C29 Vienna Game: Vienna Gambit, Breyer Variation 1. e4 e5 2. Nc3 Nf6 3. f4 d5 4. fxe5 Nxe4 5. Nf3 Be7 +C29 Vienna Game: Vienna Gambit, Kaufmann Variation 1. e4 e5 2. Nc3 Nf6 3. f4 d5 4. fxe5 Nxe4 5. Nf3 Bg4 6. Qe2 +C29 Vienna Game: Vienna Gambit, Main Line 1. e4 e5 2. Nc3 Nf6 3. f4 d5 +C29 Vienna Game: Vienna Gambit, Modern Variation 1. e4 e5 2. Nc3 Nf6 3. f4 d5 4. fxe5 Nxe4 5. d3 +C29 Vienna Game: Vienna Gambit, Paulsen Attack 1. e4 e5 2. Nc3 Nf6 3. f4 d5 4. fxe5 Nxe4 5. Qf3 +C29 Vienna Game: Vienna Gambit, Steinitz Variation 1. e4 e5 2. Nc3 Nf6 3. f4 d5 4. d3 +C29 Vienna Game: Vienna Gambit, Wurzburger Trap 1. e4 e5 2. Nc3 Nf6 3. f4 d5 4. fxe5 Nxe4 5. d3 Qh4+ 6. g3 Nxg3 7. Nf3 Qh5 8. Nxd5 +C30 King's Gambit 1. e4 e5 2. f4 +C30 King's Gambit Declined: Classical Variation 1. e4 e5 2. f4 Bc5 +C30 King's Gambit Declined: Classical Variation 1. e4 e5 2. f4 Bc5 3. Nf3 d6 4. c3 +C30 King's Gambit Declined: Classical Variation, Euwe Attack 1. e4 e5 2. f4 Bc5 3. Nf3 d6 4. c3 Bg4 5. fxe5 dxe5 6. Qa4+ +C30 King's Gambit Declined: Classical Variation, Rotlewi Countergambit 1. e4 e5 2. f4 Bc5 3. Nf3 d6 4. b4 +C30 King's Gambit Declined: Classical Variation, Rubinstein Countergambit 1. e4 e5 2. f4 Bc5 3. Nf3 d6 4. c3 f5 +C30 King's Gambit Declined: Classical Variation, Walthoffen Attack 1. e4 e5 2. f4 Bc5 3. Qh5 +C30 King's Gambit Declined: Classical, Hanham Variation 1. e4 e5 2. f4 Bc5 3. Nf3 d6 4. Nc3 Nd7 +C30 King's Gambit Declined: Classical, Réti Variation 1. e4 e5 2. f4 Bc5 3. Nf3 d6 4. c3 f5 5. fxe5 dxe5 6. d4 exd4 7. Bc4 +C30 King's Gambit Declined: Classical, Soldatenkov Variation 1. e4 e5 2. f4 Bc5 3. Nf3 d6 4. fxe5 +C30 King's Gambit Declined: Classical, Svenonius Variation 1. e4 e5 2. Bc4 Nc6 3. Nc3 Nf6 4. d3 Bc5 5. f4 d6 6. Nf3 Bg4 7. h3 Bxf3 8. Qxf3 exf4 +C30 King's Gambit Declined: Hobbs-Zilbermints Gambit 1. e4 e5 2. f4 Nc6 3. Nf3 g5 4. fxg5 h6 +C30 King's Gambit Declined: Keene Defense 1. e4 e5 2. f4 Qh4+ 3. g3 Qe7 +C30 King's Gambit Declined: Keene's Defense 1. e4 e5 2. f4 Qh4+ +C30 King's Gambit Declined: Keene's Defense 1. e4 e5 2. f4 Qh4+ 3. g3 +C30 King's Gambit Declined: Mafia Defense 1. e4 c5 2. f4 e5 +C30 King's Gambit Declined: Miles Defense 1. e4 e5 2. f4 Nc6 3. Nf3 f5 +C30 King's Gambit Declined: Norwalde Variation 1. e4 e5 2. f4 Qf6 +C30 King's Gambit Declined: Norwalde Variation, Bücker Gambit 1. e4 e5 2. f4 Qf6 3. Nc3 Qxf4 4. Nf3 Bb4 5. Bc4 +C30 King's Gambit Declined: Norwalde Variation, Schubert Variation 1. e4 e5 2. f4 Qf6 3. Nc3 Qxf4 4. d4 +C30 King's Gambit Declined: Panteldakis Countergambit 1. e4 e5 2. f4 f5 +C30 King's Gambit Declined: Panteldakis Countergambit, Greco Variation 1. e4 e5 2. f4 f5 3. exf5 Qh4+ +C30 King's Gambit Declined: Panteldakis Countergambit, Pawn Sacrifice Line 1. e4 e5 2. f4 f5 3. exf5 exf4 4. Qh5+ g6 5. fxg6 Qe7+ 6. Kd1 +C30 King's Gambit Declined: Panteldakis Countergambit, Schiller's Defense 1. e4 e5 2. f4 f5 3. exf5 Bc5 +C30 King's Gambit Declined: Panteldakis Countergambit, Shirazi Line 1. e4 e5 2. f4 f5 3. exf5 exf4 4. Qh5+ Ke7 +C30 King's Gambit Declined: Panteldakis Countergambit, Symmetrical Variation 1. e4 e5 2. f4 f5 3. exf5 exf4 4. Nf3 d5 5. d4 Bd6 6. Bd3 +C30 King's Gambit Declined: Petrov's Defense 1. e4 e5 2. f4 Nf6 +C30 King's Gambit Declined: Queen's Knight Defense 1. e4 e5 2. f4 Nc6 +C30 King's Gambit Declined: Senechaud Countergambit 1. e4 e5 2. f4 Bc5 3. Nf3 g5 +C30 King's Gambit Declined: Soller-Zilbermints Gambit 1. e4 e5 2. f4 f6 3. fxe5 Nc6 +C30 King's Gambit Declined: Zilbermints Double Countergambit 1. e4 e5 2. f4 g5 +C30 King's Gambit Declined: Zilbermints Double Gambit 1. e4 e5 2. f4 Nc6 3. Nf3 g5 +C31 King's Gambit Declined: Falkbeer Countergambit 1. e4 e5 2. f4 d5 +C31 King's Gambit Declined: Falkbeer Countergambit Accepted 1. e4 e5 2. f4 d5 3. exd5 +C31 King's Gambit Declined: Falkbeer Countergambit, Anderssen Attack 1. e4 e5 2. f4 d5 3. exd5 e4 4. Bb5+ +C31 King's Gambit Declined: Falkbeer Countergambit, Blackburne Attack 1. e4 e5 2. f4 d5 3. Nf3 +C31 King's Gambit Declined: Falkbeer Countergambit, Charousek Gambit 1. e4 e5 2. f4 d5 3. exd5 e4 4. d3 +C31 King's Gambit Declined: Falkbeer Countergambit, Charousek Gambit, Morphy Defense 1. e4 e5 2. Nc3 Nf6 3. f4 d5 4. exd5 e4 5. d3 Bb4 6. Bd2 e3 +C31 King's Gambit Declined: Falkbeer Countergambit, Hinrichsen Gambit 1. e4 e5 2. f4 d5 3. d4 +C31 King's Gambit Declined: Falkbeer Countergambit, Miles Gambit 1. e4 e5 2. f4 d5 3. exd5 Bc5 +C31 King's Gambit Declined: Falkbeer Countergambit, Milner-Barry Variation 1. e4 e5 2. f4 d5 3. Nc3 +C31 King's Gambit Declined: Falkbeer Countergambit, Modern Transfer 1. e4 e5 2. f4 d5 3. exd5 exf4 +C31 King's Gambit Declined: Falkbeer Countergambit, Nimzowitsch-Marshall Countergambit 1. e4 e5 2. f4 d5 3. exd5 c6 +C31 King's Gambit Declined: Falkbeer Countergambit, Pickler Gambit 1. e4 e5 2. f4 d5 3. exd5 c6 4. dxc6 Bc5 +C31 King's Gambit Declined: Falkbeer Countergambit, Rubinstein Variation 1. e4 e5 2. f4 d5 3. exd5 e4 4. Nc3 Nf6 5. Qe2 +C31 King's Gambit Declined: Falkbeer Countergambit, Staunton Line 1. e4 e5 2. f4 d5 3. exd5 e4 +C31 Van Geet Opening: Grünfeld Defense, Steiner Gambit 1. e4 e5 2. f4 d5 3. Nc3 dxe4 4. Nxe4 +C32 King's Gambit Declined: Falkbeer Countergambit, Alapin Variation 1. e4 e5 2. f4 d5 3. exd5 e4 4. d3 Nf6 5. dxe4 Nxe4 6. Nf3 Bc5 7. Qe2 Bf2+ 8. Kd1 Qxd5+ 9. Nfd2 +C32 King's Gambit Declined: Falkbeer Countergambit, Charousek Gambit 1. e4 e5 2. f4 d5 3. exd5 e4 4. d3 Nf6 5. dxe4 Nxe4 6. Qe2 +C32 King's Gambit Declined: Falkbeer Countergambit, Charousek Gambit Accepted 1. e4 e5 2. f4 d5 3. exd5 e4 4. d3 Nf6 5. dxe4 +C32 King's Gambit Declined: Falkbeer Countergambit, Charousek Gambit, Keres Variation 1. e4 e5 2. f4 d5 3. exd5 e4 4. d3 Nf6 5. Nd2 +C32 King's Gambit Declined: Falkbeer Countergambit, Charousek Gambit, Main Line 1. e4 e5 2. f4 d5 3. exd5 e4 4. d3 Nf6 5. dxe4 Nxe4 6. Nf3 Bc5 7. Qe2 Bf5 +C32 King's Gambit Declined: Falkbeer Countergambit, Charousek Gambit, Old Line 1. e4 e5 2. f4 d5 3. exd5 e4 4. d3 Nf6 5. Qe2 +C32 King's Gambit Declined: Falkbeer Countergambit, Charousek Variation 1. e4 e5 2. f4 d5 3. exd5 e4 4. d3 Nf6 5. dxe4 Nxe4 6. Qe2 Qxd5 7. Nd2 f5 8. g4 +C32 King's Gambit Declined: Falkbeer Countergambit, Tarrasch Variation 1. e4 e5 2. f4 d5 3. exd5 e4 4. d3 Nf6 5. dxe4 Nxe4 6. Nf3 Bc5 7. Qe2 Bf5 8. g4 O-O +C33 King's Gambit Accepted 1. e4 e5 2. f4 exf4 +C33 King's Gambit Accepted: Basman Gambit 1. e4 e5 2. f4 exf4 3. Qe2 +C33 King's Gambit Accepted: Bishop's Gambit 1. e4 e5 2. f4 exf4 3. Bc4 +C33 King's Gambit Accepted: Bishop's Gambit, Anderssen Defense 1. e4 e5 2. f4 exf4 3. Bc4 g5 +C33 King's Gambit Accepted: Bishop's Gambit, Anderssen Variation 1. e4 e5 2. f4 exf4 3. Bc4 d5 4. Bxd5 c6 +C33 King's Gambit Accepted: Bishop's Gambit, Bledow Countergambit 1. e4 e5 2. f4 exf4 3. Bc4 d5 4. Bxd5 Nf6 +C33 King's Gambit Accepted: Bishop's Gambit, Bledow Variation 1. e4 e5 2. f4 exf4 3. Bc4 d5 +C33 King's Gambit Accepted: Bishop's Gambit, Boden Variation 1. e4 e5 2. f4 exf4 3. Bc4 Qh4+ 4. Kf1 Nc6 +C33 King's Gambit Accepted: Bishop's Gambit, Bogoljubow Defense 1. e4 e5 2. f4 exf4 3. Bc4 Nf6 4. Nc3 c6 +C33 King's Gambit Accepted: Bishop's Gambit, Bogoljubow Variation 1. e4 e5 2. f4 exf4 3. Bc4 Nf6 4. Nc3 +C33 King's Gambit Accepted: Bishop's Gambit, Boren-Svenonius Variation 1. e4 e5 2. f4 exf4 3. Bc4 d5 4. Bxd5 Qh4+ 5. Kf1 Bd6 +C33 King's Gambit Accepted: Bishop's Gambit, Bryan Countergambit 1. e4 e5 2. f4 exf4 3. Bc4 Qh4+ 4. Kf1 b5 +C33 King's Gambit Accepted: Bishop's Gambit, Chigorin's Attack 1. e4 e5 2. f4 exf4 3. Bc4 Qh4+ 4. Kf1 d5 5. Bxd5 g5 6. g3 +C33 King's Gambit Accepted: Bishop's Gambit, Classical Defense 1. e4 e5 2. f4 exf4 3. Bc4 Qh4+ 4. Kf1 Ne7 5. Nc3 g5 6. d4 Bg7 +C33 King's Gambit Accepted: Bishop's Gambit, Classical Defense, Cozio Attack 1. e4 e5 2. f4 exf4 3. Bc4 Qh4+ 4. Kf1 g5 5. Qf3 +C33 King's Gambit Accepted: Bishop's Gambit, Cozio Defense 1. e4 e5 2. f4 exf4 3. Bc4 Nf6 +C33 King's Gambit Accepted: Bishop's Gambit, Cozio Variation 1. e4 e5 2. f4 exf4 3. Bc4 Qh4+ 4. Kf1 d6 +C33 King's Gambit Accepted: Bishop's Gambit, First Jaenisch Variation 1. e4 e5 2. f4 exf4 3. Bc4 Qh4+ 4. Kf1 Nf6 +C33 King's Gambit Accepted: Bishop's Gambit, Fraser Variation 1. e4 e5 2. f4 exf4 3. Bc4 Qh4+ 4. Kf1 g5 5. Nc3 Bg7 6. g3 fxg3 7. Qf3 +C33 King's Gambit Accepted: Bishop's Gambit, Gianutio Gambit 1. e4 e5 2. f4 exf4 3. Bc4 f5 +C33 King's Gambit Accepted: Bishop's Gambit, Greco Variation 1. e4 e5 2. f4 exf4 3. Bc4 Qh4+ 4. Kf1 Bc5 +C33 King's Gambit Accepted: Bishop's Gambit, Grimm Attack 1. e4 e5 2. f4 exf4 3. Bc4 Qh4+ 4. Kf1 g5 5. Nc3 Bg7 6. d4 d6 7. e5 +C33 King's Gambit Accepted: Bishop's Gambit, Kieseritzky Gambit 1. e4 e5 2. f4 exf4 3. Bc4 b5 +C33 King's Gambit Accepted: Bishop's Gambit, Lopez Defense 1. e4 e5 2. f4 exf4 3. Bc4 c6 +C33 King's Gambit Accepted: Bishop's Gambit, Lopez Variation 1. e4 e5 2. f4 exf4 3. Bc4 Qh4+ 4. Kf1 g5 +C33 King's Gambit Accepted: Bishop's Gambit, Maurian Defense 1. e4 e5 2. f4 exf4 3. Bc4 Nc6 +C33 King's Gambit Accepted: Bishop's Gambit, McDonnell Attack 1. e4 e5 2. f4 exf4 3. Bc4 Qh4+ 4. Kf1 g5 5. Nc3 Bg7 6. d4 Ne7 7. g3 +C33 King's Gambit Accepted: Bishop's Gambit, McDonnell Attack 1. e4 e5 2. f4 exf4 3. Bc4 Qh4+ 4. Kf1 g5 5. Nc3 Bg7 6. g3 +C33 King's Gambit Accepted: Bishop's Gambit, Paulsen Attack 1. e4 e5 2. f4 exf4 3. Bc4 Nf6 4. Nc3 Bb4 5. e5 +C33 King's Gambit Accepted: Bishop's Gambit, Steinitz Defense 1. e4 e5 2. f4 exf4 3. Bc4 Ne7 +C33 King's Gambit Accepted: Breyer Gambit 1. e4 e5 2. f4 exf4 3. Qf3 +C33 King's Gambit Accepted: Carrera Gambit 1. e4 e5 2. f4 exf4 3. Qh5 +C33 King's Gambit Accepted: Dodo Variation 1. e4 e5 2. f4 exf4 3. Qg4 +C33 King's Gambit Accepted: Eisenberg Variation 1. e4 e5 2. f4 exf4 3. Nh3 +C33 King's Gambit Accepted: Gaga Gambit 1. e4 e5 2. f4 exf4 3. g3 +C33 King's Gambit Accepted: Lopez-Gianutio Countergambit, Hein Variation 1. e4 e5 2. f4 exf4 3. Bc4 f5 4. Qe2 Qh4+ 5. Kd1 fxe4 6. Nc3 Kd8 +C33 King's Gambit Accepted: Mason-Keres Gambit 1. e4 e5 2. f4 exf4 3. Nc3 +C33 King's Gambit Accepted: Orsini Gambit 1. e4 e5 2. f4 exf4 3. b3 +C33 King's Gambit Accepted: Paris Gambit 1. e4 e5 2. f4 exf4 3. Ne2 +C33 King's Gambit Accepted: Schurig Gambit, with Bb5 1. e4 e5 2. f4 exf4 3. Bb5 +C33 King's Gambit Accepted: Schurig Gambit, with Bd3 1. e4 e5 2. f4 exf4 3. Bd3 +C33 King's Gambit Accepted: Stamma Gambit 1. e4 e5 2. f4 exf4 3. h4 +C33 King's Gambit Accepted: Tartakower Gambit 1. e4 e5 2. f4 exf4 3. Be2 +C33 King's Gambit Accepted: Tartakower Gambit, Weiss Defense 1. e4 e5 2. f4 exf4 3. Be2 f5 4. exf5 d6 +C33 King's Gambit Accepted: Tumbleweed 1. e4 e5 2. f4 exf4 3. Kf2 +C33 King's Gambit Accepted: Villemson Gambit 1. e4 e5 2. f4 exf4 3. d4 +C34 King's Gambit Accepted: Becker Defense 1. e4 e5 2. f4 exf4 3. Nf3 h6 +C34 King's Gambit Accepted: Bonsch-Osmolovsky Variation 1. e4 e5 2. f4 exf4 3. Nf3 Ne7 +C34 King's Gambit Accepted: Fischer Defense 1. e4 e5 2. f4 exf4 3. Nf3 d6 +C34 King's Gambit Accepted: Fischer Defense, Schulder Gambit 1. e4 e5 2. f4 exf4 3. Nf3 d6 4. b4 +C34 King's Gambit Accepted: Fischer Defense, Spanish Variation 1. e4 e5 2. f4 exf4 3. Nf3 d6 4. d4 Nf6 5. Bd3 +C34 King's Gambit Accepted: Gianutio Countergambit 1. e4 e5 2. f4 exf4 3. Nf3 f5 +C34 King's Gambit Accepted: Greco Gambit 1. e4 e5 2. f4 exf4 3. Nf3 d6 4. Bc4 h6 5. d4 g5 6. h4 Bg7 +C34 King's Gambit Accepted: King's Knight's Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 +C34 King's Gambit Accepted: King's Knight's Gambit 1. e4 e5 2. f4 exf4 3. Nf3 +C34 King's Gambit Accepted: MacLeod Defense 1. e4 e5 2. f4 exf4 3. Nf3 Nc6 +C34 King's Gambit Accepted: Schallopp Defense 1. e4 e5 2. f4 exf4 3. Nf3 Nf6 +C34 King's Gambit Accepted: Schallopp Defense, Tashkent Attack 1. e4 e5 2. f4 exf4 3. Nf3 Nf6 4. e5 Nh5 5. g4 +C34 King's Gambit Accepted: Wagenbach Defense 1. e4 e5 2. f4 exf4 3. Nf3 h5 +C35 King's Gambit Accepted: Cunningham Defense 1. e4 e5 2. f4 exf4 3. Nf3 Be7 +C35 King's Gambit Accepted: Cunningham Defense, Bertin Gambit 1. e4 e5 2. f4 exf4 3. Nf3 Be7 4. Bc4 Bh4+ 5. g3 +C35 King's Gambit Accepted: Cunningham Defense, Bertin Gambit 1. e4 e5 2. f4 exf4 3. Nf3 Be7 4. Bc4 Bh4+ 5. g3 fxg3 6. O-O gxh2+ 7. Kh1 +C35 King's Gambit Accepted: Cunningham Defense, McCormick Defense 1. e4 e5 2. f4 exf4 3. Nf3 Be7 4. Bc4 Nf6 +C36 King's Gambit Accepted: Abbazia Defense 1. e4 e5 2. f4 exf4 3. Nf3 d5 4. exd5 Nf6 +C36 King's Gambit Accepted: Abbazia Defense, Main Line 1. e4 e5 2. f4 exf4 3. Nf3 d5 4. exd5 Nf6 5. Bb5+ c6 6. dxc6 bxc6 7. Bc4 Nd5 +C36 King's Gambit Accepted: Modern Defense 1. e4 e5 2. f4 exf4 3. Nf3 d5 +C36 King's Gambit Accepted: Modern Defense 1. e4 e5 2. f4 exf4 3. Nf3 d5 4. exd5 +C37 King's Gambit Accepted: Australian Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. h4 +C37 King's Gambit Accepted: Blachly Gambit 1. e4 e5 2. f4 exf4 3. Nf3 Nc6 4. Bc4 g5 +C37 King's Gambit Accepted: Double Muzio Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. O-O gxf3 6. Qxf3 Qf6 7. e5 Qxe5 8. Bxf7+ +C37 King's Gambit Accepted: Double Muzio Gambit, Baldwin Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. O-O gxf3 6. Qxf3 Qf6 7. Nc3 Qd4+ 8. Kh1 Qxc4 9. Nd5 +C37 King's Gambit Accepted: Double Muzio Gambit, Bello Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. O-O gxf3 6. Qxf3 Qf6 7. Nc3 +C37 King's Gambit Accepted: Double Muzio Gambit, Paulsen Defense 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. O-O gxf3 6. Qxf3 Qf6 7. e5 Qxe5 8. d3 Bh6 9. Nc3 Ne7 10. Bd2 Nbc6 11. Rae1 +C37 King's Gambit Accepted: Double Muzio Gambit, Young Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. O-O gxf3 6. Qxf3 Qf6 7. Bxf7+ Kxf7 8. d4 Qxd4+ 9. Be3 Qf6 10. Nc3 fxe3 +C37 King's Gambit Accepted: Ghulam-Kassim Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. d4 +C37 King's Gambit Accepted: Ghulam-Kassim Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. d4 gxf3 6. Qxf3 +C37 King's Gambit Accepted: King's Knight's Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 +C37 King's Gambit Accepted: Kotov Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. d4 gxf3 6. Bxf4 +C37 King's Gambit Accepted: Lolli Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. Bxf7+ +C37 King's Gambit Accepted: Lolli Gambit, Young Variation 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. Bxf7+ Kxf7 6. O-O gxf3 7. Qxf3 Qf6 8. d4 Qxd4+ 9. Be3 Qf6 10. Nc3 +C37 King's Gambit Accepted: McDonnell Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. Nc3 +C37 King's Gambit Accepted: Middleton Countergambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 d6 5. O-O Bg4 6. h3 h5 7. hxg4 hxg4 +C37 King's Gambit Accepted: Muzio Gambit Accepted, From's Defense 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. O-O gxf3 6. Qxf3 Qe7 +C37 King's Gambit Accepted: Muzio Gambit, Brentano Defense 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. O-O d5 +C37 King's Gambit Accepted: Muzio Gambit, Holloway Defense 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. O-O gxf3 6. Qxf3 Nc6 +C37 King's Gambit Accepted: Muzio Gambit, Kling and Horwitz Counterattack 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. O-O Qe7 +C37 King's Gambit Accepted: Muzio Gambit, Sarratt Defense 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. O-O gxf3 6. Qxf3 Qf6 +C37 King's Gambit Accepted: Muzio Gambit, Wild Muzio Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. O-O +C37 King's Gambit Accepted: Quaade Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Nc3 +C37 King's Gambit Accepted: Rosentreter Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. d4 +C37 King's Gambit Accepted: Rosentreter Gambit, Bird Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. d4 g4 5. Ne5 Qh4+ 6. g3 +C37 King's Gambit Accepted: Rosentreter Gambit, Sörensen Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. d4 g4 5. Nc3 +C37 King's Gambit Accepted: Rosentreter Gambit, Testa Variation 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. d4 g4 5. Bxf4 +C37 King's Gambit Accepted: Salvio Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. Ne5 +C37 King's Gambit Accepted: Salvio Gambit, Anderssen Counterattack 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. Ne5 Qh4+ 6. Kf1 Nh6 7. d4 d6 +C37 King's Gambit Accepted: Salvio Gambit, Cochrane Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. Ne5 Qh4+ 6. Kf1 f3 +C37 King's Gambit Accepted: Salvio Gambit, Santa Maria Defense 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. Ne5 Qh4+ 6. Kf1 Nf6 +C37 King's Gambit Accepted: Salvio Gambit, Silberschmidt Defense 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. Ne5 Qh4+ 6. Kf1 Nh6 +C37 King's Gambit Accepted: Salvio Gambit, Viennese Variation 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. Ne5 Qh4+ 6. Kf1 Nc6 +C37 King's Gambit Accepted: Silberschmidt Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 5. Ne5 Qh4+ 6. Kf1 Nh6 7. d4 f3 +C37 King's Gambit Accepted: Sörensen Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. d4 g4 5. Ne5 +C38 King's Gambit Accepted: Greco Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 Bg7 5. h4 h6 6. d4 d6 7. Nc3 c6 8. hxg5 hxg5 9. Rxh8 Bxh8 10. Ne5 +C38 King's Gambit Accepted: Hanstein Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 Bg7 5. O-O +C38 King's Gambit Accepted: Mayet Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 Bg7 5. d4 d6 6. c3 +C38 King's Gambit Accepted: Philidor Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 Bg7 5. h4 +C38 King's Gambit Accepted: Philidor Gambit, Schultz Variation 1. e4 e5 2. f4 exf4 3. Nf3 h6 4. Bc4 d6 5. d4 g5 6. h4 Bg7 7. Qd3 +C38 King's Gambit Accepted: Traditional Variation 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 Bg7 +C39 King's Gambit Accepted: Allgaier Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ng5 +C39 King's Gambit Accepted: Allgaier Gambit, Thorold Attack 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ng5 h6 6. Nxf7 Kxf7 7. d4 +C39 King's Gambit Accepted: Allgaier Gambit, Urusov Attack 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ng5 h6 6. Nxf7 Kxf7 7. Bc4+ +C39 King's Gambit Accepted: Allgaier, Blackburne Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ng5 h6 6. Nxf7 Kxf7 7. Nc3 +C39 King's Gambit Accepted: Allgaier, Cook Variation 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ng5 h6 6. Nxf7 Kxf7 7. d4 d5 8. Bxf4 dxe4 9. Bc4+ Kg7 10. Be5+ +C39 King's Gambit Accepted: Allgaier, Horny Defense 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ng5 h6 6. Nxf7 Kxf7 7. Qxg4 Nf6 8. Qxf4 Bd6 +C39 King's Gambit Accepted: Allgaier, Schlechter Defense 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ng5 Nf6 +C39 King's Gambit Accepted: Allgaier, Urusov Attack 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ng5 h6 6. Nxf7 Kxf7 7. Bc4+ d5 8. Bxd5+ Kg7 9. d4 +C39 King's Gambit Accepted: Kieseritzky Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ne5 +C39 King's Gambit Accepted: Kieseritzky Gambit, Anderssen Defense 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ne5 Nf6 6. Bc4 d5 7. exd5 Bd6 +C39 King's Gambit Accepted: Kieseritzky Gambit, Anderssen-Cordel Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ne5 Nf6 6. Bc4 d5 7. exd5 Bd6 8. d4 Nh5 9. Bxf4 Nxf4 +C39 King's Gambit Accepted: Kieseritzky Gambit, Berlin Defense 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ne5 Nf6 +C39 King's Gambit Accepted: Kieseritzky Gambit, Berlin Defense, Rubinstein Variation 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ne5 Nf6 6. d4 +C39 King's Gambit Accepted: Kieseritzky Gambit, Berlin Defense, de Riviere Variation 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ne5 Nf6 6. Nxg4 d5 +C39 King's Gambit Accepted: Kieseritzky Gambit, Brentano Defense 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ne5 d5 +C39 King's Gambit Accepted: Kieseritzky Gambit, Brentano Defense 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ne5 d5 6. d4 Nf6 7. Bxf4 +C39 King's Gambit Accepted: Kieseritzky Gambit, Brentano Defense, Caro Variation 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ne5 d5 6. d4 Nf6 7. Bxf4 Nxe4 8. Nd2 +C39 King's Gambit Accepted: Kieseritzky Gambit, Cotter Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ng5 h6 6. Nxf7 +C39 King's Gambit Accepted: Kieseritzky Gambit, Kolisch Defense 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ne5 d6 +C39 King's Gambit Accepted: Kieseritzky Gambit, Long Whip 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ne5 h5 +C39 King's Gambit Accepted: Kieseritzky Gambit, Neumann Defense 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ne5 Nc6 +C39 King's Gambit Accepted: Kieseritzky Gambit, Paulsen Defense 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ne5 Bg7 +C39 King's Gambit Accepted: Kieseritzky Gambit, Paulsen Defense Deferred 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ne5 Nf6 6. Bc4 d5 7. exd5 Bg7 +C39 King's Gambit Accepted: Kieseritzky Gambit, Rice Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ne5 Nf6 6. Bc4 d5 7. exd5 Bd6 8. O-O Bxe5 +C39 King's Gambit Accepted: Kieseritzky Gambit, Rosenthal Defense 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ne5 Qe7 +C39 King's Gambit Accepted: Kieseritzky, Long Whip Defense, Jaenisch Variation 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ne5 h5 6. Bc4 Rh7 7. d4 Bh6 8. Nc3 +C39 King's Gambit Accepted: Kieseritzky, Polerio Defense 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ne5 Be7 +C39 King's Gambit Accepted: Kieseritzky, Rice Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ne5 Nf6 6. Bc4 d5 7. exd5 Bd6 8. O-O +C39 King's Gambit Accepted: Kieseritzky, Salvio Defense, Cozio Variation 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ne5 Qe7 6. d4 f5 7. Bc4 +C39 King's Gambit Accepted: King's Knight's Gambit 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 +C40 Elephant Gambit 1. e4 e5 2. Nf3 d5 +C40 Elephant Gambit: Maróczy Gambit 1. e4 e5 2. Nf3 d5 3. exd5 Bd6 +C40 Elephant Gambit: Paulsen Countergambit 1. e4 e5 2. Nf3 d5 3. exd5 e4 +C40 Elephant Gambit: Wasp Variation 1. e4 e5 2. Nf3 d5 3. Nxe5 dxe4 4. Bc4 Qg5 +C40 Gunderam Defense 1. e4 e5 2. Nf3 Qe7 +C40 King's Knight Opening 1. e4 e5 2. Nf3 +C40 King's Pawn Game: Busch-Gass Gambit 1. e4 e5 2. Nf3 Bc5 +C40 King's Pawn Game: Busch-Gass Gambit, Chiodini Gambit 1. e4 e5 2. Nf3 Bc5 3. Nxe5 Nc6 +C40 King's Pawn Game: Damiano Defense 1. e4 e5 2. Nf3 f6 +C40 King's Pawn Game: Damiano Defense, Damiano Gambit 1. e4 e5 2. Nf3 f6 3. Nxe5 fxe5 4. Qh5+ g6 5. Qxe5+ Qe7 6. Qxh8 +C40 King's Pawn Game: Damiano Defense, Damiano Gambit, Chigorin Gambit 1. e4 e5 2. Nf3 f6 3. Nxe5 Qe7 4. Nf3 d5 +C40 King's Pawn Game: Gunderam Defense, Gunderam Gambit 1. e4 e5 2. Nf3 Qe7 3. Bc4 f5 +C40 King's Pawn Game: Gunderam Gambit 1. e4 e5 2. Nf3 c6 +C40 King's Pawn Game: La Bourdonnais Gambit 1. e4 e5 2. Nf3 Qf6 3. Bc4 Qg6 4. O-O +C40 King's Pawn Game: McConnell Defense 1. e4 e5 2. Nf3 Qf6 +C40 Latvian Gambit 1. e4 e5 2. Nf3 f5 +C40 Latvian Gambit Accepted 1. e4 e5 2. Nf3 f5 3. exf5 +C40 Latvian Gambit Accepted: Bilguer Variation 1. e4 e5 2. Nf3 f5 3. Nxe5 Qf6 4. d4 d6 5. Nc4 +C40 Latvian Gambit Accepted: Bronstein Attack 1. e4 e5 2. Nf3 f5 3. Nxe5 Qf6 4. d4 d6 5. Nc4 fxe4 6. Be2 +C40 Latvian Gambit Accepted: Bronstein Gambit 1. e4 e5 2. Nf3 f5 3. Nxe5 Qf6 4. d4 d6 5. Nc4 fxe4 6. Qh5+ g6 7. Qe2 +C40 Latvian Gambit Accepted: Foltys Variation 1. e4 e5 2. Nf3 f5 3. Nxe5 Qf6 4. Nc4 fxe4 5. d3 +C40 Latvian Gambit Accepted: Foltys-Leonhardt Variation 1. e4 e5 2. Nf3 f5 3. Nxe5 Qf6 4. Nc4 +C40 Latvian Gambit Accepted: Leonhardt Variation 1. e4 e5 2. Nf3 f5 3. Nxe5 Qf6 4. Nc4 fxe4 5. Nc3 +C40 Latvian Gambit Accepted: Main Line 1. e4 e5 2. Nf3 f5 3. Nxe5 Qf6 4. d4 +C40 Latvian Gambit Accepted: Nimzowitsch Attack 1. e4 e5 2. Nf3 f5 3. Nxe5 Qf6 4. d4 d6 5. Nc4 fxe4 6. Ne3 +C40 Latvian Gambit: Behting Variation 1. e4 e5 2. Nf3 f5 3. Bc4 fxe4 4. Nxe5 Qg5 5. Nf7 Qxg2 6. Rf1 d5 7. Nxh8 Nf6 +C40 Latvian Gambit: Corkscrew Countergambit 1. e4 e5 2. Nf3 f5 3. Bc4 fxe4 4. Nxe5 Nf6 +C40 Latvian Gambit: Corkscrew Gambit 1. e4 e5 2. Nf3 f5 3. Nxe5 Nf6 4. Bc4 fxe4 5. Nf7 Qe7 6. Nxh8 d5 +C40 Latvian Gambit: Diepstraten Countergambit 1. e4 e5 2. Nf3 f5 3. c4 +C40 Latvian Gambit: Fraser Defense 1. e4 e5 2. Nf3 f5 3. Nxe5 Nc6 +C40 Latvian Gambit: Greco Variation 1. e4 e5 2. Nf3 f5 3. Nxe5 Qe7 +C40 Latvian Gambit: Lobster Gambit 1. e4 e5 2. Nf3 f5 3. g4 +C40 Latvian Gambit: Mason Countergambit 1. e4 e5 2. Nf3 f5 3. d4 +C40 Latvian Gambit: Mayet Attack 1. e4 e5 2. Nf3 f5 3. Bc4 +C40 Latvian Gambit: Mayet Attack, Morgado Defense 1. e4 e5 2. Nf3 f5 3. Bc4 Nf6 +C40 Latvian Gambit: Mayet Attack, Poisoned Pawn Variation 1. e4 e5 2. Nf3 f5 3. Bc4 fxe4 4. Nxe5 Qg5 5. d4 Qxg2 +C40 Latvian Gambit: Mayet Attack, Polerio-Svedenborg Variation 1. e4 e5 2. Nf3 f5 3. Bc4 fxe4 4. Nxe5 d5 +C40 Latvian Gambit: Mayet Attack, Strautins Gambit 1. e4 e5 2. Nf3 f5 3. Bc4 b5 +C40 Latvian Gambit: Mlotkowski Variation 1. e4 e5 2. Nf3 f5 3. Nc3 +C40 Latvian Gambit: Senechaud Gambit 1. e4 e5 2. Nf3 f5 3. b4 +C41 Philidor Defense 1. e4 e5 2. Nf3 d6 +C41 Philidor Defense 1. e4 e5 2. Nf3 d6 3. d4 +C41 Philidor Defense 1. e4 e5 2. Nf3 d6 3. Bc4 +C41 Philidor Defense 1. e4 e5 2. Nf3 d6 3. Bc4 Be7 +C41 Philidor Defense: Albin-Blackburne Gambit 1. e4 e5 2. Nf3 d6 3. d4 Bg4 4. dxe5 Nd7 +C41 Philidor Defense: Berger Variation 1. e4 e5 2. Nf3 d6 3. d4 exd4 4. Nxd4 Nf6 5. Nc3 Be7 6. Be2 O-O 7. O-O c5 8. Nf3 Nc6 9. Bg5 Be6 10. Re1 +C41 Philidor Defense: Bird Gambit 1. e4 e5 2. Nf3 d6 3. d4 exd4 4. c3 +C41 Philidor Defense: Boden Variation 1. e4 e5 2. Nf3 d6 3. d4 exd4 4. Qxd4 Bd7 +C41 Philidor Defense: Exchange Variation 1. e4 e5 2. Nf3 d6 3. d4 exd4 +C41 Philidor Defense: Exchange Variation 1. e4 e5 2. Nf3 d6 3. d4 exd4 4. Nxd4 +C41 Philidor Defense: Exchange Variation 1. e4 e5 2. Nf3 d6 3. d4 exd4 4. Nxd4 Nf6 +C41 Philidor Defense: Hanham Variation 1. e4 e5 2. Nf3 d6 3. d4 Nd7 +C41 Philidor Defense: Hanham Variation, Delmar Variation 1. e4 e5 2. Nf3 d6 3. d4 Nd7 4. Bc4 c6 5. c3 +C41 Philidor Defense: Hanham Variation, Krause Variation 1. e4 e5 2. Nf3 d6 3. d4 Nd7 4. Bc4 c6 5. O-O +C41 Philidor Defense: Hanham Variation, Schlechter Variation 1. e4 e5 2. Nf3 d6 3. d4 Nd7 4. Bc4 c6 5. Nc3 +C41 Philidor Defense: Hanham Variation, Sharp Variation 1. e4 e5 2. Nf3 d6 3. d4 Nd7 4. Bc4 Nb6 +C41 Philidor Defense: Hanham Variation, Steiner Variation 1. e4 e5 2. Nf3 d6 3. d4 Nd7 4. Bc4 c6 5. O-O Be7 6. dxe5 +C41 Philidor Defense: Hanham, Kmoch Variation 1. e4 e5 2. Nf3 d6 3. d4 Nd7 4. Bc4 c6 5. Ng5 +C41 Philidor Defense: Larsen Variation 1. e4 e5 2. Nf3 d6 3. d4 exd4 4. Nxd4 g6 +C41 Philidor Defense: Lion Variation 1. e4 e5 2. Nf3 d6 3. d4 Nf6 4. Nc3 Nbd7 +C41 Philidor Defense: Lion Variation, Bishop Sacrifice 1. e4 e5 2. Nf3 d6 3. d4 Nf6 4. Nc3 Nbd7 5. Bc4 Be7 6. Bxf7+ +C41 Philidor Defense: Lion Variation, Delayed Bishop Sacrifice 1. e4 d6 2. d4 Nf6 3. Nc3 Nbd7 4. Nf3 e5 5. Bc4 Be7 6. dxe5 dxe5 7. Bxf7+ +C41 Philidor Defense: Lion Variation, Forcing Line 1. e4 e5 2. Nf3 d6 3. d4 Nf6 4. Nc3 Nbd7 5. Bc4 Be7 6. Ng5 O-O 7. Bxf7+ Rxf7 8. Ne6 +C41 Philidor Defense: Lion Variation, Lion's Claw, with Bc4 and h6 1. e4 e5 2. Nf3 d6 3. d4 Nf6 4. Nc3 Nbd7 5. Bc4 Be7 6. O-O h6 +C41 Philidor Defense: Lion Variation, Lion's Claw, with Be2 and c6 1. e4 e5 2. Nf3 d6 3. d4 Nf6 4. Nc3 Nbd7 5. Be2 Be7 6. O-O c6 +C41 Philidor Defense: Lion Variation, Shirov Gambit 1. e4 e5 2. Nf3 d6 3. d4 Nd7 4. Nc3 Ngf6 5. g4 +C41 Philidor Defense: Lion Variation, Sozin Variation 1. e4 d6 2. d4 Nf6 3. Nc3 e5 4. Nf3 Nbd7 5. Bc4 Be7 6. O-O O-O 7. Qe2 c6 8. a4 exd4 +C41 Philidor Defense: Lopez Countergambit 1. e4 e5 2. Nf3 d6 3. Bc4 f5 +C41 Philidor Defense: Lopez Countergambit, Jaenisch Variation 1. e4 e5 2. Nf3 d6 3. d4 f5 4. Bc4 exd4 5. Ng5 Nh6 6. Nxh7 +C41 Philidor Defense: Morphy Gambit 1. e4 e5 2. Nf3 d6 3. d4 exd4 4. Bc4 +C41 Philidor Defense: Nimzowitsch Variation 1. e4 e5 2. Nf3 d6 3. d4 Nf6 +C41 Philidor Defense: Nimzowitsch Variation 1. e4 e5 2. Nf3 d6 3. d4 Nf6 4. dxe5 +C41 Philidor Defense: Nimzowitsch Variation, Klein Variation 1. e4 e5 2. Nf3 d6 3. d4 Nf6 4. Bc4 +C41 Philidor Defense: Nimzowitsch Variation, Rellstab Variation 1. e4 e5 2. Nf3 d6 3. d4 Nf6 4. dxe5 Nxe4 5. Qd5 +C41 Philidor Defense: Nimzowitsch Variation, Sokolsky Variation 1. e4 e5 2. Nf3 d6 3. d4 Nf6 4. dxe5 Nxe4 5. Nbd2 +C41 Philidor Defense: Nimzowitsch, Larobok Variation 1. e4 e5 2. Nf3 d6 3. d4 Nf6 4. Nc3 Nbd7 5. Bc4 Be7 6. Ng5 O-O 7. Bxf7+ +C41 Philidor Defense: Nimzowitsch, Locock Variation 1. e4 e5 2. Nf3 d6 3. d4 Nf6 4. Ng5 +C41 Philidor Defense: Paulsen Attack 1. e4 e5 2. Nf3 d6 3. d4 exd4 4. Nxd4 d5 5. exd5 +C41 Philidor Defense: Philidor Countergambit 1. e4 e5 2. Nf3 d6 3. d4 f5 +C41 Philidor Defense: Philidor Countergambit, Berger Variation 1. e4 e5 2. Nf3 d6 3. d4 f5 4. dxe5 fxe4 5. Ng5 d5 6. e6 Bc5 7. Nc3 +C41 Philidor Defense: Philidor Countergambit, Zukertort Variation 1. e4 e5 2. Nf3 d6 3. d4 f5 4. Nc3 +C41 Philidor Defense: Philidor Countergambit, del Rio Attack 1. e4 e5 2. Nf3 d6 3. d4 f5 4. dxe5 fxe4 5. Ng5 d5 6. e6 +C41 Philidor Defense: Philidor Gambit 1. e4 e5 2. Nf3 d6 3. d4 Bd7 +C41 Philidor Defense: Steinitz Variation 1. e4 e5 2. Nf3 d6 3. Bc4 Be7 4. c3 +C42 Petrov's Defense 1. e4 e5 2. Nf3 Nf6 +C42 Petrov's Defense 1. e4 e5 2. Nf3 Nf6 3. Nxe5 +C42 Petrov's Defense 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 +C42 Petrov's Defense 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 +C42 Petrov's Defense 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 +C42 Petrov's Defense: Classical Attack 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 +C42 Petrov's Defense: Classical Attack, Berger Variation 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 d5 6. Bd3 Be7 7. O-O Nc6 8. Re1 Bg4 9. c3 f5 10. Nbd2 +C42 Petrov's Defense: Classical Attack, Chigorin Variation 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 d5 6. Bd3 Be7 7. O-O Nc6 8. Re1 +C42 Petrov's Defense: Classical Attack, Chigorin Variation, Browne Attack 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 d5 6. Bd3 Nc6 7. O-O Be7 8. c4 Nb4 9. cxd5 +C42 Petrov's Defense: Classical Attack, Chigorin Variation, Main Line 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 d5 6. Bd3 Nc6 7. O-O Be7 8. c4 Nb4 9. Be2 +C42 Petrov's Defense: Classical Attack, Closed Variation 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 Nf6 +C42 Petrov's Defense: Classical Attack, Jaenisch Variation 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 d5 6. Bd3 Nc6 7. O-O Be7 8. c4 +C42 Petrov's Defense: Classical Attack, Krause Variation 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 d5 6. Bd3 Nc6 7. O-O Be7 8. Re1 Bg4 9. c3 f5 10. c4 +C42 Petrov's Defense: Classical Attack, Marshall Trap 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 d5 6. Bd3 Bd6 7. O-O O-O 8. c4 Bg4 9. cxd5 f5 10. Re1 Bxh2+ +C42 Petrov's Defense: Classical Attack, Marshall Variation 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 d5 6. Bd3 Bd6 +C42 Petrov's Defense: Classical Attack, Marshall Variation, Chinese Gambit 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 d5 6. Bd3 Bd6 7. O-O O-O 8. c4 c6 9. Re1 Bg4 +C42 Petrov's Defense: Classical Attack, Maróczy Variation 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 d5 6. Bd3 Be7 7. O-O Nc6 8. Re1 Bg4 9. c3 f5 10. c4 Bh4 +C42 Petrov's Defense: Classical Attack, Mason Variation 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 d5 6. Bd3 Be7 7. O-O O-O +C42 Petrov's Defense: Classical Attack, Mason-Showalter Variation 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 d5 6. Bd3 Nc6 +C42 Petrov's Defense: Classical Attack, Staunton Variation 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 d5 6. Bd3 Bd6 7. O-O O-O 8. c4 c6 +C42 Petrov's Defense: Classical Attack, Tarrasch Variation 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 d5 6. Bd3 Bd6 7. O-O O-O 8. c4 Bg4 +C42 Petrov's Defense: Cochrane Gambit 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nxf7 +C42 Petrov's Defense: Cochrane Gambit, Bishop Check Line 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nxf7 Kxf7 5. Bc4+ +C42 Petrov's Defense: Cochrane Gambit, Center Variation 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nxf7 Kxf7 5. d4 +C42 Petrov's Defense: Cozio Attack 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. Qe2 +C42 Petrov's Defense: Damiano Variation 1. e4 e5 2. Nf3 Nf6 3. Nxe5 Nxe4 +C42 Petrov's Defense: Damiano Variation, Kholmov Gambit 1. e4 e5 2. Nf3 Nf6 3. Nxe5 Nxe4 4. Qe2 Qe7 +C42 Petrov's Defense: French Attack 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d3 +C42 Petrov's Defense: Italian Variation 1. e4 e5 2. Nf3 Nf6 3. Bc4 +C42 Petrov's Defense: Karklins-Martinovsky Variation 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nd3 +C42 Petrov's Defense: Kaufmann Attack 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. c4 +C42 Petrov's Defense: Millennium Attack 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. Bd3 +C42 Petrov's Defense: Moody Gambit 1. e4 e5 2. Nf3 Nf6 3. Qe2 Nc6 4. d4 +C42 Petrov's Defense: Nimzowitsch Attack 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. Nc3 +C42 Petrov's Defense: Paulsen Attack 1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nc4 +C42 Petrov's Defense: Stafford Gambit 1. e4 e5 2. Nf3 Nf6 3. Nxe5 Nc6 +C42 Petrov's Defense: Stafford Gambit Accepted 1. e4 e5 2. Nf3 Nf6 3. Nxe5 Nc6 4. Nxc6 dxc6 +C42 Petrov's Defense: Stafford Gambit Accepted 1. e4 e5 2. Nf3 Nf6 3. Nxe5 Nc6 4. Nxc6 dxc6 5. Nc3 Bc5 +C42 Petrov's Defense: Stafford Gambit Accepted 1. e4 e5 2. Nf3 Nf6 3. Nxe5 Nc6 4. Nxc6 dxc6 5. d3 Bc5 +C42 Petrov's Defense: Three Knights Game 1. e4 e5 2. Nf3 Nf6 3. Nc3 +C43 Bishop's Opening: Urusov Gambit 1. e4 e5 2. Bc4 Nf6 3. d4 exd4 4. Nf3 +C43 Bishop's Opening: Urusov Gambit, Keidansky Gambit 1. e4 e5 2. Bc4 Nf6 3. d4 exd4 4. Nf3 Nxe4 5. Qxd4 +C43 Petrov's Defense: Modern Attack 1. e4 e5 2. Nf3 Nf6 3. d4 +C43 Petrov's Defense: Modern Attack 1. e4 e5 2. Nf3 Nf6 3. d4 exd4 +C43 Petrov's Defense: Modern Attack, Bardeleben Variation 1. e4 e5 2. Nf3 Nf6 3. d4 exd4 4. e5 Ne4 5. Qe2 Nc5 6. Nxd4 Nc6 +C43 Petrov's Defense: Modern Attack, Center Attack 1. e4 e5 2. Nf3 Nf6 3. d4 exd4 4. e5 Ne4 5. Qxd4 +C43 Petrov's Defense: Modern Attack, Center Variation 1. e4 e5 2. Nf3 Nf6 3. d4 Nxe4 4. Bd3 +C43 Petrov's Defense: Modern Attack, Murrey Variation 1. e4 e5 2. Nf3 Nf6 3. d4 Nxe4 4. Bd3 Nc6 +C43 Petrov's Defense: Modern Attack, Steinitz Variation 1. e4 e5 2. Nf3 Nf6 3. d4 exd4 4. e5 Ne4 5. Qe2 +C43 Petrov's Defense: Modern Attack, Symmetrical Variation 1. e4 e5 2. Nf3 Nf6 3. d4 d5 +C43 Petrov's Defense: Modern Attack, Tal Gambit 1. e4 e5 2. Nf3 Nf6 3. d4 exd4 4. e5 Ne4 5. Bb5 +C43 Petrov's Defense: Modern Attack, Trifunovic Variation 1. e4 e5 2. Nf3 Nf6 3. d4 Nxe4 4. Bd3 d5 5. Nxe5 Bd6 6. O-O O-O 7. c4 Bxe5 +C44 Dresden Opening: The Goblin 1. e4 e5 2. Nf3 Nc6 3. c4 Nf6 4. Nxe5 +C44 Irish Gambit 1. e4 e5 2. Nf3 Nc6 3. Nxe5 +C44 King's Knight Opening: Konstantinopolsky 1. e4 e5 2. Nf3 Nc6 3. g3 +C44 King's Knight Opening: Normal Variation 1. e4 e5 2. Nf3 Nc6 +C44 King's Pawn Game: Dresden Opening 1. e4 e5 2. Nf3 Nc6 3. c4 +C44 King's Pawn Game: Pachman Wing Gambit 1. e4 e5 2. Nf3 Nc6 3. b4 +C44 King's Pawn Game: Schulze-Müller Gambit 1. e4 e5 2. Nf3 Nc6 3. Nxe5 Nxe5 4. d4 +C44 King's Pawn Game: Tayler Opening 1. e4 e5 2. Nf3 Nc6 3. Be2 +C44 King's Pawn Game: Tayler Opening 1. e4 e5 2. Nf3 Nc6 3. Be2 Nf6 4. d4 +C44 King's Pawn Game: Tayler Opening, Basman Gambit 1. e4 e5 2. Nf3 Nc6 3. Be2 Nf6 4. d4 exd4 5. e5 +C44 King's Pawn Game: Tayler Opening, Inverted Hanham 1. e4 e5 2. Nf3 Nc6 3. Be2 Nf6 4. d3 d5 5. Nbd2 +C44 Latvian Gambit: Clam Gambit 1. e4 e5 2. Nf3 Nc6 3. d3 f5 4. exf5 +C44 Ponziani Opening 1. e4 e5 2. Nf3 Nc6 3. c3 +C44 Ponziani Opening: Caro Gambit 1. e4 e5 2. Nf3 Nc6 3. c3 d5 4. Qa4 Bd7 +C44 Ponziani Opening: Jaenisch Counterattack 1. e4 e5 2. Nf3 Nc6 3. c3 Nf6 +C44 Ponziani Opening: Jaenisch Counterattack 1. e4 e5 2. Nf3 Nc6 3. c3 Nf6 4. d3 +C44 Ponziani Opening: Jaenisch Counterattack 1. e4 e5 2. Nf3 Nc6 3. c3 Nf6 4. d3 d5 +C44 Ponziani Opening: Jaenisch Counterattack 1. e4 e5 2. Nf3 Nc6 3. c3 Nf6 4. d3 d5 5. Nbd2 +C44 Ponziani Opening: Leonhardt Variation 1. e4 e5 2. Nf3 Nc6 3. c3 d5 4. Qa4 Nf6 +C44 Ponziani Opening: Neumann Gambit 1. e4 e5 2. Nf3 Nc6 3. c3 Nf6 4. Bc4 +C44 Ponziani Opening: Ponziani Countergambit 1. e4 e5 2. Nf3 Nc6 3. c3 f5 +C44 Ponziani Opening: Ponziani Countergambit, Schmidt Attack 1. e4 e5 2. Nf3 Nc6 3. c3 f5 4. d4 d6 5. d5 +C44 Ponziani Opening: Romanishin Variation 1. e4 e5 2. Nf3 Nc6 3. c3 Be7 +C44 Ponziani Opening: Réti Variation 1. e4 e5 2. Nf3 Nc6 3. c3 Nge7 +C44 Ponziani Opening: Spanish Variation 1. e4 e5 2. Nf3 Nc6 3. c3 d5 4. Bb5 +C44 Ponziani Opening: Spanish Variation, Harrwitz Attack, Nikitin Gambit 1. e4 e5 2. Nf3 Nc6 3. c3 d5 4. Bb5 dxe4 5. Nxe5 Qd5 6. Qa4 +C44 Ponziani Opening: Steinitz Variation 1. e4 e5 2. Nf3 Nc6 3. c3 d5 4. Qa4 f6 +C44 Ponziani Opening: Vukovic Gambit 1. e4 e5 2. Nf3 Nc6 3. c3 Nf6 4. d4 Nxe4 5. d5 Bc5 +C44 Scotch Game 1. e4 e5 2. Nf3 Nc6 3. d4 +C44 Scotch Game 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 +C44 Scotch Game: Benima Defense 1. e4 e5 2. Nf3 Nc6 3. Bc4 Be7 4. d4 exd4 +C44 Scotch Game: Cochrane Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Bc4 Bb4+ 5. c3 dxc3 6. bxc3 Ba5 7. e5 +C44 Scotch Game: Cochrane-Shumov Defense 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Bc4 Bc5 5. Ng5 Nh6 6. Nxf7 Nxf7 7. Bxf7+ Kxf7 8. Qh5+ g6 9. Qxc5 d5 +C44 Scotch Game: Göring Gambit 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. c3 +C44 Scotch Game: Göring Gambit, Bardeleben Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. c3 dxc3 5. Bc4 Nf6 6. Nxc3 Bb4 +C44 Scotch Game: Göring Gambit, Double Pawn Sacrifice 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. c3 dxc3 5. Bc4 +C44 Scotch Game: Göring Gambit, Main Line 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. c3 dxc3 5. Nxc3 Bb4 +C44 Scotch Game: Hanneken Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Bc4 Bb4+ 5. c3 dxc3 6. O-O cxb2 7. Bxb2 Nf6 8. Ng5 O-O 9. e5 Nxe5 +C44 Scotch Game: Haxo Gambit 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Bc4 Bc5 +C44 Scotch Game: Lolli Variation 1. e4 e5 2. Nf3 Nc6 3. d4 Nxd4 +C44 Scotch Game: Lolli Variation 1. e4 e5 2. Nf3 Nc6 3. d4 Nxd4 4. Nxd4 exd4 5. Qxd4 +C44 Scotch Game: Napoleon Gambit 1. e4 e5 2. Nf3 Nc6 3. d4 Nxd4 4. Nxd4 exd4 5. Bc4 +C44 Scotch Game: Relfsson Gambit 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Bb5 +C44 Scotch Game: Scotch Gambit 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Bc4 +C44 Scotch Game: Scotch Gambit, Advance Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Bc4 Nf6 5. e5 +C44 Scotch Game: Scotch Gambit, Cochrane-Anderssen Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Bc4 Bc5 5. O-O d6 6. c3 Bg4 +C44 Scotch Game: Scotch Gambit, Dubois Réti Defense 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. d4 exd4 +C44 Scotch Game: Scotch Gambit, Göring Gambit Declined 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. c3 d5 +C44 Scotch Game: Scotch Gambit, Kingside Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. d4 exd4 5. e5 Ng4 +C44 Scotch Game: Scotch Gambit, London Defense 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Bc4 Bb4+ +C44 Scotch Game: Scotch Gambit, Sarratt Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Bc4 Bc5 5. Ng5 +C44 Scotch Game: Sea-Cadet Mate 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. c3 dxc3 5. Nxc3 d6 6. Bc4 Bg4 7. O-O Ne5 8. Nxe5 Bxd1 9. Bxf7+ Ke7 10. Nd5# +C44 Scotch Game: Vitzthum Attack 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Bc4 Bc5 5. Ng5 Nh6 6. Qh5 +C45 Scotch Game 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 +C45 Scotch Game 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Qh4 5. Nb5 Bb4+ 6. Bd2 +C45 Scotch Game: Alekhine Gambit 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Nf6 5. e5 +C45 Scotch Game: Blumenfeld Attack 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Bc5 5. Be3 Qf6 6. Nb5 +C45 Scotch Game: Braune Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Qh4 5. Be3 +C45 Scotch Game: Classical Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Bc5 +C45 Scotch Game: Classical Variation, Blackburne Attack 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Bc5 5. Be3 Qf6 6. c3 Nge7 7. Qd2 +C45 Scotch Game: Classical Variation, Intermezzo Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Bc5 5. Nxc6 Qf6 +C45 Scotch Game: Classical Variation, Millennium Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Bc5 5. Be3 Qf6 6. c3 Qg6 +C45 Scotch Game: Fraser Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Qh4 5. Nf3 +C45 Scotch Game: Ghulam-Kassim Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Nxd4 5. Qxd4 d6 6. Bd3 +C45 Scotch Game: Gottschall Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Bc5 5. Be3 Qf6 6. c3 Nge7 7. Qd2 d5 8. Nb5 Bxe3 9. Qxe3 O-O 10. Nxc7 Rb8 11. Nxd5 Nxd5 12. exd5 Nb4 +C45 Scotch Game: Horwitz Attack 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Qh4 5. Nb5 +C45 Scotch Game: Horwitz Attack, Blackburne Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Qh4 5. Nb5 Bb4+ 6. Bd2 Qxe4+ 7. Be2 Kd8 8. O-O Bxd2 9. Qxd2 +C45 Scotch Game: Malaniuk Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Bb4+ +C45 Scotch Game: Meitner Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Bc5 5. Be3 Qf6 6. c3 Nge7 7. Nc2 +C45 Scotch Game: Mieses Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Nf6 5. Nxc6 bxc6 6. e5 +C45 Scotch Game: Modern Defense 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Qh4 5. Nc3 Bb4 +C45 Scotch Game: Paulsen Attack 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Bc5 5. Be3 Qf6 6. c3 Nge7 7. Bb5 +C45 Scotch Game: Paulsen Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Qh4 5. Nf5 +C45 Scotch Game: Paulsen, Gunsberg Defense 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Bc5 5. Be3 Qf6 6. c3 Nge7 7. Bb5 Nd8 +C45 Scotch Game: Potter Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Bc5 5. Nb3 +C45 Scotch Game: Romanishin Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Bc5 5. Nb3 Bb4+ +C45 Scotch Game: Rosenthal Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Qh4 5. Nb5 Bb4+ 6. Bd2 Qxe4+ 7. Be2 Kd8 8. O-O Bxd2 9. Nxd2 Qg6 +C45 Scotch Game: Schmidt Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Nf6 +C45 Scotch Game: Steinitz Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Qh4 +C45 Scotch Game: Steinitz Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Qh4 5. Nc3 +C45 Scotch Game: Tartakower Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Nf6 5. Nxc6 bxc6 6. Nd2 +C46 Three Knights Opening 1. e4 e5 2. Nf3 Nc6 3. Nc3 +C46 Three Knights Opening 1. e4 e5 2. Nf3 Nc6 3. Nc3 Bb4 +C46 Three Knights Opening: Schlechter Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Bb4 4. Nd5 Nf6 +C46 Three Knights Opening: Steinitz Defense 1. e4 e5 2. Nf3 Nc6 3. Nc3 g6 +C46 Three Knights Opening: Steinitz-Rosenthal Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 g6 4. d4 exd4 5. Nd5 +C46 Three Knights Opening: Winawer Defense 1. e4 e5 2. Nf3 Nc6 3. Nc3 f5 +C47 Four Knights Game 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 +C47 Four Knights Game: Glek System 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. g3 +C47 Four Knights Game: Glek System 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. g3 d5 5. exd5 Nxd5 6. Bg2 Nxc3 7. bxc3 +C47 Four Knights Game: Gunsberg Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. a3 +C47 Four Knights Game: Gunsberg Variation, Provincial Opening 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. a3 d6 5. h3 +C47 Four Knights Game: Halloween Gambit 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Nxe5 +C47 Four Knights Game: Halloween Gambit, Oldtimer Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Nxe5 Nxe5 5. d4 Ng6 6. e5 Ng8 7. Bc4 Bb4 8. Qf3 f5 +C47 Four Knights Game: Halloween Gambit, Plasma Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Nxe5 Nxe5 5. d4 Nc6 6. d5 Ne5 7. f4 Ng6 8. e5 Ng8 9. d6 cxd6 10. exd6 Qf6 11. Nb5 Rb8 +C47 Four Knights Game: Italian Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Nc3 +C47 Four Knights Game: Italian Variation, Noa Gambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Nc3 Nxe4 5. Bxf7+ +C47 Four Knights Game: Naroditsky Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Nd5 +C47 Four Knights Game: Scotch Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. d4 +C47 Four Knights Game: Scotch Variation Accepted 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. d4 exd4 +C47 Four Knights Game: Scotch Variation Accepted, Main Line 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. d4 exd4 5. Nxd4 Bb4 6. Nxc6 bxc6 7. Bd3 d5 8. exd5 O-O 9. O-O +C47 Four Knights Game: Scotch Variation, Belgrade Gambit 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. d4 exd4 5. Nd5 +C47 Four Knights Game: Scotch Variation, Belgrade Gambit, Modern Defense 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. d4 exd4 5. Nd5 Nxe4 6. Qe2 f5 +C47 Four Knights Game: Scotch Variation, Krause Gambit 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. d4 Bb4 5. Nxe5 +C47 Four Knights Game: Scotch Variation, Krause Gambit, Leonhardt Defense 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. d4 Bb4 5. Nxe5 Qe7 +C47 Four Knights Game: Scotch Variation, Oxford Gambit 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. d4 Bb4 5. d5 Nd4 +C47 Four Knights Game: Scotch Variation, Schmid Defense 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. d4 exd4 5. Nxd4 Nxe4 +C48 Four Knights Game: Spanish Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 +C48 Four Knights Game: Spanish Variation, Bardeleben Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Bc5 5. O-O O-O 6. Nxe5 Nxe5 7. d4 Bd6 8. f4 Nc6 9. e5 Bb4 +C48 Four Knights Game: Spanish Variation, Classical Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Bc5 +C48 Four Knights Game: Spanish Variation, Ranken Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 a6 5. Bxc6 +C48 Four Knights Game: Spanish Variation, Rubinstein Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Nd4 +C48 Four Knights Game: Spanish Variation, Rubinstein Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Nd4 5. Be2 +C48 Four Knights Game: Spanish Variation, Rubinstein Variation 1. e4 e5 2. Nf3 Nf6 3. Nc3 Nc6 4. Bb5 Nd4 5. Nxe5 Qe7 6. f4 +C48 Four Knights Game: Spanish Variation, Rubinstein Variation Accepted 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Nd4 5. Nxd4 +C48 Four Knights Game: Spanish Variation, Rubinstein Variation, Henneberger Variation 1. e4 e5 2. Nf3 Nf6 3. Nc3 Nc6 4. Bb5 Nd4 5. O-O +C48 Four Knights Game: Spanish Variation, Rubinstein Variation, Marshall Gambit 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Nd4 5. Ba4 Bc5 6. Nxe5 O-O +C48 Four Knights Game: Spanish Variation, Rubinstein Variation, Marshall Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Nd4 5. Nxe5 Bc5 6. O-O O-O +C48 Four Knights Game: Spanish Variation, Rubinstein Variation, Maróczy Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Nd4 5. Be2 Nxf3+ 6. Bxf3 Bc5 7. O-O O-O 8. d3 d6 9. Na4 Bb6 +C48 Four Knights Game: Spanish Variation, Spielmann Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 a6 5. Bxc6 dxc6 6. Nxe5 Nxe4 7. Nxe4 Qd4 8. O-O Qxe5 9. Re1 Be6 10. d4 Qd5 +C49 Four Knights Game: Spanish Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Bb4 5. O-O O-O 6. d3 Bxc3 +C49 Four Knights Game: Spanish Variation, Alatortsev Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Bb4 5. O-O O-O 6. d3 Qe7 7. Ne2 d5 +C49 Four Knights Game: Spanish Variation, Double Spanish 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Bb4 +C49 Four Knights Game: Spanish Variation, Double Spanish 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Bb4 5. O-O O-O 6. d3 +C49 Four Knights Game: Spanish Variation, Gunsberg Counterattack 1. e4 e5 2. Nf3 Nf6 3. Nc3 Nc6 4. Bb5 Bb4 5. O-O O-O 6. Nd5 Nxd5 7. exd5 e4 +C49 Four Knights Game: Spanish Variation, Janowski Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Bb4 5. O-O O-O 6. d3 Bxc3 7. bxc3 d6 8. Re1 +C49 Four Knights Game: Spanish Variation, Nimzowitsch Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Bb4 5. O-O O-O 6. Bxc6 +C49 Four Knights Game: Spanish Variation, Svenonius Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Bb4 5. O-O O-O 6. d3 Bxc3 7. bxc3 d5 +C49 Four Knights Game: Spanish Variation, Symmetrical Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Bb4 5. O-O O-O 6. d3 d6 +C49 Four Knights Game: Spanish Variation, Symmetrical Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Bb4 5. O-O O-O 6. d3 d6 7. Bg5 Bxc3 8. bxc3 Qe7 9. Re1 Nd8 10. d4 Bg4 +C49 Four Knights Game: Spanish Variation, Symmetrical Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Bb4 5. O-O O-O 6. d3 d6 7. Bg5 Ne7 +C49 Four Knights Game: Spanish Variation, Symmetrical Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Bb4 5. O-O O-O 6. d3 d6 7. Ne2 +C49 Four Knights Game: Spanish Variation, Symmetrical Variation, Blake Variation 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Bb4 5. O-O O-O 6. d3 d6 7. Bg5 Ne7 8. Nh4 c6 9. Bc4 d5 10. Bb3 Qd6 +C49 Four Knights Game: Spanish Variation, Symmetrical Variation, Metger Unpin 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Bb4 5. O-O O-O 6. d3 d6 7. Bg5 Bxc3 8. bxc3 Qe7 +C49 Four Knights Game: Spanish Variation, Symmetrical Variation, Tarrasch Variation 1. e4 e5 2. Nf3 Nf6 3. Nc3 Nc6 4. Bb5 Bb4 5. O-O O-O 6. d3 d6 7. Bg5 Be6 +C50 Four Knights Game: Italian Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. Nc3 Nf6 +C50 Italian Game 1. e4 e5 2. Nf3 Nc6 3. Bc4 +C50 Italian Game: Anti-Fried Liver Defense 1. e4 e5 2. Nf3 Nc6 3. Bc4 h6 +C50 Italian Game: Blackburne-Kostić Gambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nd4 +C50 Italian Game: Classical Variation, Albin Gambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O Nf6 5. c3 +C50 Italian Game: Deutz Gambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O Nf6 5. d4 +C50 Italian Game: Giuoco Pianissimo 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. d3 +C50 Italian Game: Giuoco Pianissimo 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. O-O Bc5 5. Nc3 d6 6. d3 +C50 Italian Game: Giuoco Pianissimo 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. Nc3 Nf6 5. O-O O-O +C50 Italian Game: Giuoco Pianissimo 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. Nc3 Nf6 5. O-O O-O 6. d3 +C50 Italian Game: Giuoco Pianissimo, Canal Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. d3 Nf6 5. Nc3 d6 6. Bg5 +C50 Italian Game: Giuoco Pianissimo, Dubois Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. d3 f5 5. Ng5 f4 +C50 Italian Game: Giuoco Pianissimo, Italian Four Knights Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. d3 Nf6 5. Nc3 +C50 Italian Game: Giuoco Pianissimo, Lucchini Gambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. d3 f5 +C50 Italian Game: Giuoco Pianissimo, Normal 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. d3 Bc5 +C50 Italian Game: Giuoco Piano 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 +C50 Italian Game: Hungarian Defense 1. e4 e5 2. Nf3 Nc6 3. Bc4 Be7 +C50 Italian Game: Hungarian Defense, Tartakower Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Be7 4. d4 exd4 5. c3 Nf6 6. e5 Ne4 +C50 Italian Game: Jerome Gambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. Bxf7+ +C50 Italian Game: Paris Defense 1. e4 e5 2. Nf3 Nc6 3. Bc4 d6 +C50 Italian Game: Rosentreter Gambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. d4 +C50 Italian Game: Rousseau Gambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 f5 +C51 Italian Game: Evans Gambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 +C51 Italian Game: Evans Gambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Bc5 6. d4 exd4 7. O-O d6 8. cxd4 Bb6 9. Nc3 Bg4 +C51 Italian Game: Evans Gambit Accepted 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 +C51 Italian Game: Evans Gambit Declined 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bb6 +C51 Italian Game: Evans Gambit Declined 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bb6 5. a4 +C51 Italian Game: Evans Gambit Declined, Cordel Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bb6 5. Bb2 +C51 Italian Game: Evans Gambit Declined, Hicken Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bb6 5. b5 Na5 6. Nxe5 Qg5 7. Qf3 Qxe5 8. Qxf7+ Kd8 9. Bb2 +C51 Italian Game: Evans Gambit Declined, Hirschbach Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bb6 5. b5 Na5 6. Nxe5 Qg5 +C51 Italian Game: Evans Gambit Declined, Lange Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bb6 5. b5 Na5 6. Nxe5 Nh6 +C51 Italian Game: Evans Gambit Declined, Pavlov Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bb6 5. b5 Na5 6. Nxe5 Nh6 7. d4 d6 8. Bxh6 dxe5 9. Bxg7 Rg8 10. Bxf7+ Kxf7 11. Bxe5 Qg5 12. Nd2 +C51 Italian Game: Evans Gambit Declined, Showalter Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bb6 5. a4 a6 6. Nc3 +C51 Italian Game: Evans Gambit Declined, Vasquez Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bb6 5. b5 Na5 6. Nxe5 Qg5 7. Bxf7+ Ke7 8. Qh5 +C51 Italian Game: Evans Gambit, Anderssen Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Be7 +C51 Italian Game: Evans Gambit, Anderssen Variation, Cordel Line 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Be7 6. d4 Na5 +C51 Italian Game: Evans Gambit, Fontaine Countergambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 b5 +C51 Italian Game: Evans Gambit, Fraser Attack 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Bc5 6. d4 exd4 7. O-O d6 8. cxd4 Bb6 9. Nc3 Bg4 10. Qa4 +C51 Italian Game: Evans Gambit, Fraser-Mortimer Attack 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Bc5 6. d4 exd4 7. O-O d6 8. cxd4 Bb6 9. Nc3 Bg4 10. Qa4 Bd7 11. Qb3 Na5 12. Bxf7+ Kf8 13. Qc2 +C51 Italian Game: Evans Gambit, Göring Attack 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Bc5 6. d4 exd4 7. O-O d6 8. cxd4 Bb6 9. Nc3 Na5 10. Bg5 +C51 Italian Game: Evans Gambit, Harding Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Bc5 6. d4 exd4 7. cxd4 Bb4+ 8. Bd2 +C51 Italian Game: Evans Gambit, Hein Countergambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 d5 +C51 Italian Game: Evans Gambit, Mayet Defense 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Bf8 +C51 Italian Game: Evans Gambit, McDonnell Defense 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Bc5 +C51 Italian Game: Evans Gambit, McDonnell Defense, Main Line 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Bc5 6. d4 exd4 7. O-O d6 8. cxd4 Bb6 +C51 Italian Game: Evans Gambit, Morphy Attack 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. d4 exd4 7. O-O d6 8. cxd4 Bb6 9. Nc3 +C51 Italian Game: Evans Gambit, Mortimer-Evans Gambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Bc5 6. d4 exd4 7. O-O d6 8. cxd4 Bb6 9. Nc3 Bg4 10. Qa4 Bd7 11. Qb3 Na5 12. Bxf7+ Kf8 13. Qc2 Kxf7 +C51 Italian Game: Evans Gambit, Paulsen Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Bc5 6. d4 exd4 7. O-O d6 8. cxd4 Bb6 9. d5 Na5 10. Bb2 Ne7 +C51 Italian Game: Evans Gambit, Steinitz Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Bc5 6. d4 exd4 7. O-O d6 8. cxd4 Bb6 9. Nc3 Na5 10. Bg5 f6 11. Be3 +C51 Italian Game: Evans Gambit, Stone-Ware Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Bd6 +C51 Italian Game: Evans Gambit, Ulvestad Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Bc5 6. d4 exd4 7. O-O d6 8. cxd4 Bb6 9. d5 Na5 10. Bb2 +C52 Italian Game: Evans Gambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. O-O d6 +C52 Italian Game: Evans Gambit, Alapin-Steinitz Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. O-O d6 7. d4 Bg4 +C52 Italian Game: Evans Gambit, Anderssen Defense 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. O-O Nf6 7. d4 exd4 +C52 Italian Game: Evans Gambit, Bronstein Defense 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. d4 d6 +C52 Italian Game: Evans Gambit, Compromised Defense 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. d4 exd4 7. O-O dxc3 +C52 Italian Game: Evans Gambit, Compromised Defense, Main Line 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. d4 exd4 7. O-O dxc3 8. Qb3 Qf6 9. e5 Qg6 10. Nxc3 Nge7 11. Ba3 +C52 Italian Game: Evans Gambit, Compromised Defense, Potter Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. d4 exd4 7. O-O dxc3 8. Qb3 Qf6 9. e5 Qg6 10. Nxc3 Nge7 11. Rd1 +C52 Italian Game: Evans Gambit, Dufresne Defense 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. d4 exd4 7. O-O d3 +C52 Italian Game: Evans Gambit, Johner Defense 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. d4 exd4 7. O-O b5 +C52 Italian Game: Evans Gambit, Laroche Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. d4 Nf6 +C52 Italian Game: Evans Gambit, Lasker Defense 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. O-O d6 7. d4 Bb6 +C52 Italian Game: Evans Gambit, Leonhardt Countergambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. d4 b5 +C52 Italian Game: Evans Gambit, Levenfish Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. d4 d6 7. Qb3 Qd7 8. dxe5 dxe5 9. O-O Bb6 10. Ba3 Na5 11. Nxe5 +C52 Italian Game: Evans Gambit, Main Line 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 +C52 Italian Game: Evans Gambit, Mieses Defense 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. d4 exd4 7. O-O Nge7 +C52 Italian Game: Evans Gambit, Pierce Defense 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. d4 exd4 +C52 Italian Game: Evans Gambit, Richardson Attack 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. O-O Nf6 7. d4 O-O 8. Nxe5 +C52 Italian Game: Evans Gambit, Sanders-Alapin Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. O-O d6 7. d4 Bd7 +C52 Italian Game: Evans Gambit, Slow Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. O-O +C52 Italian Game: Evans Gambit, Sokolsky Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. d4 d6 7. Bg5 +C52 Italian Game: Evans Gambit, Tartakower Attack 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. d4 d6 7. Qb3 +C52 Italian Game: Evans Gambit, Waller Attack 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5 6. d4 exd4 7. O-O d6 8. Qb3 +C53 Italian Game: Bird's Attack 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. b4 +C53 Italian Game: Classical Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 +C53 Italian Game: Classical Variation, Center Holding Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Qe7 5. d4 Bb6 +C53 Italian Game: Classical Variation, Closed Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Qe7 +C53 Italian Game: Classical Variation, Eisinger Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Qe7 5. d4 Bb6 6. d5 Nb8 7. d6 +C53 Italian Game: Classical Variation, La Bourdonnais Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 d6 5. d4 exd4 6. cxd4 Bb6 +C53 Italian Game: Classical Variation, Mestel Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Qe7 5. d4 Bb6 6. Bg5 +C53 Italian Game: Classical Variation, Tarrasch Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Qe7 5. d4 Bb6 6. O-O d6 7. a4 a6 8. h3 Nf6 9. Re1 +C54 Italian Game: Classical Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 +C54 Italian Game: Classical Variation, Center Attack 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 +C54 Italian Game: Classical Variation, Ghulam-Kassim Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. e5 Ne4 7. Bd5 Nxf2 8. Kxf2 dxc3+ 9. Kg3 +C54 Italian Game: Classical Variation, Giuoco Pianissimo 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d3 +C54 Italian Game: Classical Variation, Giuoco Pianissimo 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d3 d6 +C54 Italian Game: Classical Variation, Giuoco Pianissimo 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d3 d6 6. Nbd2 O-O 7. O-O +C54 Italian Game: Classical Variation, Giuoco Pianissimo 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O Nf6 5. d3 h6 6. c3 +C54 Italian Game: Classical Variation, Giuoco Pianissimo 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O Nf6 5. d3 d6 6. c3 +C54 Italian Game: Classical Variation, Giuoco Pianissimo 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O Nf6 5. d3 d6 6. c3 a5 +C54 Italian Game: Classical Variation, Giuoco Pianissimo 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O Nf6 5. d3 d6 6. c3 a6 +C54 Italian Game: Classical Variation, Giuoco Pianissimo 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O Nf6 5. d3 d6 6. c3 Bb6 +C54 Italian Game: Classical Variation, Giuoco Pianissimo 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O Nf6 5. d3 d6 6. c3 O-O +C54 Italian Game: Classical Variation, Giuoco Pianissimo 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O Nf6 5. d3 d6 6. c3 a6 7. a4 +C54 Italian Game: Classical Variation, Giuoco Pianissimo 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O Nf6 5. d3 d6 6. c3 a6 7. a4 Ba7 +C54 Italian Game: Classical Variation, Giuoco Pianissimo 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O Nf6 5. d3 d6 6. c3 a6 7. a4 O-O +C54 Italian Game: Classical Variation, Giuoco Pianissimo 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O Nf6 5. d3 d6 6. c3 a6 7. Re1 +C54 Italian Game: Classical Variation, Giuoco Pianissimo 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O Nf6 5. d3 d6 6. c3 a6 7. Re1 Ba7 +C54 Italian Game: Classical Variation, Giuoco Pianissimo 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O Nf6 5. d3 d6 6. c3 h6 7. Re1 +C54 Italian Game: Classical Variation, Giuoco Pianissimo 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O Nf6 5. d3 d6 6. c3 h6 7. Nbd2 +C54 Italian Game: Classical Variation, Giuoco Pianissimo 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O Nf6 5. d3 O-O 6. c3 d5 +C54 Italian Game: Classical Variation, Giuoco Pianissimo, Albin Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d3 d6 6. b4 +C54 Italian Game: Classical Variation, Giuoco Pianissimo, Main Line 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d3 d6 6. O-O O-O 7. Re1 a6 8. Bb3 Ba7 9. h3 +C54 Italian Game: Classical Variation, Giuoco Pianissimo, with a4 a5 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d3 d6 6. O-O O-O 7. a4 a5 +C54 Italian Game: Classical Variation, Giuoco Pianissimo, with a5 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O Nf6 5. d3 a5 6. c3 +C54 Italian Game: Classical Variation, Giuoco Pianissimo, with a6 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d3 a6 +C54 Italian Game: Classical Variation, Giuoco Pianissimo, with a6 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d3 d6 6. Nbd2 a6 +C54 Italian Game: Classical Variation, Giuoco Pianissimo, with h6 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O Nf6 5. d3 d6 6. c3 h6 +C54 Italian Game: Classical Variation, Greco Gambit, Anderssen Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. e5 d5 7. Bb5 Ne4 8. cxd4 Bb4+ +C54 Italian Game: Classical Variation, Greco Gambit, Dubov Italian 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. b4 +C54 Italian Game: Classical Variation, Greco Gambit, Greco Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. cxd4 Bb4+ 7. Nc3 Nxe4 8. O-O Nxc3 +C54 Italian Game: Classical Variation, Greco Gambit, Main Line 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. cxd4 Bb4+ 7. Nc3 Nxe4 8. O-O Bxc3 +C54 Italian Game: Classical Variation, Greco Gambit, Modern Line 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. e5 +C54 Italian Game: Classical Variation, Greco Gambit, Modern Line 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. e5 d5 +C54 Italian Game: Classical Variation, Greco Gambit, Moeller-Bayonet Attack 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. cxd4 Bb4+ 7. Nc3 Nxe4 8. O-O Bxc3 9. d5 Bf6 10. Re1 Ne7 11. Rxe4 d6 12. g4 +C54 Italian Game: Classical Variation, Greco Gambit, Moeller-Therkatz Attack 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. cxd4 Bb4+ 7. Nc3 Nxe4 8. O-O Bxc3 9. d5 +C54 Italian Game: Classical Variation, Greco Gambit, Traditional Line 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. cxd4 +C54 Italian Game: Classical Variation, with d5 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d3 d5 +C54 Italian Game: Giuoco Piano, Aitken Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. cxd4 Bb4+ 7. Nc3 Nxe4 8. O-O Nxc3 9. bxc3 Bxc3 10. Ba3 +C54 Italian Game: Giuoco Piano, Bernstein Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. cxd4 Bb4+ 7. Nc3 Nxe4 8. O-O Nxc3 9. bxc3 Bxc3 10. Qb3 d5 +C54 Italian Game: Giuoco Piano, Cracow Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. cxd4 Bb4+ 7. Kf1 +C54 Italian Game: Giuoco Piano, Greco's Attack 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. cxd4 Bb4+ 7. Nc3 +C54 Italian Game: Giuoco Piano, Holzhausen Attack 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. O-O Bc5 5. d4 Bxd4 6. Nxd4 Nxd4 7. Bg5 d6 8. f4 Qe7 9. fxe5 dxe5 10. Nc3 +C54 Italian Game: Giuoco Piano, Krause Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. cxd4 Bb4+ 7. Bd2 Nxe4 8. Bxb4 Nxb4 9. Bxf7+ Kxf7 10. Qb3+ d5 11. Ne5+ Kf6 12. f3 +C54 Italian Game: Giuoco Piano, Rosentreter Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. O-O Bc5 5. d4 Bxd4 6. Nxd4 Nxd4 7. Bg5 h6 8. Bh4 g5 9. f4 +C54 Italian Game: Giuoco Piano, Steinitz Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. cxd4 Bb4+ 7. Nc3 Nxe4 8. O-O Bxc3 9. bxc3 d5 10. Ba3 +C54 Italian Game: Giuoco Piano, Therkatz-Herzog Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. cxd4 Bb4+ 7. Nc3 Nxe4 8. O-O Bxc3 9. d5 Bf6 10. Re1 Ne7 11. Rxe4 d6 12. Bg5 Bxg5 13. Nxg5 O-O 14. Nxh7 +C55 Italian Game: Two Knights Defense 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 +C55 Italian Game: Two Knights Defense 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. O-O Bc5 5. d4 Bxd4 6. Nxd4 Nxd4 7. Bg5 d6 +C55 Italian Game: Two Knights Defense 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Nc3 Nxe4 5. Nxe4 d5 +C55 Italian Game: Two Knights Defense, Modern Bishop's Opening 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. d3 +C55 Italian Game: Two Knights Defense, Modern Bishop's Opening 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. d3 Be7 +C55 Italian Game: Two Knights Defense, Modern Bishop's Opening 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. d3 h6 5. O-O d6 +C56 Italian Game: Scotch Gambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. d4 exd4 5. O-O +C56 Italian Game: Scotch Gambit, Anderssen Attack 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. d4 exd4 5. O-O Nxe4 6. Re1 d5 7. Bxd5 Qxd5 8. Nc3 +C56 Italian Game: Scotch Gambit, Anderssen Attack, Main Line 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. d4 exd4 5. O-O Nxe4 6. Re1 d5 7. Bxd5 Qxd5 8. Nc3 Qa5 9. Nxe4 Be6 10. Bd2 Qd5 11. Bg5 +C56 Italian Game: Scotch Gambit, Canal Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Bc4 Nf6 5. O-O Nxe4 6. Re1 d5 7. Nc3 +C56 Italian Game: Scotch Gambit, Double Gambit Accepted 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. d4 exd4 5. O-O Nxe4 +C56 Italian Game: Scotch Gambit, Janowski Defense 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Bc4 Nf6 5. O-O d6 +C56 Italian Game: Scotch Gambit, Max Lange Attack 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Bc4 Nf6 5. O-O Bc5 +C56 Italian Game: Scotch Gambit, Max Lange Attack 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. d4 exd4 5. e5 d5 6. Bb5 Ne4 +C56 Italian Game: Scotch Gambit, Max Lange Attack Accepted 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O Nf6 5. d4 exd4 6. e5 d5 7. exf6 dxc4 8. Re1+ Be6 9. fxg7 +C56 Italian Game: Scotch Gambit, Max Lange Attack, Long Variation 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Bc4 Nf6 5. O-O Bc5 6. e5 d5 7. exf6 dxc4 8. Re1+ Be6 9. Ng5 Qd5 10. Nc3 Qf5 11. Nce4 +C56 Italian Game: Scotch Gambit, Max Lange Attack, Spielmann Defense 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Bc4 Nf6 5. O-O Bc5 6. e5 Ng4 +C56 Italian Game: Scotch Gambit, Nakhmanson Gambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. d4 exd4 5. O-O Nxe4 6. Nc3 +C56 Italian Game: Scotch Gambit, Walbrodt-Baird Gambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. O-O +C56 Italian Game: Scotch Gambit, de Riviere Defense 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Bc4 Nf6 5. O-O Be7 +C56 Italian Game: Scotch Invitation Declined 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. d4 d6 +C56 Italian Game: Two Knights Defense, Keidansky Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. d4 exd4 5. e5 d5 6. Bb5 Ne4 7. Nxd4 Bc5 8. Nxc6 Bxf2+ 9. Kf1 Qh4 +C56 Italian Game: Two Knights Defense, Max Lange Attack 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Bc4 Nf6 5. O-O Bc5 6. e5 +C56 Italian Game: Two Knights Defense, Max Lange Attack, Berger Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. d4 exd4 5. O-O Bc5 6. e5 d5 7. exf6 dxc4 8. Re1+ Be6 9. Ng5 Qd5 10. Nc3 Qf5 11. g4 Qg6 12. Nce4 Bb6 13. f4 O-O-O +C56 Italian Game: Two Knights Defense, Max Lange Attack, Krause Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. d4 exd4 5. O-O Bc5 6. e5 Ng4 7. c3 +C56 Italian Game: Two Knights Defense, Max Lange Attack, Loman Defense 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Bc4 Bc5 5. O-O Nf6 6. e5 d5 7. exf6 dxc4 8. Re1+ Be6 9. Ng5 g6 +C56 Italian Game: Two Knights Defense, Max Lange Attack, Rubinstein Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. d4 exd4 5. O-O Bc5 6. e5 d5 7. exf6 dxc4 8. Re1+ Be6 9. Ng5 Qd5 10. Nc3 Qf5 11. Nce4 Bf8 +C56 Italian Game: Two Knights Defense, Open Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. d4 +C56 Italian Game: Two Knights Defense, Perreux Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. d4 exd4 5. Ng5 +C56 Italian Game: Two Knights Defense, Yurdansky Attack 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Bc4 Nf6 5. O-O Nxe4 6. Re1 d5 7. Bxd5 Qxd5 8. Nc3 Qa5 9. Nxe4 Be6 10. Bg5 h6 11. Bh4 g5 12. Nf6+ Ke7 13. b4 +C57 Italian Game: Two Knights Defense, Fegatello Attack, Leonhardt Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Nxd5 6. Nxf7 Kxf7 7. Qf3+ Ke6 8. Nc3 Nb4 9. Qe4 c6 10. a3 Na6 11. d4 Nc7 +C57 Italian Game: Two Knights Defense, Fried Liver Attack 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Nxd5 6. Nxf7 +C57 Italian Game: Two Knights Defense, Fritz Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Nd4 +C57 Italian Game: Two Knights Defense, Fritz, Gruber Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Nd4 6. c3 b5 7. Bf1 Nxd5 8. Ne4 +C57 Italian Game: Two Knights Defense, Kloss Gambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Nb4 +C57 Italian Game: Two Knights Defense, Knight Attack 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 +C57 Italian Game: Two Knights Defense, Knight Attack, Normal Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 +C57 Italian Game: Two Knights Defense, Lolli Attack 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Nxd5 6. d4 +C57 Italian Game: Two Knights Defense, Pincus Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Nxd5 6. d4 Bb4+ +C57 Italian Game: Two Knights Defense, Ponziani-Steinitz Gambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 Nxe4 +C57 Italian Game: Two Knights Defense, Traxler Counterattack 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 Bc5 +C57 Italian Game: Two Knights Defense, Traxler Counterattack, Bishop Sacrifice Line 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 Bc5 5. Bxf7+ +C57 Italian Game: Two Knights Defense, Traxler Counterattack, King March Line 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 Bc5 5. Nxf7 Bxf2+ 6. Kxf2 Nxe4+ 7. Ke3 +C57 Italian Game: Two Knights Defense, Traxler Counterattack, Knight Sacrifice Line 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 Bc5 5. Nxf7 +C57 Italian Game: Two Knights Defense, Traxler Variation, Trencianske-Teplice Gambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 Bc5 5. Bxf7+ Ke7 6. d4 +C57 Italian Game: Two Knights Defense, Ulvestad Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 b5 +C57 Italian Game: Two Knights Defense, Ulvestad Variation, Kurkin Gambit 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 b5 6. Bf1 h6 7. Nxf7 +C58 Italian Game: Two Knights Defense 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Na5 6. Bb5+ c6 7. dxc6 bxc6 8. Be2 +C58 Italian Game: Two Knights Defense, Blackburne Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Na5 6. Bb5+ c6 7. dxc6 bxc6 8. Qf3 cxb5 +C58 Italian Game: Two Knights Defense, Colman Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Na5 6. Bb5+ c6 7. dxc6 bxc6 8. Qf3 Rb8 +C58 Italian Game: Two Knights Defense, Maróczy Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Na5 6. d3 h6 7. Nf3 e4 8. Qe2 Nxc4 9. dxc4 Be7 +C58 Italian Game: Two Knights Defense, Paoli Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Na5 6. Bb5+ c6 7. dxc6 bxc6 8. Qf3 Qc7 9. Bd3 +C58 Italian Game: Two Knights Defense, Polerio Defense 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Na5 +C58 Italian Game: Two Knights Defense, Polerio Defense, Bishop Check Line 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Na5 6. Bb5+ +C58 Italian Game: Two Knights Defense, Polerio Defense, Bogoljubow Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Na5 6. Bb5+ c6 7. dxc6 bxc6 8. Qf3 +C58 Italian Game: Two Knights Defense, Polerio Defense, Kieseritzky Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Na5 6. d3 +C58 Italian Game: Two Knights Defense, Polerio Defense, Yankovich Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Na5 6. d3 h6 7. Nf3 e4 8. Qe2 Nxc4 9. dxc4 Bc5 10. Nfd2 +C59 Italian Game: Two Knights Defense, Knorre Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Na5 6. Bb5+ c6 7. dxc6 bxc6 8. Be2 h6 9. Nf3 e4 10. Ne5 Bd6 11. d4 Qc7 12. Bd2 +C59 Italian Game: Two Knights Defense, Polerio Defense, Göring Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Na5 6. Bb5+ c6 7. dxc6 bxc6 8. Be2 h6 9. Nf3 e4 10. Ne5 Qc7 +C59 Italian Game: Two Knights Defense, Polerio Defense, Suhle Defense 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Na5 6. Bb5+ c6 7. dxc6 bxc6 8. Be2 h6 +C59 Italian Game: Two Knights Defense, Steinitz Variation 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Na5 6. Bb5+ c6 7. dxc6 bxc6 8. Be2 h6 9. Nh3 +C60 Ruy Lopez 1. e4 e5 2. Nf3 Nc6 3. Bb5 +C60 Ruy Lopez: Alapin Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 Bb4 +C60 Ruy Lopez: Alapin Defense, Alapin Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 Bb4 4. c3 Ba5 5. Bxc6 dxc6 +C60 Ruy Lopez: Brentano Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 g5 +C60 Ruy Lopez: Bulgarian Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a5 +C60 Ruy Lopez: Cozio Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nge7 +C60 Ruy Lopez: Cozio Defense, Paulsen Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nge7 4. Nc3 g6 +C60 Ruy Lopez: Cozio Defense, Tartakower Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 g6 4. d4 exd4 5. Nxd4 Bg7 6. Be3 Nge7 7. Nc3 O-O 8. Qd2 d5 +C60 Ruy Lopez: Fianchetto Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 g6 +C60 Ruy Lopez: Fianchetto Defense, Kevitz Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 g6 4. c3 f5 +C60 Ruy Lopez: Lucena Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Be7 +C60 Ruy Lopez: Nürnberg Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 f6 +C60 Ruy Lopez: Pollock Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 Na5 +C60 Ruy Lopez: Retreat Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nb8 +C60 Ruy Lopez: Rotary-Albany Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 b6 +C60 Ruy Lopez: Spanish Countergambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 d5 +C60 Ruy Lopez: Spanish Countergambit, Harding Countergambit, Fricke Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 d5 4. Nxe5 Qg5 5. O-O +C60 Ruy Lopez: Spanish Countergambit, Harding Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 d5 4. Nxe5 Qg5 5. Nxc6 +C60 Ruy Lopez: Vinogradov Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Qe7 +C61 Ruy Lopez: Bird Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nd4 +C61 Ruy Lopez: Bird Variation, Paulsen Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nd4 4. Nxd4 exd4 5. O-O Ne7 +C62 Ruy Lopez: Steinitz Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 d6 +C62 Ruy Lopez: Steinitz Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 d6 4. d4 +C62 Ruy Lopez: Steinitz Defense, Center Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 d6 4. d4 exd4 5. O-O +C62 Ruy Lopez: Steinitz Defense, Nimzowitsch Attack 1. e4 e5 2. Nf3 Nc6 3. Bb5 d6 4. d4 Bd7 5. Nc3 Nf6 6. Bxc6 +C62 Ruy Lopez: Steinitz Defense, Semi-Duras Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 d6 4. d4 Bd7 5. c4 +C63 Ruy Lopez: Schliemann Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 f5 +C63 Ruy Lopez: Schliemann Defense, Classical Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 f5 4. Nc3 fxe4 5. Nxe4 d5 6. Nxe5 dxe4 7. Nxc6 Qg5 +C63 Ruy Lopez: Schliemann Defense, Dyckhoff Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 f5 4. Nc3 +C63 Ruy Lopez: Schliemann Defense, Exchange Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 f5 4. Bxc6 +C63 Ruy Lopez: Schliemann Defense, Jaenisch Gambit Accepted 1. e4 e5 2. Nf3 Nc6 3. Bb5 f5 4. exf5 +C63 Ruy Lopez: Schliemann Defense, Kostić Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 f5 4. Nc3 fxe4 5. Nxe4 Be7 +C63 Ruy Lopez: Schliemann Defense, Möhring Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 f5 4. Nc3 fxe4 5. Nxe4 d5 6. Nxe5 dxe4 7. Nxc6 Qd5 +C63 Ruy Lopez: Schliemann Defense, Schönemann Attack 1. e4 e5 2. Nf3 Nc6 3. Bb5 f5 4. d4 +C63 Ruy Lopez: Schliemann Defense, Tartakower Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 f5 4. Nc3 fxe4 5. Nxe4 Nf6 +C64 Ruy Lopez: Classical Defense, Benelux Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Bc5 5. c3 O-O 6. d4 Bb6 +C64 Ruy Lopez: Classical Defense, Boden Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Bc5 4. c3 Qe7 +C64 Ruy Lopez: Classical Defense, Zaitsev Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Bc5 4. O-O Nd4 5. b4 +C64 Ruy Lopez: Classical Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Bc5 +C64 Ruy Lopez: Classical Variation, Central Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Bc5 4. c3 +C64 Ruy Lopez: Classical Variation, Charousek Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Bc5 4. c3 Bb6 +C64 Ruy Lopez: Classical Variation, Cordel Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 Bc5 4. c3 f5 +C64 Ruy Lopez: Classical Variation, Konikowski Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 Bc5 4. c3 d5 +C64 Ruy Lopez: Classical Variation, Modern Main Line 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Bc5 5. c3 O-O 6. d4 Bb6 7. Bg5 +C64 Ruy Lopez: Classical Variation, Spanish Wing Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 Bc5 4. b4 +C65 Ruy Lopez: Berlin Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 +C65 Ruy Lopez: Berlin Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O +C65 Ruy Lopez: Berlin Defense, Anti-Berlin Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. d3 +C65 Ruy Lopez: Berlin Defense, Anti-Berlin Variation, Anderssen Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. d3 d6 5. Bxc6+ +C65 Ruy Lopez: Berlin Defense, Anti-Berlin Variation, Duras Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. d3 d6 5. c4 +C65 Ruy Lopez: Berlin Defense, Anti-Berlin Variation, Kaufmann Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. d3 Bc5 5. Be3 +C65 Ruy Lopez: Berlin Defense, Anti-Berlin Variation, Mortimer Trap 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. d3 Ne7 5. Nxe5 c6 +C65 Ruy Lopez: Berlin Defense, Anti-Berlin Variation, Mortimer Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. d3 Ne7 +C65 Ruy Lopez: Berlin Defense, Beverwijk Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Bc5 +C65 Ruy Lopez: Berlin Defense, Fishing Pole Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Ng4 +C65 Ruy Lopez: Berlin Defense, Nyholm Attack 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. d4 exd4 5. O-O +C65 Ruy Lopez: Classical Variation, Zukertort Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Bc5 5. c3 +C65 Ruy Lopez: Halloween Attack 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. Nxe5 +C66 Ruy Lopez: Berlin Defense, Closed Bernstein Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O d6 5. d4 Bd7 6. Nc3 Be7 7. Bg5 +C66 Ruy Lopez: Berlin Defense, Closed Showalter Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O d6 5. d4 Bd7 6. Nc3 Be7 7. Bxc6 +C66 Ruy Lopez: Berlin Defense, Closed Wolf Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O d6 5. d4 Bd7 6. Nc3 exd4 +C66 Ruy Lopez: Berlin Defense, Hedgehog Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O d6 5. d4 Bd7 6. Nc3 Be7 +C66 Ruy Lopez: Berlin Defense, Improved Steinitz Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O d6 +C66 Ruy Lopez: Berlin Defense, Tarrasch Trap 1. e4 e5 2. Nf3 Nc6 3. Bb5 d6 4. d4 Bd7 5. Nc3 Nf6 6. O-O Be7 7. Re1 O-O +C66 Ruy Lopez: Closed Berlin Defense, Chigorin Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O d6 5. d4 Nd7 +C67 Ruy Lopez: Berlin Defense, Berlin Wall 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4 5. d4 Nd6 6. Bxc6 dxc6 7. dxe5 Nf5 8. Qxd8+ Kxd8 9. Nc3 Bd7 +C67 Ruy Lopez: Berlin Defense, Cordel Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4 5. d4 Be7 6. Qe2 Nd6 7. Bxc6 bxc6 8. dxe5 Nf5 +C67 Ruy Lopez: Berlin Defense, Minckwitz Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4 5. d4 Be7 6. dxe5 +C67 Ruy Lopez: Berlin Defense, Pillsbury Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4 5. d4 Be7 6. Qe2 Nd6 7. Bxc6 bxc6 8. dxe5 Nb7 9. b3 +C67 Ruy Lopez: Berlin Defense, Rio Gambit Accepted 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4 +C67 Ruy Lopez: Berlin Defense, Rio de Janeiro Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4 5. d4 Be7 +C67 Ruy Lopez: Berlin Defense, Rio de Janeiro Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4 5. d4 Be7 6. Qe2 Nd6 7. Bxc6 bxc6 8. dxe5 Nb7 9. Nc3 O-O 10. Re1 Nc5 11. Nd4 Ne6 12. Be3 Nxd4 13. Bxd4 c5 +C67 Ruy Lopez: Berlin Defense, Rosenthal Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4 5. d4 a6 +C67 Ruy Lopez: Berlin Defense, Trifunovic Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4 5. d4 Be7 6. Qe2 d5 +C67 Ruy Lopez: Berlin Defense, Winawer Attack 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4 5. d4 Be7 6. Qe2 Nd6 7. Bxc6 bxc6 8. dxe5 Nb7 9. Nd4 +C67 Ruy Lopez: Berlin Defense, Zukertort Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4 5. d4 Be7 6. Qe2 Nd6 7. Bxc6 bxc6 8. dxe5 Nb7 9. c4 +C67 Ruy Lopez: Berlin Defense, l'Hermet Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4 5. d4 Nd6 +C67 Ruy Lopez: Berlin Defense, l'Hermet Variation, Berlin Wall Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4 5. d4 Nd6 6. Bxc6 dxc6 7. dxe5 Nf5 8. Qxd8+ Kxd8 +C67 Ruy Lopez: Berlin Defense, l'Hermet Variation, Westerinen Line 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4 5. d4 Nd6 6. Bxc6 dxc6 7. dxe5 Ne4 +C67 Ruy Lopez: Open Berlin Defense, Showalter Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4 5. d4 Nd6 6. Ba4 +C67 Ruy Lopez: Open Berlin Defense, l'Hermet Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4 5. d4 Nd6 6. dxe5 +C68 Ruy Lopez: Exchange Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Bxc6 +C68 Ruy Lopez: Exchange Variation, Alekhine Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Bxc6 dxc6 5. d4 exd4 6. Qxd4 Qxd4 7. Nxd4 Bd6 +C68 Ruy Lopez: Exchange Variation, Keres Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Bxc6 dxc6 5. Nc3 +C68 Ruy Lopez: Exchange Variation, Lutikov Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Bxc6 bxc6 +C68 Ruy Lopez: Exchange Variation, Romanovsky Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Bxc6 dxc6 5. Nc3 f6 6. d3 +C68 Ruy Lopez: Exchange, Alekhine Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Bxc6 dxc6 5. d4 exd4 6. Qxd4 Qxd4 7. Nxd4 Bd7 +C69 Ruy Lopez: Exchange Variation, Alapin Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Bxc6 dxc6 5. O-O Bg4 6. h3 h5 +C69 Ruy Lopez: Exchange Variation, Bronstein Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Bxc6 dxc6 5. O-O Qd6 +C69 Ruy Lopez: Exchange Variation, Gligoric Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Bxc6 dxc6 5. O-O f6 +C69 Ruy Lopez: Exchange Variation, King's Bishop Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Bxc6 dxc6 5. O-O Bd6 +C69 Ruy Lopez: Exchange Variation, Normal Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Bxc6 dxc6 5. O-O +C70 Ruy Lopez: Bird's Defense Deferred 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nd4 +C70 Ruy Lopez: Morphy Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 +C70 Ruy Lopez: Morphy Defense, Alapin's Defense Deferred 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Bb4 +C70 Ruy Lopez: Morphy Defense, Caro Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 b5 +C70 Ruy Lopez: Morphy Defense, Classical Defense Deferred 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Bc5 +C70 Ruy Lopez: Morphy Defense, Cozio Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nge7 +C70 Ruy Lopez: Morphy Defense, Fianchetto Defense Deferred 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 g6 +C70 Ruy Lopez: Morphy Defense, Graz Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 b5 5. Bb3 Bc5 +C70 Ruy Lopez: Morphy Defense, Norwegian Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 b5 5. Bb3 Na5 +C70 Ruy Lopez: Morphy Defense, Norwegian Variation, Nightingale Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 b5 5. Bb3 Na5 6. Bxf7+ +C70 Ruy Lopez: Morphy Defense, Schliemann Defense Deferred 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 f5 +C70 Ruy Lopez: Morphy Defense, Schliemann Defense Deferred, Jaenisch Gambit Deferred 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 f5 5. exf5 +C71 Ruy Lopez: Morphy Defense, Modern Steinitz Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 d6 +C71 Ruy Lopez: Morphy Defense, Modern Steinitz Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 d6 5. Nc3 +C71 Ruy Lopez: Morphy Defense, Modern Steinitz Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 d6 5. c4 +C71 Ruy Lopez: Noah's Ark Trap 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 b5 5. Bb3 d6 6. d4 Nxd4 7. Nxd4 exd4 8. Qxd4 c5 +C72 Ruy Lopez: Closed, Kecskemet Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 d6 5. O-O Bd7 6. c3 Nf6 7. d4 Be7 8. Nbd2 O-O 9. Re1 Be8 +C72 Ruy Lopez: Morphy Defense, Modern Steinitz Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 d6 5. O-O +C73 Ruy Lopez: Morphy Defense, Modern Steinitz Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 d6 5. Bxc6+ bxc6 6. d4 +C73 Ruy Lopez: Morphy Defense, Modern Steinitz Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 d6 5. Bxc6+ bxc6 6. d4 f6 +C74 Ruy Lopez: Morphy Defense, Modern Steinitz Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 d6 5. c3 +C74 Ruy Lopez: Morphy Defense, Modern Steinitz Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 d6 5. c3 f5 6. exf5 Bxf5 7. O-O +C74 Ruy Lopez: Morphy Defense, Modern Steinitz Defense, Siesta Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 d6 5. c3 f5 +C75 Ruy Lopez: Morphy Defense, Modern Steinitz Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 d6 5. c3 Bd7 +C75 Ruy Lopez: Morphy Defense, Modern Steinitz Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 d6 5. c3 Bd7 6. d4 Nge7 +C76 Ruy Lopez: Morphy Defense, Modern Steinitz Defense, Fianchetto Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 g6 4. c3 a6 5. Ba4 d6 6. d4 Bd7 +C77 Ruy Lopez: Morphy Defense, Anderssen Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. d3 +C77 Ruy Lopez: Morphy Defense, Bayreuth Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. Bxc6 +C77 Ruy Lopez: Morphy Defense, Duras Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. d3 d6 6. c4 +C77 Ruy Lopez: Morphy Defense, Jaffe Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. c3 +C77 Ruy Lopez: Morphy Defense, Mackenzie Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. d4 +C77 Ruy Lopez: Morphy Defense, Tarrasch Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. Nc3 +C77 Ruy Lopez: Morphy Defense, Wormald Attack 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. Qe2 +C77 Ruy Lopez: Wormald Attack, Grünfeld Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. Qe2 b5 6. Bb3 Be7 7. d4 d6 8. c3 Bg4 +C78 Ruy Lopez: Brix Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O g6 +C78 Ruy Lopez: Central Countergambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O d5 +C78 Ruy Lopez: Morphy Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O +C78 Ruy Lopez: Morphy Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O b5 6. Bb3 d6 +C78 Ruy Lopez: Morphy Defense, Arkhangelsk Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O b5 6. Bb3 Bb7 +C78 Ruy Lopez: Morphy Defense, Møller Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Bc5 +C78 Ruy Lopez: Morphy Defense, Neo-Arkhangelsk Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O b5 6. Bb3 Bc5 +C78 Ruy Lopez: Morphy Defense, Wing Attack 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O b5 6. Bb3 Be7 7. a4 +C78 Ruy Lopez: Rabinovich Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O b5 6. Bb3 d6 7. Ng5 d5 8. exd5 Nd4 9. Re1 Bc5 10. Rxe5+ Kf8 +C79 Ruy Lopez: Morphy Defense, Steinitz Deferred 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O d6 +C79 Ruy Lopez: Morphy Defense, Steinitz Deferred 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O d6 6. Bxc6+ bxc6 7. d4 Nxe4 +C79 Ruy Lopez: Steinitz Defense Deferred, Boleslavsky Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O d6 6. Bxc6+ bxc6 7. d4 Nxe4 8. Re1 f5 9. dxe5 d5 10. Nc3 +C79 Ruy Lopez: Steinitz Defense Deferred, Lipnitsky Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O d6 6. Bxc6+ bxc6 7. d4 Bg4 +C80 Ruy Lopez: Morphy Defense, Tartakower Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. Qe2 +C80 Ruy Lopez: Open 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 +C80 Ruy Lopez: Open 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 +C80 Ruy Lopez: Open 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 +C80 Ruy Lopez: Open 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. dxe5 +C80 Ruy Lopez: Open, Berger Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. a4 Nxd4 9. Nxd4 exd4 10. Nc3 +C80 Ruy Lopez: Open, Bernstein Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. dxe5 Be6 9. Nbd2 +C80 Ruy Lopez: Open, Bernstein Variation, Luther Line 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. dxe5 Be6 9. Nbd2 Bc5 10. Qe1 +C80 Ruy Lopez: Open, Friess Attack 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Nxe5 +C80 Ruy Lopez: Open, Harksen Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. c4 +C80 Ruy Lopez: Open, Karpov Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. dxe5 Be6 9. Nbd2 Nc5 10. c3 d4 11. Ng5 +C80 Ruy Lopez: Open, Knorre Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. Nc3 +C80 Ruy Lopez: Open, Main Line 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. dxe5 Be6 +C80 Ruy Lopez: Open, Richter Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. d5 +C80 Ruy Lopez: Open, Riga Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 exd4 +C80 Ruy Lopez: Open, Schlechter Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. a4 Nxd4 +C80 Ruy Lopez: Open, Skipworth Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. Re1 d5 +C80 Ruy Lopez: Open, Zukertort Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. dxe5 Ne7 +C81 Ruy Lopez: Open, Howell Attack 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. dxe5 Be6 9. Qe2 +C81 Ruy Lopez: Open, Howell Attack 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. dxe5 Be6 9. Qe2 Be7 10. c4 +C81 Ruy Lopez: Open, Howell Attack, Ekstrom Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. dxe5 Be6 9. Qe2 Be7 10. Rd1 O-O 11. c4 bxc4 12. Bxc4 Qd7 +C82 Ruy Lopez: Open 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. dxe5 Be6 9. c3 +C82 Ruy Lopez: Open, Berlin Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. dxe5 Be6 9. c3 Nc5 +C82 Ruy Lopez: Open, Dilworth Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. dxe5 Be6 9. c3 Bc5 10. Nbd2 O-O 11. Bc2 Nxf2 +C82 Ruy Lopez: Open, Italian Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. dxe5 Be6 9. c3 Bc5 +C82 Ruy Lopez: Open, Motzko Attack 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. dxe5 Be6 9. c3 Bc5 10. Qd3 +C82 Ruy Lopez: Open, Motzko Attack, Nenarokov Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. dxe5 Be6 9. c3 Bc5 10. Qd3 Ne7 +C82 Ruy Lopez: Open, St. Petersburg Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. dxe5 Be6 9. c3 Bc5 10. Nbd2 +C83 Ruy Lopez: Open, Breslau Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. dxe5 Be6 9. c3 Be7 10. Re1 O-O 11. Nd4 Nxe5 +C83 Ruy Lopez: Open, Classical Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. dxe5 Be6 9. c3 Be7 +C83 Ruy Lopez: Open, Classical Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. dxe5 Be6 9. Nbd2 Nc5 10. c3 Be7 +C83 Ruy Lopez: Open, Classical Defense, Main Line 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 Be7 7. Re1 b5 8. Bb3 d5 9. dxe5 Be6 10. c3 +C83 Ruy Lopez: Open, Malkin Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. dxe5 Be6 9. c3 Be7 10. Nbd2 O-O 11. Qe2 +C83 Ruy Lopez: Open, Tarrasch Trap 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Nxe4 6. d4 b5 7. Bb3 d5 8. dxe5 Be6 9. c3 Be7 10. Re1 O-O 11. Nd4 Qd7 12. Nxe6 fxe6 13. Rxe4 +C84 Ruy Lopez: Closed 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 +C84 Ruy Lopez: Closed, Basque Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. d4 exd4 7. e5 Ne4 8. c3 +C84 Ruy Lopez: Closed, Center Attack 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. d4 +C84 Ruy Lopez: Closed, Center Attack, Basque Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. d4 exd4 7. e5 Ne4 8. c3 dxc3 +C84 Ruy Lopez: Closed, Martinez Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. d3 +C84 Ruy Lopez: Closed, Morphy Attack 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Nc3 +C85 Ruy Lopez: Closed, Delayed Exchange 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Bxc6 +C86 Ruy Lopez: Closed, Worrall Attack 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Qe2 +C86 Ruy Lopez: Closed, Worrall Attack, Castling Line 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Qe2 b5 7. Bb3 O-O +C86 Ruy Lopez: Closed, Worrall Attack, Castling Line 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. Qe2 Be7 6. O-O b5 7. Bb3 O-O 8. c3 d5 9. d3 +C86 Ruy Lopez: Closed, Worrall Attack, Delayed Castling Line 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Qe2 b5 7. Bb3 d6 +C87 Ruy Lopez: Closed, Averbakh Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 d6 +C88 Ruy Lopez: Closed 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 +C88 Ruy Lopez: Closed 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 O-O +C88 Ruy Lopez: Closed, Alekhine Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 Na5 9. Bc2 c5 10. d4 Qc7 11. Nbd2 O-O 12. Nf1 Bg4 13. Ne3 Bxf3 14. Qxf3 +C88 Ruy Lopez: Closed, Anti-Marshall 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 O-O 8. a4 +C88 Ruy Lopez: Closed, Balla Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 Na5 9. Bc2 c5 10. d4 Qc7 11. a4 +C88 Ruy Lopez: Closed, Leonhardt Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 Na5 9. Bc2 c5 10. d4 Qc7 11. h3 Nc6 12. d5 Nb8 13. Nbd2 g5 +C88 Ruy Lopez: Closed, Rosen Attack 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. d4 +C88 Ruy Lopez: Closed, Trajkovic Counterattack 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 Bb7 +C88 Ruy Lopez: Noah's Ark Trap 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. d4 Nxd4 9. Nxd4 exd4 10. Qxd4 c5 +C89 Ruy Lopez: Marshall Attack 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 O-O 8. c3 d5 +C89 Ruy Lopez: Marshall Attack 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 O-O 8. c3 d5 9. exd5 Nxd5 10. a4 Bb7 +C89 Ruy Lopez: Marshall Attack, Main Line 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 O-O 8. c3 d5 9. exd5 Nxd5 10. Nxe5 Nxe5 11. Rxe5 c6 12. d4 +C89 Ruy Lopez: Marshall Attack, Main Line, Spassky Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 O-O 8. c3 d5 9. exd5 Nxd5 10. Nxe5 Nxe5 11. Rxe5 c6 12. d4 Bd6 13. Re1 Qh4 14. g3 Qh3 15. Be3 Bg4 16. Qd3 Rae8 17. Nd2 Re6 18. a4 Qh5 +C89 Ruy Lopez: Marshall Attack, Modern Main Line 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 O-O 8. c3 d5 9. exd5 Nxd5 10. Nxe5 Nxe5 11. Rxe5 c6 12. d4 Bd6 13. Re1 Qh4 14. g3 Qh3 +C89 Ruy Lopez: Marshall Attack, Modern Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 O-O 8. c3 d5 9. exd5 Nxd5 10. Nxe5 Nxe5 11. Rxe5 c6 +C89 Ruy Lopez: Marshall Attack, Original Marshall Attack 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 O-O 8. c3 d5 9. exd5 Nxd5 10. Nxe5 Nxe5 11. Rxe5 Nf6 +C89 Ruy Lopez: Marshall Attack, Re3 Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 O-O 8. c3 d5 9. exd5 Nxd5 10. Nxe5 Nxe5 11. Rxe5 c6 12. Bxd5 cxd5 13. d4 Bd6 14. Re3 +C89 Ruy Lopez: Marshall Attack, Steiner Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 O-O 8. c3 d5 9. exd5 e4 +C90 Ruy Lopez: Closed 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O +C90 Ruy Lopez: Closed, Lutikov Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. Bc2 +C90 Ruy Lopez: Closed, Pilnik Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 O-O 8. d3 d6 9. c3 +C90 Ruy Lopez: Closed, Suetin Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. a3 +C91 Ruy Lopez: Closed, Bogoljubow Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. d4 Bg4 +C91 Ruy Lopez: Closed, Yates Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. d4 +C91 Ruy Lopez: Closed, Yates Variation, Short Attack 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. d4 Bg4 10. a4 +C92 Ruy Lopez: Closed 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 +C92 Ruy Lopez: Closed, Flohr System 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Bb7 +C92 Ruy Lopez: Closed, Karpov Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Nd7 +C92 Ruy Lopez: Closed, Kholmov Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Be6 +C92 Ruy Lopez: Closed, Smyslov-Breyer-Zaitsev Hybrid 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Bb7 10. d4 Re8 11. Nbd2 Bf8 12. a3 h6 +C92 Ruy Lopez: Closed, Zaitsev System 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Re8 +C93 Ruy Lopez: Closed, Smyslov Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 h6 +C94 Ruy Lopez: Closed, Breyer Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Nb8 +C94 Ruy Lopez: Closed, Breyer Defense, Quiet Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Nb8 10. d3 +C95 Ruy Lopez: Closed, Breyer 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Nb8 10. d4 +C95 Ruy Lopez: Closed, Breyer Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Nb8 10. d4 Nbd7 11. Nbd2 Bb7 12. Bc2 c5 +C95 Ruy Lopez: Closed, Breyer Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Nb8 10. d4 Nbd7 11. Nh4 +C95 Ruy Lopez: Closed, Breyer Defense, Zaitsev Hybrid 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Nb8 10. d4 Nbd7 +C96 Ruy Lopez: Closed, Borisenko Variation 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Na5 10. Bc2 c5 11. d4 Nc6 +C96 Ruy Lopez: Closed, Chigorin Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Na5 10. Bc2 +C96 Ruy Lopez: Closed, Chigorin Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Na5 10. Bc2 c5 +C96 Ruy Lopez: Closed, Chigorin Defense, Gajewski Gambit 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Na5 10. Bc2 d5 +C96 Ruy Lopez: Closed, Keres Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Na5 10. Bc2 c5 11. d4 Nd7 +C96 Ruy Lopez: Closed, Rossolimo Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Na5 10. Bc2 c6 11. d4 Qc7 +C97 Ruy Lopez: Closed, Chigorin Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Na5 +C97 Ruy Lopez: Closed, Chigorin Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Na5 10. Bc2 c5 11. d4 Qc7 +C97 Ruy Lopez: Closed, Chigorin, Yugoslav System 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Na5 10. Bc2 c5 11. d4 Qc7 12. Nbd2 Bd7 13. Nf1 Rfe8 14. Ne3 g6 +C98 Ruy Lopez: Closed, Chigorin Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Na5 10. Bc2 c5 11. d4 Qc7 12. Nbd2 Nc6 +C98 Ruy Lopez: Closed, Chigorin Defense 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Na5 10. Bc2 c5 11. d4 Qc7 12. Nbd2 Nc6 13. dxc5 +C99 Ruy Lopez: Closed, Chigorin Defense, Panov System 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Na5 10. Bc2 c5 11. d4 Qc7 12. Nbd2 cxd4 13. cxd4 diff --git a/crates/prep/data/d.tsv b/crates/prep/data/d.tsv new file mode 100644 index 0000000..a829bac --- /dev/null +++ b/crates/prep/data/d.tsv @@ -0,0 +1,645 @@ +eco name pgn +D00 Amazon Attack 1. d4 d5 2. Qd3 +D00 Blackmar-Diemer Gambit 1. d4 d5 2. e4 +D00 Blackmar-Diemer Gambit 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 +D00 Blackmar-Diemer Gambit Accepted 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 +D00 Blackmar-Diemer Gambit Accepted: Bogoljubow Defense 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 5. Nxf3 g6 +D00 Blackmar-Diemer Gambit Accepted: Bogoljubow Defense, Kloss Attack 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 5. Nxf3 g6 6. Bc4 Bg7 7. O-O O-O 8. Kh1 +D00 Blackmar-Diemer Gambit Accepted: Bogoljubow Defense, Mad Dog Attack 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 5. Nxf3 g6 6. Bc4 Bg7 7. h4 +D00 Blackmar-Diemer Gambit Accepted: Bogoljubow Defense, Nimzowitsch Attack 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 5. Nxf3 g6 6. Bc4 Bg7 7. Ne5 +D00 Blackmar-Diemer Gambit Accepted: Bogoljubow Defense, Studier Attack 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 5. Nxf3 g6 6. Bc4 Bg7 7. O-O O-O 8. Qe1 +D00 Blackmar-Diemer Gambit Accepted: Euwe Defense 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 5. Nxf3 e6 +D00 Blackmar-Diemer Gambit Accepted: Euwe Defense, Duthilleul Gambit 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 5. Nxf3 e6 6. Bd3 +D00 Blackmar-Diemer Gambit Accepted: Euwe Defense, Zilbermints Gambit 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 5. Nxf3 e6 6. Bg5 Be7 7. Bd3 Nc6 8. O-O Nxd4 9. Kh1 +D00 Blackmar-Diemer Gambit Accepted: Gunderam Defense 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 5. Nxf3 Bf5 +D00 Blackmar-Diemer Gambit Accepted: Gunderam Defense, Stader Variation 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 5. Nxf3 Bf5 6. Ne5 e6 7. g4 Be4 +D00 Blackmar-Diemer Gambit Accepted: Holwell Defense 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 5. Nxf3 Qd6 +D00 Blackmar-Diemer Gambit Accepted: Kaulich Defense 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 5. Nxf3 c5 +D00 Blackmar-Diemer Gambit Accepted: Pietrowsky Defense 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 5. Nxf3 Nc6 +D00 Blackmar-Diemer Gambit Accepted: Ritter Defense 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 5. Nxf3 b6 +D00 Blackmar-Diemer Gambit Accepted: Ryder Gambit 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 5. Qxf3 +D00 Blackmar-Diemer Gambit Accepted: Schlutter Defense 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 5. Nxf3 Nbd7 +D00 Blackmar-Diemer Gambit Accepted: Teichmann Defense 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 5. Nxf3 Bg4 +D00 Blackmar-Diemer Gambit Accepted: Teichmann Defense, Ciesielski Variation 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 5. Nxf3 Bg4 6. h3 Bxf3 7. Qxf3 c6 8. Qf2 +D00 Blackmar-Diemer Gambit Accepted: Teichmann Defense, Classical Variation 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 5. Nxf3 Bg4 6. h3 Bxf3 7. Qxf3 c6 8. Be3 +D00 Blackmar-Diemer Gambit Accepted: Teichmann Defense, Seidel-Hall Attack 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 5. Nxf3 Bg4 6. h3 Bxf3 7. Qxf3 c6 8. g4 +D00 Blackmar-Diemer Gambit Accepted: Ziegler Defense 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 exf3 5. Nxf3 c6 +D00 Blackmar-Diemer Gambit Declined: Brombacher Countergambit 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 c5 +D00 Blackmar-Diemer Gambit Declined: Elbert Countergambit 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 e5 +D00 Blackmar-Diemer Gambit Declined: Gedult Defense 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 a6 +D00 Blackmar-Diemer Gambit Declined: Lamb Defense 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 Nc6 +D00 Blackmar-Diemer Gambit Declined: Langeheinicke Defense 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 e3 +D00 Blackmar-Diemer Gambit Declined: O'Kelly Defense 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 c6 +D00 Blackmar-Diemer Gambit Declined: Vienna Defense 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 Bf5 +D00 Blackmar-Diemer Gambit Declined: Weinsbach Defense 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 e6 +D00 Blackmar-Diemer Gambit Declined: Weinsbach Defense, Pfrang Gambit 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. f3 e6 5. fxe4 +D00 Blackmar-Diemer Gambit: Blackmar Gambit 1. d4 d5 2. e4 dxe4 3. f3 +D00 Blackmar-Diemer Gambit: Diemer-Rosenberg Attack 1. d4 d5 2. e4 dxe4 3. Be3 +D00 Blackmar-Diemer Gambit: Fritz Attack 1. d4 d5 2. e4 dxe4 3. Bc4 +D00 Blackmar-Diemer Gambit: Lemberger Countergambit 1. d4 d5 2. e4 dxe4 3. Nc3 e5 +D00 Blackmar-Diemer Gambit: Lemberger Countergambit, Endgame Variation 1. d4 d5 2. e4 dxe4 3. Nc3 e5 4. dxe5 +D00 Blackmar-Diemer Gambit: Lemberger Countergambit, Lange Gambit 1. d4 d5 2. e4 dxe4 3. Nc3 e5 4. Nxe4 +D00 Blackmar-Diemer Gambit: Lemberger Countergambit, Rasmussen Attack 1. d4 d5 2. e4 dxe4 3. Nc3 e5 4. Nge2 +D00 Blackmar-Diemer Gambit: Lemberger Countergambit, Sneiders Attack 1. d4 d5 2. e4 dxe4 3. Nc3 e5 4. Qh5 +D00 Blackmar-Diemer Gambit: Lemberger Countergambit, Soller Attack 1. d4 d5 2. e4 dxe4 3. Nc3 e5 4. Be3 +D00 Blackmar-Diemer Gambit: Netherlands Variation 1. d4 d5 2. e4 dxe4 3. Nc3 f5 +D00 Blackmar-Diemer Gambit: Rasa-Studier Gambit 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. Be3 +D00 Blackmar-Diemer Gambit: Reversed Albin Countergambit 1. d4 d5 2. e4 dxe4 3. Nc3 c5 +D00 Blackmar-Diemer Gambit: Zeller Defense 1. d4 d5 2. e4 dxe4 3. Nc3 Bf5 +D00 Blackmar-Diemer Gambit: Zeller Defense, Soller Attack 1. d4 d5 2. e4 dxe4 3. Nc3 Bf5 4. f3 Nf6 5. Bc4 +D00 Blackmar-Diemer Gambit: von Popiel Gambit 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. Bg5 +D00 Blackmar-Diemer Gambit: von Popiel Gambit, Zilbermints Variation 1. d4 d5 2. e4 dxe4 3. Nc3 Nf6 4. Bg5 Bf5 5. Bxf6 exf6 6. g4 Bg6 7. Qe2 Bb4 8. Qb5+ +D00 Queen's Pawn Game 1. d4 d5 +D00 Queen's Pawn Game 1. d4 d5 2. e3 +D00 Queen's Pawn Game 1. d4 d5 2. e3 Nf6 +D00 Queen's Pawn Game: Accelerated London System 1. d4 d5 2. Bf4 +D00 Queen's Pawn Game: Accelerated London System, Steinitz Countergambit 1. d4 d5 2. Bf4 c5 +D00 Queen's Pawn Game: Accelerated London System, Steinitz Countergambit Accepted 1. d4 d5 2. Bf4 c5 3. dxc5 +D00 Queen's Pawn Game: Accelerated London System, Steinitz Countergambit, Morris Countergambit 1. d4 d5 2. Bf4 c5 3. e4 +D00 Queen's Pawn Game: Accelerated London System, Steinitz Countergambit, Morris Countergambit Accepted 1. d4 d5 2. Bf4 c5 3. e4 dxe4 +D00 Queen's Pawn Game: Chigorin Variation 1. d4 d5 2. Nc3 +D00 Queen's Pawn Game: Chigorin Variation 1. d4 d5 2. Nc3 e6 +D00 Queen's Pawn Game: Chigorin Variation, Alburt Defense 1. d4 d5 2. Nc3 Bf5 +D00 Queen's Pawn Game: Chigorin Variation, Anti-Veresov 1. d4 d5 2. Nc3 Bg4 +D00 Queen's Pawn Game: Chigorin Variation, Fianchetto Defense 1. d4 g6 2. Nf3 Bg7 3. Nc3 d5 +D00 Queen's Pawn Game: Chigorin Variation, Irish Gambit 1. d4 d5 2. Nc3 c5 +D00 Queen's Pawn Game: Chigorin Variation, Shaviliuk Gambit 1. d4 d5 2. Nc3 e5 +D00 Queen's Pawn Game: Chigorin Variation, Shropshire Defense 1. d4 d5 2. Nc3 h5 +D00 Queen's Pawn Game: Hübsch Gambit 1. d4 Nf6 2. Nc3 d5 3. e4 +D00 Queen's Pawn Game: Levitsky Attack 1. d4 d5 2. Bg5 +D00 Queen's Pawn Game: Levitsky Attack, Welling Variation 1. d4 d5 2. Bg5 Bg4 +D00 Queen's Pawn Game: Mason Attack 1. d4 d5 2. f4 +D00 Queen's Pawn Game: Stonewall Attack 1. d4 d5 2. e3 Nf6 3. Bd3 +D00 Queen's Pawn Game: Zurich Gambit 1. d4 d5 2. g4 +D01 Rapport-Jobava System 1. d4 d5 2. Nc3 Nf6 3. Bf4 +D01 Rapport-Jobava System 1. d4 d5 2. Nc3 Nf6 3. Bf4 e6 +D01 Rapport-Jobava System 1. d4 d5 2. Nc3 Nf6 3. Bf4 g6 +D01 Rapport-Jobava System, with e6 1. d4 d5 2. Nc3 e6 3. Bf4 +D01 Richter-Veresov Attack 1. d4 Nf6 2. Nc3 d5 3. Bg5 +D01 Richter-Veresov Attack 1. d4 Nf6 2. Nc3 d5 3. Bg5 Bf5 +D01 Richter-Veresov Attack: Boyce Defense 1. d4 Nf6 2. Nc3 d5 3. Bg5 Ne4 +D01 Richter-Veresov Attack: Malich Gambit 1. d4 Nf6 2. Nc3 d5 3. Bg5 c5 4. Bxf6 gxf6 5. e4 dxe4 6. d5 +D01 Richter-Veresov Attack: Richter Variation 1. d4 Nf6 2. Nc3 d5 3. Bg5 Bf5 4. f3 +D01 Richter-Veresov Attack: Two Knights System 1. d4 Nf6 2. Nc3 d5 3. Bg5 Nbd7 4. Nf3 +D01 Richter-Veresov Attack: Two Knights System, Grünfeld Defense 1. d4 Nf6 2. Nc3 d5 3. Bg5 Nbd7 4. Nf3 g6 +D01 Richter-Veresov Attack: Veresov Variation 1. d4 Nf6 2. Nc3 d5 3. Bg5 Bf5 4. Bxf6 +D02 London System: Poisoned Pawn Variation 1. d4 Nf6 2. Nf3 d5 3. Bf4 c5 4. e3 Qb6 5. Nc3 +D02 Queen's Gambit Declined: Baltic Defense, Pseudo-Slav 1. d4 d5 2. Nf3 Bf5 3. c4 e6 4. Nc3 c6 +D02 Queen's Pawn Game: Anti-Torre 1. Nf3 d5 2. d4 Bg4 +D02 Queen's Pawn Game: Chandler Gambit 1. d4 d5 2. Nf3 c5 3. g3 cxd4 4. Bg2 +D02 Queen's Pawn Game: Chigorin Variation 1. d4 d5 2. Nf3 Nc6 +D02 Queen's Pawn Game: Krause Variation 1. d4 d5 2. Nf3 c5 +D02 Queen's Pawn Game: Levitsky Attack, Euwe Variation, Modern Line 1. d4 d5 2. Nf3 c6 3. Bg5 h6 4. Bh4 Qb6 +D02 Queen's Pawn Game: London System 1. d4 d5 2. Nf3 Nf6 3. Bf4 +D02 Queen's Pawn Game: London System 1. d4 d5 2. Nf3 Nf6 3. Bf4 c5 4. e3 +D02 Queen's Pawn Game: London System 1. d4 d5 2. Nf3 Nf6 3. Bf4 c5 4. e3 Nc6 5. Nbd2 +D02 Queen's Pawn Game: London System 1. d4 d5 2. Nf3 Nf6 3. Bf4 c5 4. e3 Nc6 5. Nbd2 e6 6. c3 +D02 Queen's Pawn Game: London System, Pterodactyl Variation 1. d4 g6 2. Nf3 Bg7 3. Bf4 c5 4. c3 cxd4 5. cxd4 Qa5+ +D02 Queen's Pawn Game: London System, with e6 1. d4 d5 2. Nf3 e6 3. Bf4 +D02 Queen's Pawn Game: London System, with e6 1. d4 d5 2. Nf3 e6 3. Bf4 Nf6 +D02 Queen's Pawn Game: Symmetrical Variation 1. d4 d5 2. Nf3 Nf6 +D02 Queen's Pawn Game: Symmetrical Variation, Pseudo-Catalan 1. d4 d5 2. Nf3 Nf6 3. g3 +D02 Queen's Pawn Game: Symmetrical Variation, Pseudo-Catalan 1. d4 d5 2. Nf3 Nf6 3. g3 c6 4. Bg2 Bg4 +D02 Queen's Pawn Game: Symmetrical Variation, Pseudo-Catalan 1. Nf3 d5 2. g3 c6 3. Bg2 Nf6 4. O-O Bg4 5. d4 e6 +D02 Queen's Pawn Game: Zilbermints Countergambit 1. d4 d5 2. Nf3 Nf6 3. c4 b5 +D02 Queen's Pawn Game: Zukertort Variation 1. d4 d5 2. Nf3 +D03 Queen's Pawn Game: Torre Attack 1. d4 d5 2. Nf3 Nf6 3. Bg5 +D03 Queen's Pawn Game: Torre Attack 1. d4 d5 2. Nf3 Nf6 3. Bg5 e6 4. e3 c5 5. Nbd2 +D03 Queen's Pawn Game: Torre Attack 1. d4 d5 2. Nf3 Nf6 3. Bg5 e6 4. e3 c5 5. Nbd2 Nc6 6. c3 +D03 Queen's Pawn Game: Torre Attack 1. d4 d5 2. Nf3 Nf6 3. Bg5 e6 4. e3 c5 5. c3 Nbd7 +D03 Queen's Pawn Game: Torre Attack 1. d4 d5 2. Nf3 Nf6 3. Bg5 e6 4. e3 c5 5. c3 Nbd7 6. Nbd2 +D03 Queen's Pawn Game: Torre Attack 1. d4 d5 2. Nf3 Nf6 3. Bg5 e6 4. e3 c5 5. c3 Nbd7 6. Nbd2 Bd6 +D03 Queen's Pawn Game: Torre Attack 1. d4 d5 2. Nf3 Nf6 3. Bg5 e6 4. e3 c5 5. c3 Nbd7 6. Nbd2 Be7 +D03 Queen's Pawn Game: Torre Attack 1. d4 d5 2. Nf3 Nf6 3. Bg5 e6 4. e3 c5 5. c3 Nc6 +D03 Queen's Pawn Game: Torre Attack 1. d4 d5 2. Nf3 Nf6 3. Bg5 e6 4. e3 c5 5. c3 Nc6 6. Bd3 +D03 Queen's Pawn Game: Torre Attack 1. d4 d5 2. Nf3 Nf6 3. Bg5 e6 4. e3 Nbd7 5. Bd3 +D03 Queen's Pawn Game: Torre Attack 1. d4 d5 2. Nf3 Nf6 3. Bg5 e6 4. Nbd2 Be7 5. c3 Nbd7 6. e3 +D03 Queen's Pawn Game: Torre Attack, Gossip Variation 1. d4 d5 2. Nf3 Nf6 3. Bg5 Ne4 +D03 Queen's Pawn Game: Torre Attack, Grünfeld Variation 1. d4 d5 2. Nf3 Nf6 3. Bg5 g6 +D03 Queen's Pawn Game: Torre Attack, Grünfeld Variation 1. d4 d5 2. Nf3 Nf6 3. Bg5 g6 4. e3 +D04 Queen's Pawn Game: Colle System 1. d4 d5 2. Nf3 Nf6 3. e3 +D04 Queen's Pawn Game: Colle System, Anti-Colle 1. d4 d5 2. Nf3 Nf6 3. e3 Bf5 +D04 Queen's Pawn Game: Colle System, Grünfeld Formation 1. d4 d5 2. Nf3 Nf6 3. e3 g6 4. Bd3 Bg7 +D05 Queen's Pawn Game: Colle System 1. d4 d5 2. Nf3 Nf6 3. e3 e6 +D05 Queen's Pawn Game: Colle System 1. d4 d5 2. Nf3 Nf6 3. e3 e6 4. Bd3 +D05 Queen's Pawn Game: Colle System 1. d4 d5 2. Nf3 Nf6 3. e3 e6 4. b3 +D05 Queen's Pawn Game: Colle System 1. d4 d5 2. Nf3 Nf6 3. e3 e6 4. b3 c5 5. Bb2 Nc6 +D05 Queen's Pawn Game: Colle System 1. d4 d5 2. Nf3 Nf6 3. e3 e6 4. b3 c5 5. Bb2 Nc6 6. Bd3 +D05 Queen's Pawn Game: Colle System 1. d4 d5 2. Nf3 Nf6 3. e3 e6 4. b3 c5 5. Bb2 Nc6 6. Nbd2 +D05 Queen's Pawn Game: Colle System 1. d4 Nf6 2. Nf3 e6 3. e3 b6 4. Bd3 Bb7 5. O-O c5 6. b3 Be7 7. Bb2 O-O 8. Nbd2 d5 +D05 Queen's Pawn Game: Colle System, Traditional Colle 1. d4 Nf6 2. Nf3 e6 3. e3 c5 4. Bd3 d5 5. c3 +D05 Queen's Pawn Game: Zukertort Variation 1. d4 d5 2. Nf3 c5 3. e3 Nf6 4. Nbd2 e6 5. b3 +D05 Rubinstein Opening 1. d4 Nf6 2. Nf3 e6 3. e3 c5 4. Bd3 d5 5. b3 +D05 Rubinstein Opening: Bogoljubow Defense 1. d4 Nf6 2. Nf3 e6 3. e3 c5 4. Bd3 d5 5. b3 Nc6 6. O-O Bd6 7. Bb2 O-O +D05 Rubinstein Opening: Classical Defense 1. d4 Nf6 2. Nf3 e6 3. e3 c5 4. Bd3 d5 5. b3 Nc6 6. O-O Be7 7. Bb2 O-O +D05 Rubinstein Opening: Semi-Slav Defense 1. d4 d5 2. Nf3 Nf6 3. e3 e6 4. Bd3 Bd6 5. O-O O-O 6. b3 Nbd7 7. Bb2 +D05 Rubinstein Opening: Semi-Slav Defense 1. d4 d5 2. Nf3 Nf6 3. e3 e6 4. Bd3 Bd6 5. O-O O-O 6. b3 Nbd7 7. Bb2 c6 +D05 Rubinstein Opening: Semi-Slav Defense 1. d4 d5 2. Nf3 Nf6 3. e3 e6 4. Bd3 Bd6 5. O-O O-O 6. b3 Nbd7 7. Bb2 c6 8. Nbd2 +D06 Queen's Gambit 1. d4 d5 2. c4 +D06 Queen's Gambit Declined: Austrian Attack, Salvio Countergambit 1. d4 d5 2. c4 c5 3. dxc5 d4 +D06 Queen's Gambit Declined: Austrian Defense 1. d4 d5 2. c4 c5 +D06 Queen's Gambit Declined: Austrian Defense, Gusev Countergambit 1. d4 d5 2. c4 c5 3. cxd5 Nf6 +D06 Queen's Gambit Declined: Austrian Defense, Haberditz Variation 1. d4 d5 2. c4 c5 3. cxd5 Nf6 4. e4 Nxe4 5. dxc5 Qa5+ +D06 Queen's Gambit Declined: Baltic Defense 1. d4 d5 2. c4 Bf5 +D06 Queen's Gambit Declined: Baltic Defense, Argentinian Gambit 1. d4 d5 2. c4 Bf5 3. cxd5 Bxb1 4. Qa4+ c6 5. dxc6 Nxc6 +D06 Queen's Gambit Declined: Baltic Defense, Pseudo-Chigorin 1. d4 d5 2. c4 Bf5 3. Nc3 e6 4. Nf3 Nc6 +D06 Queen's Gambit Declined: Baltic Defense, Queen Attack 1. d4 d5 2. c4 Bf5 3. Qb3 +D06 Queen's Gambit Declined: Baltic Defense, Queen Attack Deferred 1. d4 d5 2. c4 Bf5 3. Nc3 e6 4. Qb3 +D06 Queen's Gambit Declined: Marshall Defense 1. d4 d5 2. c4 Nf6 +D06 Queen's Gambit Declined: Marshall Defense, Tan Gambit 1. d4 d5 2. c4 Nf6 3. cxd5 c6 +D06 Queen's Gambit Declined: Zilbermints Gambit 1. d4 d5 2. c4 b5 +D07 Queen's Gambit Declined: Chigorin Defense 1. d4 d5 2. c4 Nc6 +D07 Queen's Gambit Declined: Chigorin Defense 1. d4 d5 2. c4 Nc6 3. Nc3 +D07 Queen's Gambit Declined: Chigorin Defense 1. d4 d5 2. c4 Nc6 3. Nc3 dxc4 +D07 Queen's Gambit Declined: Chigorin Defense 1. d4 d5 2. c4 Nc6 3. Nc3 e6 4. Nf3 Nf6 +D07 Queen's Gambit Declined: Chigorin Defense 1. d4 d5 2. c4 Nc6 3. Nc3 e6 4. Nf3 Nf6 5. a3 +D07 Queen's Gambit Declined: Chigorin Defense, Exchange Variation 1. d4 d5 2. c4 Nc6 3. cxd5 Qxd5 +D07 Queen's Gambit Declined: Chigorin Defense, Exchange Variation, Costa's Line 1. d4 d5 2. c4 Nc6 3. cxd5 Qxd5 4. e3 e5 5. Nc3 Bb4 6. Bd2 Bxc3 7. Bxc3 exd4 8. Ne2 +D07 Queen's Gambit Declined: Chigorin Defense, Janowski Variation 1. d4 d5 2. c4 Nc6 3. Nc3 dxc4 4. Nf3 +D07 Queen's Gambit Declined: Chigorin Defense, Lazard Gambit 1. d4 d5 2. c4 Nc6 3. Nf3 e5 +D07 Queen's Gambit Declined: Chigorin Defense, Main Line 1. d4 d5 2. c4 Nc6 3. Nf3 Bg4 +D07 Queen's Gambit Declined: Chigorin Defense, Main Line, Alekhine Variation 1. d4 d5 2. c4 Nc6 3. Nf3 Bg4 4. Qa4 +D07 Queen's Gambit Declined: Chigorin Defense, Modern Gambit 1. d4 d5 2. c4 Nc6 3. Nc3 dxc4 4. Nf3 Nf6 +D07 Queen's Gambit Declined: Chigorin Defense, Tartakower Gambit 1. d4 d5 2. c4 Nc6 3. Nc3 e5 +D08 Queen's Gambit Declined: Albin Countergambit 1. d4 d5 2. c4 e5 +D08 Queen's Gambit Declined: Albin Countergambit, Balogh Variation 1. d4 d5 2. c4 e5 3. dxe5 d4 4. Nf3 Nc6 5. Nbd2 Qe7 +D08 Queen's Gambit Declined: Albin Countergambit, Janowski Variation 1. d4 d5 2. c4 e5 3. dxe5 d4 4. Nf3 Nc6 5. Nbd2 f6 +D08 Queen's Gambit Declined: Albin Countergambit, Krenosz Variation 1. d4 d5 2. c4 e5 3. dxe5 d4 4. Nf3 Nc6 5. Nbd2 Bg4 6. h3 Bxf3 7. Nxf3 Bb4+ 8. Bd2 Qe7 +D08 Queen's Gambit Declined: Albin Countergambit, Lasker Trap 1. d4 d5 2. c4 e5 3. dxe5 d4 4. e3 Bb4+ 5. Bd2 dxe3 +D08 Queen's Gambit Declined: Albin Countergambit, Modern Line 1. d4 d5 2. c4 e5 3. dxe5 d4 4. Nf3 Nc6 5. Nbd2 +D08 Queen's Gambit Declined: Albin Countergambit, Normal Line 1. d4 d5 2. c4 e5 3. dxe5 d4 4. Nf3 +D08 Queen's Gambit Declined: Albin Countergambit, Spassky Variation 1. d4 d5 2. c4 e5 3. dxe5 d4 4. e4 +D08 Queen's Gambit Declined: Albin Countergambit, Tartakower Defense 1. d4 d5 2. c4 e5 3. dxe5 d4 4. Nf3 c5 +D09 Queen's Gambit Declined: Albin Countergambit, Fianchetto Variation 1. d4 d5 2. c4 e5 3. dxe5 d4 4. Nf3 Nc6 5. g3 +D09 Queen's Gambit Declined: Albin Countergambit, Fianchetto Variation, Be6 Line 1. d4 d5 2. c4 e5 3. dxe5 d4 4. Nf3 Nc6 5. g3 Be6 +D09 Queen's Gambit Declined: Albin Countergambit, Fianchetto Variation, Bf5 Line 1. d4 d5 2. c4 e5 3. dxe5 d4 4. Nf3 Nc6 5. g3 Bf5 +D09 Queen's Gambit Declined: Albin Countergambit, Fianchetto Variation, Bg4 Line 1. d4 d5 2. c4 e5 3. dxe5 d4 4. Nf3 Nc6 5. g3 Bg4 +D10 Slav Defense 1. d4 d5 2. c4 c6 +D10 Slav Defense 1. d4 d5 2. c4 c6 3. Nc3 +D10 Slav Defense 1. d4 d5 2. c4 c6 3. Nc3 dxc4 +D10 Slav Defense: Diemer Gambit 1. d4 d5 2. c4 c6 3. e4 +D10 Slav Defense: Exchange Variation 1. d4 d5 2. c4 c6 3. cxd5 +D10 Slav Defense: Exchange Variation, Boor Attack 1. d4 d5 2. c4 c6 3. cxd5 cxd5 4. Nc3 Nf6 5. f3 +D10 Slav Defense: Slav Gambit, Alekhine Attack 1. d4 d5 2. c4 c6 3. Nc3 dxc4 4. e4 +D10 Slav Defense: Winawer Countergambit 1. d4 d5 2. c4 c6 3. Nc3 e5 +D10 Slav Defense: Winawer Countergambit, Anti-Winawer Gambit 1. d4 d5 2. c4 c6 3. Nc3 e5 4. e4 +D11 Slav Defense: Bonet Gambit 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Bg5 +D11 Slav Defense: Breyer Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nbd2 +D11 Slav Defense: Modern Line 1. d4 d5 2. c4 c6 3. Nf3 +D11 Slav Defense: Modern Line 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. g3 dxc4 5. Bg2 g6 +D11 Slav Defense: Modern Line 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. g3 Bg4 5. Bg2 e6 6. O-O +D11 Slav Defense: Modern Line 1. d4 d5 2. Nf3 Nf6 3. g3 c6 4. Bg2 Bg4 5. O-O Nbd7 6. c4 +D11 Slav Defense: Quiet Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. e3 +D11 Slav Defense: Quiet Variation, Pin Defense 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. e3 Bg4 +D12 Slav Defense: Quiet Variation, Amsterdam Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. e3 Bf5 5. cxd5 cxd5 6. Nc3 e6 7. Ne5 Nfd7 +D12 Slav Defense: Quiet Variation, Landau Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. e3 Bf5 5. cxd5 cxd5 6. Qb3 Qc8 7. Bd2 e6 8. Na3 +D12 Slav Defense: Quiet Variation, Schallopp Defense 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. e3 Bf5 +D12 Slav Defense: Quiet Variation, Schallopp Defense 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. e3 Bf5 5. Nc3 e6 +D13 Slav Defense: Exchange Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. cxd5 cxd5 +D13 Slav Defense: Exchange Variation, Schallopp Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. e3 Bf5 5. cxd5 cxd5 6. Nc3 +D14 Slav Defense: Exchange Variation, Symmetrical Line 1. d4 d5 2. c4 c6 3. cxd5 cxd5 4. Nc3 Nf6 5. Nf3 Nc6 6. Bf4 Bf5 +D14 Slav Defense: Exchange Variation, Trifunovic Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. cxd5 cxd5 5. Nc3 Nc6 6. Bf4 Bf5 7. e3 e6 8. Qb3 Bb4 +D15 Slav Defense: Alekhine Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. e3 +D15 Slav Defense: Chebanenko Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 a6 +D15 Slav Defense: Chebanenko Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 a6 5. e3 Bf5 +D15 Slav Defense: Chebanenko Variation, Advance System 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 a6 5. c5 +D15 Slav Defense: Geller Gambit 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. e4 +D15 Slav Defense: Geller Gambit 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. e4 b5 6. e5 +D15 Slav Defense: Schlechter Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 g6 +D15 Slav Defense: Süchting Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 Qb6 +D15 Slav Defense: Three Knights Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 +D15 Slav Defense: Two Knights Attack 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 +D16 Slav Defense: Alapin Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. a4 +D16 Slav Defense: Smyslov Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. a4 Na6 +D16 Slav Defense: Soultanbeieff Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. a4 e6 +D16 Slav Defense: Steiner Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. a4 Bg4 +D17 Slav Defense: Czech Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. a4 Bf5 +D17 Slav Defense: Czech Variation, Bled Attack 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. a4 Bf5 6. Nh4 +D17 Slav Defense: Czech Variation, Carlsbad Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. a4 Bf5 6. Ne5 Nbd7 7. Nxc4 Qc7 8. g3 e5 +D17 Slav Defense: Czech Variation, Carlsbad Variation, Morozevich Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. a4 Bf5 6. Ne5 Nbd7 7. Nxc4 Qc7 8. g3 e5 9. dxe5 Nxe5 10. Bf4 Nfd7 11. Bg2 g5 +D17 Slav Defense: Czech Variation, Krause Attack 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. a4 Bf5 6. Ne5 +D17 Slav Defense: Czech Variation, Krause Attack, Fazekas Gambit 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. a4 Bf5 6. Ne5 Na6 7. e4 +D17 Slav Defense: Czech Variation, Wiesbaden Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. a4 Bf5 6. Ne5 e6 +D17 Slav Defense: Czech Variation, Wiesbaden Variation, Sharp Line 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. a4 Bf5 6. Ne5 e6 7. f3 Bb4 8. e4 +D18 Slav Defense: Czech Variation, Classical System 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. a4 Bf5 6. e3 +D18 Slav Defense: Czech Variation, Lasker Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. a4 Bf5 6. e3 Na6 +D19 Slav Defense: Czech Variation, Classical System, Main Line 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. a4 Bf5 6. e3 e6 7. Bxc4 Bb4 8. O-O O-O 9. Qe2 +D19 Slav Defense: Czech Variation, Dutch Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. a4 Bf5 6. e3 e6 7. Bxc4 Bb4 8. O-O +D19 Slav Defense: Czech Variation, Dutch Variation, Sämisch Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 dxc4 5. a4 Bf5 6. e3 e6 7. Bxc4 Bb4 8. O-O O-O 9. Qe2 Ne4 10. g4 +D20 Queen's Gambit Accepted 1. d4 d5 2. c4 dxc4 +D20 Queen's Gambit Accepted: Accelerated Mannheim Variation 1. d4 d5 2. c4 dxc4 3. Qa4+ +D20 Queen's Gambit Accepted: Central Variation, Alekhine System 1. d4 d5 2. c4 dxc4 3. e4 Nf6 +D20 Queen's Gambit Accepted: Central Variation, Greco Variation 1. d4 d5 2. c4 dxc4 3. e4 b5 +D20 Queen's Gambit Accepted: Central Variation, McDonnell Defense 1. d4 d5 2. c4 dxc4 3. e4 e5 +D20 Queen's Gambit Accepted: Central Variation, McDonnell Defense, Somov Gambit 1. d4 d5 2. c4 dxc4 3. e4 e5 4. Bxc4 +D20 Queen's Gambit Accepted: Central Variation, Modern Defense 1. d4 d5 2. c4 dxc4 3. e4 Nc6 +D20 Queen's Gambit Accepted: Central Variation, Rubinstein Defense 1. d4 d5 2. c4 dxc4 3. e4 c5 +D20 Queen's Gambit Accepted: Central Variation, Rubinstein Defense, Yefimov Gambit 1. d4 d5 2. c4 dxc4 3. e4 c5 4. d5 b5 +D20 Queen's Gambit Accepted: Linares Variation 1. d4 d5 2. c4 dxc4 3. e4 c5 4. d5 Nf6 5. Nc3 b5 +D20 Queen's Gambit Accepted: Old Variation 1. d4 d5 2. c4 dxc4 3. e3 +D20 Queen's Gambit Accepted: Old Variation, Billinger Gambit 1. d4 d5 2. c4 dxc4 3. e3 e5 4. Bxc4 exd4 5. Qb3 Qe7 6. a3 +D20 Queen's Gambit Accepted: Old Variation, Christensen Gambit 1. d4 d5 2. c4 dxc4 3. e3 e5 4. Bxc4 exd4 5. Qb3 Qe7 6. Nf3 +D20 Queen's Gambit Accepted: Old Variation, Korchnoi Gambit 1. d4 d5 2. c4 dxc4 3. e3 e5 4. Bxc4 exd4 5. Qb3 Qe7 6. Kf1 +D20 Queen's Gambit Accepted: Old Variation, Novikov Gambit 1. d4 d5 2. c4 dxc4 3. e3 e5 4. Bxc4 exd4 5. Qb3 Qe7 6. Nd2 +D20 Queen's Gambit Accepted: Saduleto Variation 1. d4 d5 2. c4 dxc4 3. e4 +D20 Queen's Gambit Accepted: Schwartz Defense 1. d4 d5 2. c4 dxc4 3. e4 f5 +D21 Queen's Gambit Accepted: Alekhine Defense, Borisenko-Furman Variation 1. d4 d5 2. c4 dxc4 3. Nf3 a6 4. e4 +D21 Queen's Gambit Accepted: Godes Variation 1. d4 d5 2. c4 dxc4 3. Nf3 Nd7 +D21 Queen's Gambit Accepted: Gunsberg Defense 1. d4 d5 2. c4 dxc4 3. Nf3 c5 +D21 Queen's Gambit Accepted: Normal Variation 1. d4 d5 2. c4 dxc4 3. Nf3 +D21 Queen's Gambit Accepted: Rosenthal Variation 1. d4 d5 2. c4 dxc4 3. Nf3 e6 +D21 Queen's Gambit Accepted: Slav Gambit 1. d4 d5 2. c4 dxc4 3. Nf3 b5 +D22 Queen's Gambit Accepted: Alekhine Defense 1. d4 d5 2. c4 dxc4 3. Nf3 a6 +D22 Queen's Gambit Accepted: Alekhine Defense, Alatortsev Variation 1. d4 d5 2. c4 dxc4 3. Nf3 a6 4. e3 Bg4 5. Bxc4 e6 6. d5 +D22 Queen's Gambit Accepted: Alekhine Defense, Haberditz Variation 1. d4 d5 2. c4 dxc4 3. Nf3 a6 4. e3 b5 +D23 Queen's Gambit Accepted 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 +D23 Queen's Gambit Accepted: Mannheim Variation 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. Qa4+ +D23 Queen's Gambit Accepted: Mannheim Variation 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. Qa4+ c6 5. Qxc4 +D23 Queen's Gambit Accepted: Mannheim Variation 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. Qa4+ c6 5. Qxc4 e6 6. Qc2 +D24 Queen's Gambit Accepted 1. d4 d5 2. c4 e6 3. Nf3 Nf6 4. Nc3 dxc4 5. e4 +D24 Queen's Gambit Accepted 1. d4 d5 2. c4 e6 3. Nf3 Nf6 4. Nc3 dxc4 5. Bg5 +D24 Queen's Gambit Accepted: Bogoljubow Defense 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. Nc3 a6 5. e4 +D24 Queen's Gambit Accepted: Gunsberg Defense, Prianishenmo Gambit 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. Nc3 c5 5. d5 e6 6. e4 exd5 7. e5 +D24 Queen's Gambit Accepted: Showalter Variation 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. Nc3 +D25 Queen's Gambit Accepted: Janowski-Larsen Variation 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 Bg4 +D25 Queen's Gambit Accepted: Normal Variation 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 +D25 Queen's Gambit Accepted: Smyslov Variation 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 g6 +D25 Queen's Gambit Accepted: Winawer Defense 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 Be6 +D26 Queen's Gambit Accepted: Classical Defense 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 c5 +D26 Queen's Gambit Accepted: Classical Defense, Normal Line 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 c5 6. O-O +D26 Queen's Gambit Accepted: Classical Defense, Steinitz Variation, Development Variation 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 c5 6. O-O Nc6 +D26 Queen's Gambit Accepted: Classical Defense, Steinitz Variation, Exchange Variation 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 c5 6. O-O cxd4 +D26 Queen's Gambit Accepted: Classical, Furman Variation 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 c5 6. Qe2 a6 7. dxc5 Bxc5 8. O-O Nc6 9. e4 b5 10. e5 +D26 Queen's Gambit Accepted: Normal Variation, .. a6 Sideline 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 a6 6. Nc3 b5 +D26 Queen's Gambit Accepted: Normal Variation, .. a6 Sideline 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 a6 6. Nc3 b5 7. Bb3 Bb7 8. O-O +D26 Queen's Gambit Accepted: Normal Variation, Traditional System 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 +D26 Queen's Gambit Accepted: Normal Variation, Traditional System 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 Be7 6. O-O a6 +D26 Queen's Gambit Accepted: Normal Variation, Traditional System 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 Be7 6. O-O O-O +D26 Queen's Gambit Accepted: Normal Variation, Traditional System 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 Be7 6. O-O O-O 7. Nc3 +D27 Queen's Gambit Accepted: Classical Defense, Main Line 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 c5 6. O-O a6 +D27 Queen's Gambit Accepted: Classical Defense, Main Line 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 c5 6. O-O a6 7. Nc3 +D27 Queen's Gambit Accepted: Classical Defense, Main Line 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 a6 6. Nc3 b5 7. Bb3 Bb7 8. O-O c5 +D27 Queen's Gambit Accepted: Classical Defense, Rubinstein Variation 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 c5 6. O-O a6 7. a4 +D27 Queen's Gambit Accepted: Classical Defense, Rubinstein Variation 1. d4 d5 2. c4 dxc4 3. Nf3 e6 4. e3 Nf6 5. Bxc4 Be7 6. O-O O-O 7. Nc3 a6 8. a4 c5 +D27 Queen's Gambit Accepted: Classical Defense, Russian Gambit 1. d4 d5 2. c4 dxc4 3. e3 Nf6 4. Bxc4 e6 5. Nf3 c5 6. O-O a6 7. e4 +D27 Queen's Gambit Accepted: Furman Variation 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 c5 6. O-O a6 7. dxc5 Bxc5 +D28 Queen's Gambit Accepted: Classical Defense, Alekhine System 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 c5 6. O-O a6 7. Qe2 +D28 Queen's Gambit Accepted: Classical Defense, Alekhine System 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 c5 6. O-O a6 7. Qe2 b5 +D28 Queen's Gambit Accepted: Classical, Flohr Variation 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 c5 6. O-O a6 7. Qe2 b5 8. Bb3 Nc6 9. Rd1 c4 10. Bc2 Nb4 11. Nc3 Nxc2 12. Qxc2 Bb7 13. d5 Qc7 +D29 Queen's Gambit Accepted: Classical Defense, Alekhine System, Main Line 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 c5 6. O-O a6 7. Qe2 b5 8. Bb3 Bb7 +D29 Queen's Gambit Accepted: Classical Defense, Alekhine System, Main Line 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 c5 6. O-O a6 7. Qe2 b5 8. Bb3 Bb7 9. Nc3 +D29 Queen's Gambit Accepted: Classical Defense, Alekhine System, Smyslov Variation 1. d4 d5 2. c4 dxc4 3. Nf3 Nf6 4. e3 e6 5. Bxc4 c5 6. O-O a6 7. Qe2 b5 8. Bb3 Bb7 9. Rd1 Nbd7 10. Nc3 Bd6 +D30 Queen's Gambit Declined 1. d4 d5 2. c4 e6 +D30 Queen's Gambit Declined 1. d4 d5 2. c4 e6 3. Nf3 c6 4. Qc2 dxc4 5. Qxc4 Nf6 6. g3 +D30 Queen's Gambit Declined: Capablanca Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Bg5 h6 +D30 Queen's Gambit Declined: Capablanca Variation 1. d4 Nf6 2. Nf3 e6 3. c4 d5 4. Bg5 c6 5. Nbd2 Nbd7 6. e3 +D30 Queen's Gambit Declined: Semmering Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. e3 e6 5. Nbd2 Nbd7 6. Bd3 c5 +D30 Queen's Gambit Declined: Spielmann Variation 1. d4 d5 2. c4 e6 3. Nf3 Nf6 4. e3 c6 5. Nbd2 g6 +D30 Queen's Gambit Declined: Stonewall Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. e3 e6 5. Nbd2 Ne4 6. Bd3 f5 +D30 Queen's Gambit Declined: Tarrasch Defense, Pseudo-Tarrasch 1. d4 d5 2. c4 e6 3. Nf3 c5 +D30 Queen's Gambit Declined: Tarrasch Defense, Pseudo-Tarrasch Bishop Attack 1. d4 d5 2. c4 e6 3. Nf3 c5 4. cxd5 exd5 5. Bg5 +D30 Queen's Gambit Declined: Traditional Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Bg5 +D30 Queen's Gambit Declined: Traditional Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Bg5 dxc4 5. Qa4+ c6 6. Qxc4 +D30 Queen's Gambit Declined: Vienna Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Bg5 Bb4+ +D30 Semi-Slav Defense: Quiet Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. e3 e6 5. Nbd2 +D30 Semi-Slav Defense: Quiet Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. e3 e6 5. Nbd2 Nbd7 +D31 Queen's Gambit Declined: Alapin Variation 1. d4 e6 2. c4 b6 3. Nc3 d5 +D31 Queen's Gambit Declined: Charousek Variation 1. d4 d5 2. c4 e6 3. Nc3 Be7 +D31 Queen's Gambit Declined: Charousek Variation, Miladinovic Gambit 1. d4 d5 2. c4 e6 3. Nc3 Be7 4. e4 dxe4 5. f3 +D31 Queen's Gambit Declined: Janowski Variation 1. d4 d5 2. c4 e6 3. Nc3 a6 +D31 Queen's Gambit Declined: Queen's Knight Variation 1. d4 d5 2. c4 e6 3. Nc3 +D31 Queen's Gambit Declined: Semi-Slav, Abrahams Variation 1. d4 d5 2. c4 e6 3. Nc3 c6 4. Nf3 dxc4 5. a4 Bb4 6. e3 b5 7. Bd2 a5 +D31 Queen's Gambit Declined: Semi-Slav, Junge Variation 1. d4 d5 2. c4 e6 3. Nf3 c6 4. Nc3 dxc4 5. a4 Bb4 6. e3 b5 7. Bd2 Qb6 +D31 Queen's Gambit Declined: Semi-Slav, Koomen Variation 1. d4 d5 2. c4 e6 3. Nc3 c6 4. Nf3 dxc4 5. e3 b5 6. a4 Bb4 7. Bd2 Qe7 +D31 Semi-Slav Defense: Accelerated Move Order 1. d4 d5 2. c4 e6 3. Nc3 c6 +D31 Semi-Slav Defense: Anti-Noteboom, Stonewall Variation 1. d4 d5 2. c4 e6 3. Nc3 c6 4. e3 f5 +D31 Semi-Slav Defense: Anti-Noteboom, Stonewall Variation, Portisch Gambit 1. d4 d5 2. c4 e6 3. Nc3 c6 4. e3 f5 5. g4 +D31 Semi-Slav Defense: Gunderam Gambit 1. d4 d5 2. c4 e6 3. Nc3 c6 4. e4 dxe4 5. f3 +D31 Semi-Slav Defense: Marshall Gambit 1. d4 d5 2. c4 e6 3. Nc3 c6 4. e4 +D31 Semi-Slav Defense: Marshall Gambit, Forgotten Variation 1. d4 d5 2. c4 e6 3. Nc3 c6 4. e4 dxe4 5. Nxe4 Bb4+ 6. Nc3 +D31 Semi-Slav Defense: Marshall Gambit, Main Line 1. d4 d5 2. c4 e6 3. Nc3 c6 4. e4 dxe4 5. Nxe4 Bb4+ 6. Bd2 +D31 Semi-Slav Defense: Marshall Gambit, Tolush Variation 1. d4 d5 2. c4 e6 3. Nc3 c6 4. e4 dxe4 5. Nxe4 Bb4+ 6. Bd2 Qxd4 7. Bxb4 Qxe4+ 8. Be2 c5 9. Bxc5 Qxg2 +D31 Semi-Slav Defense: Noteboom Variation 1. d4 d5 2. c4 e6 3. Nc3 c6 4. Nf3 dxc4 +D31 Semi-Slav Defense: Noteboom Variation, Abrahams Variation 1. d4 d5 2. c4 e6 3. Nc3 c6 4. Nf3 dxc4 5. a4 Bb4 6. e3 Bxc3+ 7. bxc3 b5 8. axb5 cxb5 +D31 Semi-Slav Defense: Noteboom Variation, Anti-Noteboom Gambit 1. d4 d5 2. c4 e6 3. Nc3 c6 4. Nf3 dxc4 5. g3 +D31 Semi-Slav Defense: Noteboom Variation, Anti-Noteboom Variation 1. d4 d5 2. c4 e6 3. Nc3 c6 4. Nf3 dxc4 5. Bg5 +D31 Semi-Slav Defense: Noteboom Variation, Anti-Noteboom Variation, Belyavsky Line 1. d4 d5 2. c4 e6 3. Nc3 c6 4. Nf3 dxc4 5. Bg5 f6 +D32 Queen's Gambit Declined: Tarrasch Defense 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 +D32 Queen's Gambit Declined: Tarrasch Defense 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. Nf3 Nc6 6. Bg5 Be7 +D32 Queen's Gambit Declined: Tarrasch Defense 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. Nf3 Nc6 6. Bg5 Be7 7. Bxe7 Ngxe7 +D32 Queen's Gambit Declined: Tarrasch Defense 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. e3 c5 5. cxd5 exd5 6. Nc3 a6 7. Be2 Nc6 +D32 Tarrasch Defense 1. d4 d5 2. c4 e6 3. Nc3 c5 +D32 Tarrasch Defense: Grünfeld Gambit 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. Nf3 Nc6 6. dxc5 d4 7. Na4 b5 +D32 Tarrasch Defense: Marshall Gambit 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. e4 +D32 Tarrasch Defense: Schara Gambit 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 cxd4 +D32 Tarrasch Defense: Symmetrical Variation 1. d4 d5 2. c4 e6 3. Nc3 c5 4. e3 Nf6 5. Nf3 Nc6 +D32 Tarrasch Defense: Symmetrical Variation 1. c4 c5 2. Nf3 Nc6 3. Nc3 Nf6 4. e3 e6 5. d4 d5 6. cxd5 exd5 +D32 Tarrasch Defense: Tarrasch Gambit 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. dxc5 d4 6. Na4 b5 +D32 Tarrasch Defense: Two Knights Variation 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. Nf3 +D32 Tarrasch Defense: von Hennig Gambit 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 cxd4 5. Qxd4 Nc6 6. Qd1 exd5 7. Qxd5 Be6 +D33 Tarrasch Defense: Dubov Tarrasch 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. Nf3 Nc6 6. g3 Nf6 7. Bg2 cxd4 8. Nxd4 Bc5 +D33 Tarrasch Defense: Prague Variation 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. Nf3 Nc6 6. g3 Nf6 +D33 Tarrasch Defense: Rubinstein System 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. Nf3 Nc6 6. g3 +D33 Tarrasch Defense: Swedish Variation 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. Nf3 Nc6 6. g3 c4 +D33 Tarrasch Defense: Swedish Variation, Central Break 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. Nf3 Nc6 6. g3 c4 7. e4 +D33 Tarrasch Defense: Wagner Variation 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. Nf3 Nc6 6. g3 Nf6 7. Bg2 Bg4 +D34 Queen's Gambit Declined: Tarrasch Defense, Stoltz Variation 1. d4 d5 2. c4 e6 3. Nf3 c5 4. cxd5 exd5 5. g3 Nc6 6. Bg2 Nf6 7. O-O Be7 8. Nc3 O-O 9. Bg5 Be6 10. Rc1 b6 +D34 Tarrasch Defense: Classical Variation 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. Nf3 Nc6 6. g3 Nf6 7. Bg2 Be7 8. O-O O-O +D34 Tarrasch Defense: Classical Variation, Advance Variation 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. Nf3 Nc6 6. g3 Nf6 7. Bg2 Be7 8. O-O O-O 9. Bg5 c4 +D34 Tarrasch Defense: Classical Variation, Bogoljubow Variation 1. d4 Nf6 2. c4 e6 3. Nc3 c5 4. Nf3 d5 5. cxd5 exd5 6. g3 Nc6 7. Bg2 Be7 8. O-O O-O 9. Bg5 Be6 10. Rc1 c4 +D34 Tarrasch Defense: Classical Variation, Carlsbad Variation 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. Nf3 Nc6 6. g3 Nf6 7. Bg2 Be7 8. O-O O-O 9. Bg5 +D34 Tarrasch Defense: Classical Variation, Chandler Variation 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. Nf3 Nc6 6. g3 Nf6 7. Bg2 Be7 8. O-O O-O 9. Bg5 cxd4 10. Nxd4 h6 11. Be3 Re8 12. Rc1 Be6 +D34 Tarrasch Defense: Classical Variation, Classical Tarrasch Gambit 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. Nf3 Nc6 6. g3 Nf6 7. Bg2 Be7 8. O-O O-O 9. dxc5 d4 +D34 Tarrasch Defense: Classical Variation, Endgame Variation 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. Nf3 Nc6 6. g3 Nf6 7. Bg2 Be7 8. O-O O-O 9. Bg5 Be6 +D34 Tarrasch Defense: Classical Variation, Main Line 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. Nf3 Nc6 6. g3 Nf6 7. Bg2 Be7 8. O-O O-O 9. Bg5 cxd4 10. Nxd4 h6 11. Be3 Re8 +D34 Tarrasch Defense: Classical Variation, Petursson Variation 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. Nf3 Nc6 6. g3 Nf6 7. Bg2 Be7 8. O-O O-O 9. Bg5 cxd4 10. Nxd4 Re8 +D34 Tarrasch Defense: Classical Variation, Réti Variation 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. Nf3 Nc6 6. g3 Nf6 7. Bg2 Be7 8. O-O O-O 9. dxc5 Bxc5 10. Na4 +D34 Tarrasch Defense: Classical Variation, Spassky Variation 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. Nf3 Nc6 6. g3 Nf6 7. Bg2 Be7 8. O-O O-O 9. Bg5 cxd4 10. Nxd4 h6 11. Be3 Bg4 +D34 Tarrasch Defense: Prague Variation, Main Line 1. d4 d5 2. c4 e6 3. Nc3 c5 4. cxd5 exd5 5. Nf3 Nc6 6. g3 Nf6 7. Bg2 Be7 +D35 Queen's Gambit Declined: Exchange Variation 1. d4 Nf6 2. c4 e6 3. Nc3 d5 4. cxd5 +D35 Queen's Gambit Declined: Exchange Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. e3 b6 5. Nc3 Bd6 6. cxd5 exd5 +D35 Queen's Gambit Declined: Exchange Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. e3 Be7 5. cxd5 exd5 6. Bd3 O-O 7. Nf3 c6 +D35 Queen's Gambit Declined: Exchange Variation 1. d4 d5 2. c4 e6 3. Nf3 Nf6 4. Nc3 Nc6 5. cxd5 exd5 6. Bg5 Be7 7. e3 +D35 Queen's Gambit Declined: Exchange Variation, Carlsen Variation 1. d4 Nf6 2. c4 e6 3. Nc3 d5 4. cxd5 exd5 5. Bg5 Be7 6. e3 h6 7. Bh4 Bg4 +D35 Queen's Gambit Declined: Exchange Variation, Chameleon Variation 1. d4 Nf6 2. c4 e6 3. Nc3 d5 4. cxd5 exd5 5. Bg5 Be7 6. e3 O-O 7. Bd3 Nbd7 8. Qc2 Re8 9. Nge2 Nf8 10. O-O-O +D35 Queen's Gambit Declined: Exchange Variation, Positional Variation 1. d4 Nf6 2. c4 e6 3. Nc3 d5 4. cxd5 exd5 5. Bg5 +D35 Queen's Gambit Declined: Exchange Variation, Positional Variation 1. d4 Nf6 2. c4 e6 3. Nc3 d5 4. cxd5 exd5 5. Bg5 c6 +D35 Queen's Gambit Declined: Exchange Variation, Positional Variation 1. d4 Nf6 2. c4 e6 3. Nc3 d5 4. cxd5 exd5 5. Bg5 c6 6. e3 Be7 +D35 Queen's Gambit Declined: Exchange Variation, Positional Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Nbd7 5. cxd5 exd5 6. Bg5 c6 7. e3 Be7 +D35 Queen's Gambit Declined: Exchange Variation, Sämisch Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Nbd7 5. cxd5 exd5 6. Bf4 +D35 Queen's Gambit Declined: Harrwitz Attack 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bf4 +D35 Queen's Gambit Declined: Normal Defense 1. d4 d5 2. c4 e6 3. Nc3 Nf6 +D36 Queen's Gambit Declined: Exchange Variation, Reshevsky Variation 1. d4 Nf6 2. c4 e6 3. Nc3 d5 4. cxd5 exd5 5. Bg5 c6 6. Qc2 +D36 Queen's Gambit Declined: Exchange Variation, Reshevsky Variation 1. d4 Nf6 2. c4 e6 3. Nc3 d5 4. cxd5 exd5 5. Bg5 c6 6. Qc2 Be7 7. e3 Nbd7 8. Bd3 +D36 Queen's Gambit Declined: Exchange Variation, Reshevsky Variation 1. d4 Nf6 2. c4 e6 3. Nc3 d5 4. cxd5 exd5 5. Bg5 c6 6. Qc2 Be7 7. e3 O-O 8. Bd3 +D36 Queen's Gambit Declined: Exchange Variation, Reshevsky Variation 1. d4 Nf6 2. c4 e6 3. Nc3 d5 4. cxd5 exd5 5. Bg5 c6 6. Qc2 Be7 7. e3 O-O 8. Bd3 h6 9. Bh4 +D36 Queen's Gambit Declined: Exchange Variation, Reshevsky Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Nbd7 5. cxd5 exd5 6. Bg5 c6 7. e3 Be7 8. Qc2 +D36 Queen's Gambit Declined: Exchange Variation, Reshevsky Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Nbd7 5. cxd5 exd5 6. Bg5 c6 7. e3 Be7 8. Bd3 O-O 9. Qc2 +D36 Queen's Gambit Declined: Exchange Variation, Reshevsky Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Nbd7 5. cxd5 exd5 6. Bg5 c6 7. e3 Be7 8. Bd3 Nf8 9. Qc2 +D36 Queen's Gambit Declined: Exchange Variation, Reshevsky Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. cxd5 exd5 5. Bg5 c6 6. e3 Be7 7. Bd3 Nbd7 8. Nge2 O-O 9. O-O Re8 10. Qc2 +D36 Queen's Gambit Declined: Exchange Variation, Reshevsky Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. cxd5 exd5 5. Bg5 c6 6. e3 Be7 7. Bd3 Nbd7 8. Nge2 O-O 9. O-O Re8 10. Qc2 Nf8 +D36 Queen's Gambit Declined: Exchange Variation, Reshevsky Variation 1. d4 Nf6 2. c4 e6 3. Nc3 d5 4. cxd5 exd5 5. Bg5 c6 6. e3 Be7 7. Bd3 Nbd7 8. Nge2 O-O 9. O-O h6 10. Bh4 Re8 11. Qc2 +D37 Queen's Gambit Declined: Barmen Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Nbd7 +D37 Queen's Gambit Declined: Harrwitz Attack 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bf4 +D37 Queen's Gambit Declined: Harrwitz Attack 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bf4 O-O 6. e3 c5 7. dxc5 Bxc5 8. Qc2 Nc6 9. Rd1 Qa5 10. a3 +D37 Queen's Gambit Declined: Harrwitz Attack 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bf4 O-O 6. e3 c5 7. dxc5 Bxc5 8. Qc2 Nc6 9. a3 Qa5 10. O-O-O +D37 Queen's Gambit Declined: Harrwitz Attack, Fianchetto Defense 1. d4 d5 2. c4 e6 3. Nc3 Be7 4. Nf3 Nf6 5. Bf4 O-O 6. e3 b6 +D37 Queen's Gambit Declined: Harrwitz Attack, Main Line 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bf4 O-O 6. e3 c5 7. dxc5 Bxc5 +D37 Queen's Gambit Declined: Harrwitz Attack, Orthodox Defense 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Nf3 Be7 5. Bf4 O-O 6. e3 c6 +D37 Queen's Gambit Declined: Harrwitz Attack, Two Knights Defense 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bf4 O-O 6. e3 Nbd7 +D37 Queen's Gambit Declined: Harrwitz Attack, Two Knights Defense, Blockade Line 1. d4 Nf6 2. c4 e6 3. Nc3 d5 4. Nf3 Be7 5. Bf4 O-O 6. e3 Nbd7 7. c5 +D37 Queen's Gambit Declined: Knight Defense, Alekhine Gambit 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Nbd7 5. Bg5 h6 6. Bh4 dxc4 +D37 Queen's Gambit Declined: Miles Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 O-O 6. Qc2 +D37 Queen's Gambit Declined: Three Knights Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 +D37 Queen's Gambit Declined: Three Knights Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Nf3 Be7 5. e3 O-O +D37 Queen's Gambit Declined: Three Knights, Vienna Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 dxc4 +D37 Queen's Gambit Declined: Vienna Variation, Quiet Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 dxc4 5. e3 +D38 Queen's Gambit Declined: Ragozin Defense 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Bb4 +D38 Queen's Gambit Declined: Ragozin Defense, Alekhine Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Bb4 5. Qa4+ +D38 Queen's Gambit Declined: Westphalian Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Bb4 5. Bg5 Nbd7 6. e3 c5 +D39 Queen's Gambit Declined: Ragozin Defense, Vienna Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Bb4 5. Bg5 dxc4 +D40 Queen's Gambit Declined: Semi-Tarrasch Defense 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 c5 +D40 Queen's Gambit Declined: Semi-Tarrasch Defense 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Nf3 c5 5. e3 Nc6 6. a3 cxd4 7. exd4 Bd6 +D40 Queen's Gambit Declined: Semi-Tarrasch Defense, Levenfish Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Nf3 c5 5. e3 Nc6 6. Bd3 Bd6 7. O-O O-O 8. Qe2 Qe7 9. dxc5 Bxc5 10. e4 +D40 Queen's Gambit Declined: Semi-Tarrasch Defense, Pillsbury Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Nf3 c5 5. Bg5 +D40 Queen's Gambit Declined: Semi-Tarrasch Defense, Symmetrical Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Nf3 c5 5. e3 Nc6 6. Bd3 Bd6 7. O-O O-O +D40 Queen's Gambit Declined: Semi-Tarrasch Defense, with e3 1. d4 d5 2. c4 c5 3. Nf3 Nf6 4. Nc3 e6 5. e3 Nc6 6. Bd3 +D41 Queen's Gambit Declined: Semi-Tarrasch Defense 1. c4 c5 2. Nf3 Nf6 3. Nc3 Nc6 4. g3 d5 5. d4 e6 +D41 Queen's Gambit Declined: Semi-Tarrasch Defense 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 c5 5. cxd5 +D41 Queen's Gambit Declined: Semi-Tarrasch Defense 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 c5 5. cxd5 Nxd5 6. g3 +D41 Queen's Gambit Declined: Semi-Tarrasch Defense 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 c5 5. cxd5 Nxd5 6. g3 Nc6 7. Bg2 +D41 Queen's Gambit Declined: Semi-Tarrasch Defense, Endgame Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 c5 5. cxd5 cxd4 6. Qxd4 exd5 7. e4 dxe4 8. Qxd8+ +D41 Queen's Gambit Declined: Semi-Tarrasch Defense, Exchange Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 c5 5. cxd5 Nxd5 6. e4 +D41 Queen's Gambit Declined: Semi-Tarrasch Defense, Exchange Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 c5 5. cxd5 Nxd5 6. e4 Nxc3 7. bxc3 +D41 Queen's Gambit Declined: Semi-Tarrasch Defense, Kmoch Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Nf3 c5 5. cxd5 Nxd5 6. e4 Nxc3 7. bxc3 cxd4 8. cxd4 Bb4+ 9. Bd2 Bxd2+ 10. Qxd2 O-O 11. Bb5 +D41 Queen's Gambit Declined: Semi-Tarrasch Defense, Pillsbury Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 c5 5. cxd5 Nxd5 6. e3 +D41 Queen's Gambit Declined: Semi-Tarrasch Defense, San Sebastian Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. cxd5 Nxd5 5. e4 Nxc3 6. bxc3 c5 7. Nf3 cxd4 8. cxd4 Bb4+ 9. Bd2 Qa5 +D42 Queen's Gambit Declined: Semi-Tarrasch Defense, Main Line 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 c5 5. cxd5 Nxd5 6. e3 Nc6 7. Bd3 +D43 Semi-Slav Defense 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 +D43 Semi-Slav Defense: Anti-Moscow Gambit 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. Bg5 h6 6. Bh4 +D43 Semi-Slav Defense: Hastings Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. Bg5 h6 6. Bxf6 Qxf6 7. Qb3 +D43 Semi-Slav Defense: Moscow Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. Bg5 h6 6. Bxf6 Qxf6 +D44 Semi-Slav Defense Accepted 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. Bg5 dxc4 +D44 Semi-Slav Defense: Botvinnik Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. Bg5 dxc4 6. e4 +D44 Semi-Slav Defense: Botvinnik Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. Bg5 dxc4 6. e4 b5 7. e5 h6 8. Bh4 g5 9. Nxg5 +D44 Semi-Slav Defense: Botvinnik Variation, Alatortsev System 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 c6 5. Bg5 dxc4 6. e4 b5 7. e5 h6 8. Bh4 g5 9. Nxg5 Nd5 +D44 Semi-Slav Defense: Botvinnik Variation, Ekstrom Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. Bg5 dxc4 6. e4 b5 7. e5 h6 8. Bh4 g5 9. exf6 gxh4 10. Ne5 +D44 Semi-Slav Defense: Botvinnik Variation, Lilienthal Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. Bg5 dxc4 6. e4 b5 7. e5 h6 8. Bh4 g5 9. Nxg5 hxg5 10. Bxg5 Nbd7 11. g3 +D44 Semi-Slav Defense: Botvinnik Variation, Szabo Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 c6 5. Bg5 dxc4 6. e4 b5 7. e5 h6 8. Bh4 g5 9. Nxg5 hxg5 10. Bxg5 Nbd7 11. Qf3 +D45 Semi-Slav Defense: Accelerated Meran Variation 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 a6 +D45 Semi-Slav Defense: Main Line 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 +D45 Semi-Slav Defense: Normal Variation 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 +D45 Semi-Slav Defense: Normal Variation 1. Nf3 d5 2. e3 Nf6 3. c4 c6 4. Nc3 e6 5. b3 Bd6 6. Bb2 O-O 7. d4 Nbd7 +D45 Semi-Slav Defense: Normal Variation 1. d4 d5 2. c4 e6 3. Nc3 c6 4. Nf3 Nf6 5. e3 Nbd7 6. b3 Bd6 7. Bb2 O-O 8. Be2 +D45 Semi-Slav Defense: Rubinstein System 1. d4 d5 2. c4 e6 3. Nc3 c6 4. Nf3 Nf6 5. e3 Nbd7 6. Ne5 +D45 Semi-Slav Defense: Stoltz Variation 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Qc2 +D45 Semi-Slav Defense: Stoltz Variation 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Qc2 b6 7. b3 +D45 Semi-Slav Defense: Stoltz Variation 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Qc2 b6 7. b3 Bb7 +D45 Semi-Slav Defense: Stoltz Variation 1. d4 d5 2. Nf3 Nf6 3. c4 c6 4. e3 e6 5. Nc3 Nbd7 6. Qc2 Bd6 7. b3 +D45 Semi-Slav Defense: Stoltz Variation 1. d4 d5 2. Nf3 Nf6 3. c4 c6 4. e3 e6 5. Nc3 Nbd7 6. Qc2 Bd6 7. b3 O-O 8. Bb2 +D45 Semi-Slav Defense: Stoltz Variation, Center Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. e3 Nbd7 6. Qc2 Bd6 7. e4 +D45 Semi-Slav Defense: Stoltz Variation, Center Variation, Mikhalchishin Line 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. e3 Nbd7 6. Qc2 Bd6 7. e4 dxe4 8. Nxe4 Nxe4 9. Qxe4 e5 10. dxe5 +D45 Semi-Slav Defense: Stoltz Variation, Shabalov Attack 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. e3 Nbd7 6. Qc2 Bd6 7. g4 +D45 Semi-Slav Defense: Stonewall Defense 1. d4 d5 2. Nf3 Nf6 3. c4 c6 4. Nc3 e6 5. e3 Ne4 6. Bd3 f5 +D46 Semi-Slav Defense: Bogoljubow Variation 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Bd3 Be7 +D46 Semi-Slav Defense: Chigorin Defense 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Bd3 Bd6 +D46 Semi-Slav Defense: Chigorin Defense 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Bd3 Bd6 7. Qc2 +D46 Semi-Slav Defense: Chigorin Defense 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. b3 Bd6 7. Bb2 O-O 8. Bd3 +D46 Semi-Slav Defense: Chigorin Defense 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Qc2 b6 7. b3 Bb7 8. Bd3 +D46 Semi-Slav Defense: Chigorin Defense 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Qc2 Bd6 7. b3 O-O 8. Bb2 Re8 9. Bd3 +D46 Semi-Slav Defense: Chigorin Defense 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Qc2 Bd6 7. b3 O-O 8. Bb2 Qe7 9. Bd3 +D46 Semi-Slav Defense: Chigorin Defense 1. d4 d5 2. c4 c6 3. Nf3 e6 4. e3 Nf6 5. Nc3 Bd6 6. Bd3 dxc4 7. Bxc4 b5 8. Bd3 Nbd7 9. O-O O-O 10. Qc2 +D46 Semi-Slav Defense: Chigorin Defense 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Bd3 dxc4 7. Bxc4 b5 8. Bd3 Bd6 9. O-O Bb7 10. a3 O-O 11. Qc2 +D46 Semi-Slav Defense: Main Line 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Bd3 +D46 Semi-Slav Defense: Main Line 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Qc2 b6 7. b3 Bb7 8. Bd3 Be7 9. O-O O-O 10. Bb2 +D46 Semi-Slav Defense: Romih Variation 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Bd3 Bb4 +D47 Semi-Slav Defense: Meran Variation 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Bd3 dxc4 7. Bxc4 b5 +D47 Semi-Slav Defense: Meran Variation, Lundin Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. e3 Nbd7 6. Bd3 dxc4 7. Bxc4 b5 8. Bd3 b4 +D47 Semi-Slav Defense: Meran Variation, Wade Variation 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Bd3 dxc4 7. Bxc4 b5 8. Bd3 Bb7 +D47 Semi-Slav Defense: Meran Variation, Wade Variation, Kaidanov Gambit 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Bd3 dxc4 7. Bxc4 b5 8. Bd3 Bb7 9. e4 b4 10. Na4 c5 11. e5 Nd5 12. O-O cxd4 13. Nxd4 +D47 Semi-Slav Defense: Meran Variation, Wade Variation, Larsen Variation 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Bd3 dxc4 7. Bxc4 b5 8. Bd3 Bb7 9. e4 b4 10. Na4 c5 11. e5 Nd5 +D47 Semi-Slav Defense: Semi-Meran Variation 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Bd3 dxc4 7. Bxc4 +D48 Semi-Slav Defense: Meran Variation 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Bd3 dxc4 7. Bxc4 b5 8. Bd3 a6 +D48 Semi-Slav Defense: Meran Variation 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Bd3 dxc4 7. Bxc4 b5 8. Bd3 a6 9. e4 c5 +D48 Semi-Slav Defense: Meran Variation 1. d4 d5 2. c4 e6 3. Nc3 c6 4. e3 Nf6 5. Nf3 a6 6. Bd3 dxc4 7. Bxc4 b5 8. Bd3 c5 9. O-O Bb7 10. Qe2 +D48 Semi-Slav Defense: Meran Variation 1. d4 d5 2. c4 e6 3. Nc3 c6 4. e3 Nf6 5. Nf3 a6 6. Bd3 dxc4 7. Bxc4 b5 8. Bd3 c5 9. O-O Bb7 10. Qe2 Nbd7 +D48 Semi-Slav Defense: Meran Variation 1. d4 d5 2. c4 e6 3. Nc3 c6 4. e3 Nf6 5. Nf3 a6 6. Bd3 dxc4 7. Bxc4 b5 8. Bd3 c5 9. a4 +D48 Semi-Slav Defense: Meran Variation, Old Variation 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Bd3 dxc4 7. Bxc4 b5 8. Bd3 a6 9. e4 c5 10. e5 +D48 Semi-Slav Defense: Meran Variation, Pirc Variation 1. d4 d5 2. c4 e6 3. Nc3 c6 4. e3 Nf6 5. Nf3 Nbd7 6. Bd3 dxc4 7. Bxc4 b5 8. Bd3 a6 9. e4 b4 +D48 Semi-Slav Defense: Meran Variation, Reynolds' Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. e3 Nbd7 6. Bd3 dxc4 7. Bxc4 b5 8. Bd3 a6 9. e4 c5 10. d5 +D49 Semi-Slav Defense: Meran Variation, Blumenfeld Variation 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Bd3 dxc4 7. Bxc4 b5 8. Bd3 a6 9. e4 c5 10. e5 cxd4 11. Nxb5 +D49 Semi-Slav Defense: Meran Variation, Rabinovich Variation 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Bd3 dxc4 7. Bxc4 b5 8. Bd3 a6 9. e4 c5 10. e5 cxd4 11. Nxb5 Ng4 +D49 Semi-Slav Defense: Meran Variation, Rellstab Attack 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. Nf3 e6 5. e3 Nbd7 6. Bd3 dxc4 7. Bxc4 b5 8. Bd3 a6 9. e4 c5 10. e5 cxd4 11. Nxb5 Nxe5 12. Nxe5 axb5 13. O-O Qd5 14. Qe2 Ba6 15. Bg5 +D49 Semi-Slav Defense: Meran Variation, Sozin Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. e3 Nbd7 6. Bd3 dxc4 7. Bxc4 b5 8. Bd3 a6 9. e4 c5 10. e5 cxd4 11. Nxb5 Nxe5 +D49 Semi-Slav Defense: Meran Variation, Sozin Variation 1. d4 d5 2. Nf3 Nf6 3. c4 c6 4. Nc3 e6 5. e3 Nbd7 6. Bd3 dxc4 7. Bxc4 b5 8. Bd3 a6 9. e4 c5 10. e5 cxd4 11. Nxb5 Nxe5 12. Nxe5 axb5 13. O-O +D49 Semi-Slav Defense: Meran Variation, Stahlberg Variation 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 e6 5. Nf3 Nbd7 6. Bd3 dxc4 7. Bxc4 b5 8. Bd3 a6 9. e4 c5 10. e5 cxd4 11. Nxb5 Nxe5 12. Nxe5 axb5 13. Qf3 +D50 Queen's Gambit Declined: Been-Koomen Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 c5 +D50 Queen's Gambit Declined: Modern Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 +D50 Queen's Gambit Declined: Pseudo-Tarrasch Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 c5 5. cxd5 +D50 Queen's Gambit Declined: Pseudo-Tarrasch Variation, Canal Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 c5 5. cxd5 Qb6 +D50 Queen's Gambit Declined: Pseudo-Tarrasch Variation, Primitive Pillsbury Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 c5 5. Nf3 cxd4 6. Qxd4 +D50 Queen's Gambit Declined: Semi-Tarrasch Defense, Krause Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 c5 5. Nf3 cxd4 6. Nxd4 e5 7. Ndb5 a6 8. Qa4 +D51 Queen's Gambit Declined: Alekhine Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Nbd7 5. Nf3 c6 6. e4 +D51 Queen's Gambit Declined: Capablanca Variation, Anti-Cambridge Springs Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Nbd7 5. e3 c6 6. a3 +D51 Queen's Gambit Declined: Manhattan Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Nbd7 5. e3 Bb4 +D51 Queen's Gambit Declined: Modern Variation, Knight Defense 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Nbd7 +D51 Queen's Gambit Declined: Modern Variation, Knight Defense 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Nbd7 5. e3 +D51 Queen's Gambit Declined: Modern Variation, Knight Defense 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Nbd7 5. e3 c6 +D51 Queen's Gambit Declined: Rochlin Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Nbd7 5. Nf3 c6 6. Rc1 Qa5 7. Bd2 +D52 Queen's Gambit Declined 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. Bg5 Nbd7 6. e3 +D52 Queen's Gambit Declined: Cambridge Springs Defense 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. Bg5 Nbd7 6. e3 Qa5 +D52 Queen's Gambit Declined: Cambridge Springs Defense 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. Bg5 Nbd7 6. e3 Qa5 7. cxd5 +D52 Queen's Gambit Declined: Cambridge Springs Defense, Argentine Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Nbd7 5. e3 c6 6. Nf3 Qa5 7. Nd2 Bb4 8. Qc2 O-O 9. Bh4 +D52 Queen's Gambit Declined: Cambridge Springs Defense, Bogoljubow Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. Bg5 Nbd7 6. e3 Qa5 7. Nd2 Bb4 8. Qc2 +D52 Queen's Gambit Declined: Cambridge Springs Defense, Capablanca Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Nbd7 5. e3 c6 6. Nf3 Qa5 7. Bxf6 +D52 Queen's Gambit Declined: Cambridge Springs Defense, Rubinstein Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. Bg5 Nbd7 6. e3 Qa5 7. Nd2 dxc4 +D52 Queen's Gambit Declined: Cambridge Springs Defense, Yugoslav Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. Bg5 Nbd7 6. e3 Qa5 7. cxd5 Nxd5 +D53 Queen's Gambit Declined 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 +D53 Queen's Gambit Declined 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. Nf3 +D53 Queen's Gambit Declined 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. Nf3 c6 6. e3 dxc4 7. Bxc4 +D53 Queen's Gambit Declined 1. d4 d5 2. c4 e6 3. Nf3 Nf6 4. Nc3 dxc4 5. Bg5 Be7 +D53 Queen's Gambit Declined 1. d4 d5 2. c4 e6 3. Nf3 Nf6 4. Nc3 dxc4 5. Bg5 Be7 6. e4 +D53 Queen's Gambit Declined 1. d4 d5 2. c4 e6 3. Nf3 Nf6 4. Nc3 Nc6 5. Bg5 Be7 6. e3 O-O +D53 Queen's Gambit Declined: Lasker Defense 1. d4 Nf6 2. c4 e6 3. Nc3 d5 4. Bg5 Be7 5. e3 Ne4 +D53 Queen's Gambit Declined: Modern Variation, Heral Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. Bxf6 +D53 Queen's Gambit Declined: Uhlmann Variation 1. d4 d5 2. c4 e6 3. Nc3 Be7 4. Nf3 Nf6 5. Bg5 h6 6. Bh4 O-O 7. Rc1 dxc4 +D54 Queen's Gambit Declined: Neo-Orthodox Variation 1. d4 Nf6 2. c4 e6 3. Nc3 d5 4. Bg5 Be7 5. e3 O-O 6. Rc1 +D55 Queen's Gambit Declined: Anti-Tartakower Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 O-O 6. e3 h6 7. Bxf6 +D55 Queen's Gambit Declined: Anti-Tartakower Variation, Petrosian Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 h6 6. Bxf6 Bxf6 7. e3 O-O 8. Rc1 c6 9. Bd3 Nd7 10. O-O dxc4 11. Bxc4 +D55 Queen's Gambit Declined: Modern Variation, Normal Line 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 O-O 6. e3 +D55 Queen's Gambit Declined: Neo-Orthodox Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 O-O 6. e3 h6 +D55 Queen's Gambit Declined: Neo-Orthodox Variation, Main Line 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 h6 6. Bh4 O-O 7. e3 +D55 Queen's Gambit Declined: Pillsbury Attack 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. Nc3 d5 5. cxd5 exd5 6. Bg5 Be7 7. e3 O-O 8. Bd3 Bb7 9. Ne5 +D56 Queen's Gambit Declined 1. d4 d5 2. c4 e6 3. Nf3 Nf6 4. Nc3 Nc6 5. Bg5 Be7 6. e3 O-O 7. Rc1 h6 8. Bh4 +D56 Queen's Gambit Declined: Lasker Defense 1. d4 d5 2. c4 e6 3. Nc3 Be7 4. Nf3 Nf6 5. Bg5 h6 6. Bh4 O-O 7. e3 Ne4 +D56 Queen's Gambit Declined: Lasker Defense 1. d4 d5 2. c4 e6 3. Nf3 Nf6 4. Nc3 Nc6 5. Bg5 Be7 6. e3 O-O 7. Rc1 h6 8. Bh4 Ne4 +D56 Queen's Gambit Declined: Lasker Defense, Russian Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. e3 O-O 6. Nf3 h6 7. Bh4 Ne4 8. Bxe7 Qxe7 9. Qc2 Nf6 10. Bd3 dxc4 11. Bxc4 c5 12. O-O Nc6 13. Rfd1 Bd7 +D56 Queen's Gambit Declined: Lasker Defense, Teichmann Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 h6 6. Bh4 O-O 7. e3 Ne4 8. Bxe7 Qxe7 9. Qc2 +D57 Queen's Gambit Declined: Lasker Defense, Bernstein Variation 1. d4 Nf6 2. c4 e6 3. Nc3 d5 4. Bg5 Be7 5. e3 h6 6. Bh4 O-O 7. Nf3 Ne4 8. Bxe7 Qxe7 9. cxd5 Nxc3 10. bxc3 exd5 11. Qb3 Qd6 +D57 Queen's Gambit Declined: Lasker Defense, Bernstein Variation, Mar del Plata Gambit 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. e3 O-O 6. Nf3 h6 7. Bh4 Ne4 8. Bxe7 Qxe7 9. cxd5 Nxc3 10. bxc3 exd5 11. Qb3 Rd8 12. c4 Be6 +D57 Queen's Gambit Declined: Lasker Defense, Main Line 1. d4 d5 2. c4 e6 3. Nc3 Be7 4. Nf3 Nf6 5. Bg5 h6 6. Bh4 O-O 7. e3 Ne4 8. Bxe7 Qxe7 9. cxd5 Nxc3 10. bxc3 +D58 Queen's Gambit Declined: Tartakower Defense 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 h6 6. Bh4 O-O 7. e3 b6 +D58 Queen's Gambit Declined: Tartakower Defense, Exchange Variation 1. d4 d5 2. c4 e6 3. Nc3 Be7 4. Nf3 Nf6 5. Bg5 h6 6. Bh4 O-O 7. e3 b6 8. cxd5 exd5 +D59 Queen's Gambit Declined: Tartakower Defense 1. d4 d5 2. c4 e6 3. Nc3 Be7 4. Nf3 Nf6 5. Bg5 h6 6. Bh4 O-O 7. e3 b6 8. cxd5 Nxd5 9. Bxe7 Qxe7 10. Nxd5 exd5 11. Rc1 Be6 +D59 Queen's Gambit Declined: Tartakower Defense, Makogonov Exchange Variation 1. d4 d5 2. c4 e6 3. Nc3 Be7 4. Nf3 Nf6 5. Bg5 h6 6. Bh4 O-O 7. e3 b6 8. cxd5 Nxd5 +D60 Queen's Gambit Declined: Orthodox Defense 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 O-O 6. e3 Nbd7 +D60 Queen's Gambit Declined: Orthodox Defense, Botvinnik Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 O-O 6. e3 Nbd7 7. Bd3 +D60 Queen's Gambit Declined: Orthodox Defense, Botvinnik Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 O-O 6. e3 Nbd7 7. Bd3 c6 +D60 Queen's Gambit Declined: Orthodox Defense, Rauzer Variation 1. d4 d5 2. Nf3 Nf6 3. c4 e6 4. Nc3 Be7 5. Bg5 O-O 6. e3 Nbd7 7. Qb3 +D61 Queen's Gambit Declined: Orthodox Defense, Rubinstein Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. e3 O-O 6. Nf3 Nbd7 7. Qc2 +D61 Queen's Gambit Declined: Orthodox Defense, Rubinstein Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. e3 O-O 6. Nf3 Nbd7 7. Qc2 c5 +D61 Queen's Gambit Declined: Orthodox Defense, Rubinstein Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. e3 O-O 6. Nf3 Nbd7 7. Qc2 c6 +D61 Queen's Gambit Declined: Orthodox Defense, Rubinstein Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. e3 O-O 6. Nf3 Nbd7 7. Qc2 c6 8. a3 +D61 Queen's Gambit Declined: Orthodox Defense, Rubinstein Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. e3 O-O 6. Nf3 Nbd7 7. Qc2 a6 8. cxd5 exd5 9. Bd3 Re8 +D61 Queen's Gambit Declined: Orthodox Defense, Rubinstein Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. e3 O-O 6. Nf3 Nbd7 7. Qc2 c6 8. Rd1 a6 +D62 Queen's Gambit Declined: Orthodox Defense, Rubinstein Variation, Flohr Line 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 O-O 6. e3 Nbd7 7. Qc2 c5 8. cxd5 +D63 Queen's Gambit Declined: Orthodox Defense, Capablanca Variation 1. Nf3 d5 2. d4 Nf6 3. c4 e6 4. Nc3 Be7 5. Bg5 O-O 6. e3 Nbd7 7. Rc1 b6 8. cxd5 exd5 9. Bb5 +D63 Queen's Gambit Declined: Orthodox Defense, Henneberger Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 O-O 6. e3 Nbd7 7. Rc1 a6 +D63 Queen's Gambit Declined: Orthodox Defense, Henneberger Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 O-O 6. e3 Nbd7 7. Rc1 a6 8. c5 +D63 Queen's Gambit Declined: Orthodox Defense, Henneberger Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 O-O 6. e3 Nbd7 7. Rc1 a6 8. c5 c6 +D63 Queen's Gambit Declined: Orthodox Defense, Henneberger Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 O-O 6. e3 Nbd7 7. Rc1 a6 8. c5 c6 9. Bd3 +D63 Queen's Gambit Declined: Orthodox Defense, Main Line 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 O-O 6. e3 Nbd7 7. Rc1 +D63 Queen's Gambit Declined: Orthodox Defense, Main Line 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 O-O 6. e3 Nbd7 7. Rc1 c6 +D63 Queen's Gambit Declined: Orthodox Defense, Main Line 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. e3 Nbd7 6. Nf3 O-O 7. Rc1 h6 8. Bh4 c5 +D63 Queen's Gambit Declined: Orthodox Defense, Pillsbury Variation 1. d4 Nf6 2. c4 e6 3. Nc3 d5 4. Bg5 Be7 5. e3 O-O 6. Nf3 Nbd7 7. Rc1 b6 8. cxd5 exd5 9. Bd3 +D63 Queen's Gambit Declined: Orthodox Defense, Swiss, Carlsbad Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 O-O 6. e3 Nbd7 7. Rc1 a6 8. cxd5 +D64 Queen's Gambit Declined: Orthodox Defense, Rubinstein Attack 1. d4 Nf6 2. c4 e6 3. Nc3 d5 4. Nf3 Be7 5. Bg5 O-O 6. e3 Nbd7 7. Rc1 c6 8. a3 a6 9. Qc2 +D64 Queen's Gambit Declined: Orthodox Defense, Rubinstein Attack 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 O-O 6. e3 Nbd7 7. Rc1 c6 8. Qc2 +D64 Queen's Gambit Declined: Orthodox Defense, Rubinstein Attack 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 O-O 6. e3 Nbd7 7. Rc1 c6 8. Qc2 a6 +D64 Queen's Gambit Declined: Orthodox Defense, Rubinstein Attack 1. Nf3 d5 2. d4 Nf6 3. c4 e6 4. Nc3 Be7 5. Bg5 O-O 6. e3 Nbd7 7. Rc1 c6 8. Qc2 Ne4 +D65 Queen's Gambit Declined: Orthodox Defense, Rubinstein Attack 1. d4 d5 2. Nf3 Nf6 3. c4 e6 4. Nc3 Be7 5. Bg5 O-O 6. e3 Nbd7 7. Rc1 c6 8. Qc2 a6 9. cxd5 +D65 Queen's Gambit Declined: Orthodox Defense, Rubinstein Attack 1. d4 d5 2. Nf3 Nf6 3. c4 e6 4. Nc3 Be7 5. Bg5 O-O 6. e3 Nbd7 7. Rc1 c6 8. Qc2 a6 9. cxd5 exd5 10. Bd3 +D66 Queen's Gambit Declined: Orthodox Defense, Bd3 Line 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. e3 O-O 6. Nf3 Nbd7 7. Rc1 c6 8. Bd3 +D66 Queen's Gambit Declined: Orthodox Defense, Bd3 Line 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. e3 O-O 6. Nf3 Nbd7 7. Rc1 c6 8. Bd3 h6 9. Bh4 +D66 Queen's Gambit Declined: Orthodox Defense, Fianchetto Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 c6 5. Nf3 Be7 6. e3 Nbd7 7. Rc1 O-O 8. Bd3 dxc4 9. Bxc4 b5 +D67 Queen's Gambit Declined: Orthodox Defense, Alekhine Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. e3 O-O 6. Nf3 Nbd7 7. Rc1 c6 8. Bd3 dxc4 9. Bxc4 Nd5 10. Bxe7 Qxe7 11. Ne4 +D67 Queen's Gambit Declined: Orthodox Defense, Bd3 Line 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. e3 O-O 6. Nf3 Nbd7 7. Rc1 c6 8. Bd3 dxc4 9. Bxc4 Nd5 10. Bxe7 Qxe7 +D67 Queen's Gambit Declined: Orthodox Defense, Capablanca System 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. e3 O-O 6. Nf3 Nbd7 7. Rc1 c6 8. Bd3 dxc4 9. Bxc4 Nd5 +D67 Queen's Gambit Declined: Orthodox Defense, Janowski Variation 1. d4 d5 2. Nf3 Nf6 3. c4 e6 4. Nc3 Be7 5. Bg5 O-O 6. e3 Nbd7 7. Rc1 c6 8. Bd3 dxc4 9. Bxc4 Nd5 10. h4 +D67 Queen's Gambit Declined: Orthodox Defense, Main Line 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. e3 O-O 6. Nf3 Nbd7 7. Rc1 c6 8. Bd3 dxc4 9. Bxc4 Nd5 10. Bxe7 Qxe7 11. O-O +D68 Queen's Gambit Declined: Orthodox Defense, Classical Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. e3 O-O 6. Nf3 Nbd7 7. Rc1 c6 8. Bd3 dxc4 9. Bxc4 Nd5 10. Bxe7 Qxe7 11. O-O Nxc3 12. Rxc3 e5 +D68 Queen's Gambit Declined: Orthodox Defense, Classical Variation 1. d4 d5 2. c4 e6 3. Nf3 Nf6 4. Nc3 Be7 5. Bg5 O-O 6. e3 Nbd7 7. Rc1 c6 8. Bd3 dxc4 9. Bxc4 Nd5 10. Bxe7 Qxe7 11. O-O Nxc3 12. Rxc3 e5 13. Qb1 +D68 Queen's Gambit Declined: Orthodox Defense, Classical Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 O-O 6. e3 Nbd7 7. Rc1 c6 8. Bd3 dxc4 9. Bxc4 Nd5 10. Bxe7 Qxe7 11. O-O Nxc3 12. Rxc3 e5 13. Qc2 +D69 Queen's Gambit Declined: Orthodox Defense, Classical Variation 1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. e3 O-O 6. Nf3 Nbd7 7. Rc1 c6 8. Bd3 dxc4 9. Bxc4 Nd5 10. Bxe7 Qxe7 11. O-O Nxc3 12. Rxc3 e5 13. dxe5 Nxe5 14. Nxe5 Qxe5 +D70 Neo-Grünfeld Defense: Goglidze Attack 1. d4 Nf6 2. c4 g6 3. f3 d5 +D70 Neo-Grünfeld Defense: with Nf3 1. d4 Nf6 2. c4 g6 3. Nf3 d5 +D70 Neo-Grünfeld Defense: with g3 1. d4 Nf6 2. c4 g6 3. g3 d5 +D71 Neo-Grünfeld Defense: Exchange Variation 1. d4 Nf6 2. c4 g6 3. g3 Bg7 4. Bg2 d5 5. cxd5 Nxd5 +D71 Neo-Grünfeld Defense: Exchange Variation 1. c4 Nf6 2. g3 g6 3. Bg2 Bg7 4. d4 d5 5. cxd5 Nxd5 6. Nf3 +D72 Neo-Grünfeld Defense: with g3 1. d4 Nf6 2. c4 g6 3. g3 d5 4. Bg2 Bg7 5. cxd5 Nxd5 6. e4 Nb6 7. Ne2 +D73 Neo-Grünfeld Defense: with g3 1. d4 Nf6 2. c4 g6 3. g3 d5 4. Bg2 Bg7 5. Nf3 +D74 Neo-Grünfeld Defense: Delayed Exchange Variation 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 O-O 5. Bg2 d5 6. cxd5 Nxd5 7. O-O +D75 Neo-Grünfeld Defense: Delayed Exchange Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. Nf3 O-O 5. g3 d5 6. cxd5 Nxd5 7. Bg2 c5 8. O-O +D75 Neo-Grünfeld Defense: Delayed Exchange Variation 1. d4 Nf6 2. Nf3 g6 3. c4 Bg7 4. g3 O-O 5. Bg2 d5 6. cxd5 Nxd5 7. O-O c5 8. dxc5 +D76 Neo-Grünfeld Defense: Delayed Exchange Variation 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 O-O 5. Bg2 d5 6. cxd5 Nxd5 7. O-O Nb6 +D77 Neo-Grünfeld Defense: Classical Variation 1. d4 Nf6 2. Nf3 g6 3. g3 Bg7 4. Bg2 O-O 5. O-O d5 6. c4 +D77 Neo-Grünfeld Defense: Classical Variation, Modern Defense 1. d4 Nf6 2. Nf3 g6 3. g3 Bg7 4. Bg2 O-O 5. O-O d5 6. c4 dxc4 +D77 Neo-Grünfeld Defense: Classical Variation, Polgar Variation 1. d4 Nf6 2. Nf3 g6 3. g3 Bg7 4. Bg2 O-O 5. O-O d5 6. c4 Nc6 +D78 Neo-Grünfeld Defense: Classical Variation, Original Defense 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 O-O 5. Bg2 c6 6. O-O d5 +D79 Neo-Grünfeld Defense: Ultra-Delayed Exchange Variation 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 O-O 5. Bg2 c6 6. O-O d5 7. cxd5 cxd5 +D79 Neo-Grünfeld Defense: Ultra-Delayed Exchange Variation 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 O-O 5. Bg2 c6 6. O-O d5 7. cxd5 cxd5 8. Nc3 Nc6 +D79 Neo-Grünfeld Defense: Ultra-Delayed Exchange Variation 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 O-O 5. Bg2 c6 6. O-O d5 7. cxd5 cxd5 8. Nc3 Nc6 9. Bf4 +D79 Neo-Grünfeld Defense: Ultra-Delayed Exchange Variation 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 O-O 5. Bg2 c6 6. O-O d5 7. cxd5 cxd5 8. Nc3 Ne4 +D79 Neo-Grünfeld Defense: Ultra-Delayed Exchange Variation 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 O-O 5. Bg2 c6 6. O-O d5 7. cxd5 cxd5 8. Ne5 Nc6 9. Nc3 +D79 Neo-Grünfeld Defense: Ultra-Delayed Exchange Variation 1. d4 Nf6 2. c4 g6 3. g3 d5 4. Bg2 Bg7 5. Nf3 O-O 6. O-O c6 7. cxd5 cxd5 8. Ne5 e6 +D79 Neo-Grünfeld Defense: Ultra-Delayed Exchange Variation 1. d4 Nf6 2. c4 g6 3. g3 d5 4. Bg2 Bg7 5. Nf3 O-O 6. O-O c6 7. cxd5 cxd5 8. Ne5 e6 9. Nc3 +D79 Neo-Grünfeld Defense: Ultra-Delayed Exchange Variation 1. d4 Nf6 2. c4 g6 3. g3 d5 4. Bg2 Bg7 5. Nf3 O-O 6. O-O c6 7. cxd5 cxd5 8. Ne5 Bf5 +D79 Neo-Grünfeld Defense: Ultra-Delayed Exchange Variation 1. d4 Nf6 2. c4 g6 3. g3 d5 4. Bg2 Bg7 5. Nf3 O-O 6. O-O c6 7. cxd5 cxd5 8. Ne5 Bf5 9. Nc3 +D79 Neo-Grünfeld Defense: Ultra-Delayed Exchange Variation 1. d4 Nf6 2. c4 g6 3. g3 d5 4. Bg2 Bg7 5. Nf3 O-O 6. O-O c6 7. cxd5 cxd5 8. Ne5 Ng4 +D80 Grünfeld Defense 1. d4 Nf6 2. c4 g6 3. Nc3 d5 +D80 Grünfeld Defense: Gibbon Gambit 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. g4 +D80 Grünfeld Defense: Lundin Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Bg5 Ne4 5. Nxe4 dxe4 6. Qd2 c5 +D80 Grünfeld Defense: Lutikov Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. f3 +D80 Grünfeld Defense: Lutikov Variation, Murrey Attack 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. f3 c5 5. cxd5 Nxd5 6. Na4 +D80 Grünfeld Defense: Stockholm Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Bg5 +D80 Grünfeld Defense: Zaitsev Gambit 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. h4 +D81 Grünfeld Defense: Russian Variation, Accelerated Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Qb3 +D82 Grünfeld Defense: Brinckmann Attack 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Bf4 +D83 Grünfeld Defense: Brinckmann Attack, Grünfeld Gambit 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Bf4 Bg7 5. e3 O-O +D83 Grünfeld Defense: Brinckmann Attack, Grünfeld Gambit, Botvinnik Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Bf4 Bg7 5. e3 O-O 6. Rc1 c5 7. dxc5 Be6 +D83 Grünfeld Defense: Brinckmann Attack, Grünfeld Gambit, Capablanca Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Bf4 Bg7 5. e3 O-O 6. Rc1 +D83 Grünfeld Defense: Brinckmann Attack, Reshevsky Gambit 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Bf4 Bg7 5. Rc1 O-O 6. e3 c5 7. dxc5 Qa5 +D84 Grünfeld Defense: Brinckmann Attack, Grünfeld Gambit Accepted 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Bf4 Bg7 5. e3 O-O 6. cxd5 Nxd5 7. Nxd5 Qxd5 8. Bxc7 +D85 Grünfeld Defense: Exchange Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. cxd5 Nxd5 +D85 Grünfeld Defense: Exchange Variation, Modern Exchange Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. cxd5 Nxd5 5. e4 Nxc3 6. bxc3 Bg7 7. Nf3 +D85 Grünfeld Defense: Exchange Variation, Modern Exchange Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. cxd5 Nxd5 5. e4 Nxc3 6. bxc3 Bg7 7. Nf3 c5 +D85 Grünfeld Defense: Exchange Variation, Modern Exchange Variation 1. d4 Nf6 2. Nf3 g6 3. c4 Bg7 4. Nc3 d5 5. cxd5 Nxd5 6. e4 Nxc3 7. bxc3 c5 8. Rb1 +D85 Grünfeld Defense: Exchange Variation, Modern Exchange Variation, Kramnik's Line 1. d4 Nf6 2. Nf3 g6 3. c4 Bg7 4. Nc3 d5 5. cxd5 Nxd5 6. e4 Nxc3 7. bxc3 c5 8. h3 +D85 Grünfeld Defense: Exchange Variation, Modern Exchange Variation, Pawn Grab Line 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. cxd5 Nxd5 5. e4 Nxc3 6. bxc3 Bg7 7. Nf3 c5 8. Rb1 O-O 9. Be2 Nc6 10. d5 Bxc3+ +D85 Grünfeld Defense: Exchange Variation, Nadanian Attack 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. cxd5 Nxd5 5. Na4 +D86 Grünfeld Defense: Exchange Variation, Classical Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. cxd5 Nxd5 5. e4 Nxc3 6. bxc3 Bg7 7. Bc4 +D86 Grünfeld Defense: Exchange Variation, Larsen Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. cxd5 Nxd5 5. e4 Nxc3 6. bxc3 Bg7 7. Bc4 O-O 8. Ne2 Qd7 +D86 Grünfeld Defense: Exchange Variation, Larsen Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. cxd5 Nxd5 5. e4 Nxc3 6. bxc3 Bg7 7. Bc4 O-O 8. Ne2 Qd7 9. O-O b6 +D86 Grünfeld Defense: Exchange Variation, Simagin's Improved Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. cxd5 Nxd5 5. e4 Nxc3 6. bxc3 Bg7 7. Bc4 O-O 8. Ne2 Nc6 +D86 Grünfeld Defense: Exchange Variation, Simagin's Lesser Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. cxd5 Nxd5 5. e4 Nxc3 6. bxc3 Bg7 7. Bc4 O-O 8. Ne2 b6 +D87 Grünfeld Defense: Exchange Variation, Seville Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. cxd5 Nxd5 5. e4 Nxc3 6. bxc3 Bg7 7. Bc4 c5 8. Ne2 Nc6 9. Be3 O-O 10. O-O Bg4 11. f3 Na5 12. Bxf7+ +D87 Grünfeld Defense: Exchange Variation, Spassky Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. cxd5 Nxd5 5. e4 Nxc3 6. bxc3 Bg7 7. Bc4 c5 8. Ne2 O-O +D88 Grünfeld Defense: Exchange Variation, Spassky Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. cxd5 Nxd5 5. e4 Nxc3 6. bxc3 Bg7 7. Bc4 c5 8. Ne2 Nc6 9. Be3 O-O 10. O-O cxd4 11. cxd4 +D89 Grünfeld Defense: Exchange Variation, Sokolsky Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. cxd5 Nxd5 5. e4 Nxc3 6. bxc3 Bg7 7. Bc4 c5 8. Ne2 O-O 9. O-O Nc6 10. Be3 Bg4 11. f3 Na5 12. Bd3 cxd4 13. cxd4 Be6 14. d5 +D89 Grünfeld Defense: Exchange Variation, Spassky Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. cxd5 Nxd5 5. e4 Nxc3 6. bxc3 Bg7 7. Bc4 c5 8. Ne2 Nc6 9. Be3 O-O 10. O-O Bg4 11. f3 Na5 12. Bd3 cxd4 13. cxd4 Be6 +D90 Grünfeld Defense: Flohr Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. Qa4+ +D90 Grünfeld Defense: Three Knights Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 +D90 Grünfeld Defense: Three Knights Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 +D91 Grünfeld Defense: Three Knights Variation, Petrosian System 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. Bg5 +D92 Grünfeld Defense: Three Knights Variation, Hungarian Attack 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. Bf4 +D93 Grünfeld Defense: Three Knights Variation, Hungarian Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. Bf4 O-O 6. e3 +D94 Grünfeld Defense: Flohr Defense 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 g6 5. Nf3 Bg7 6. Bd3 O-O 7. O-O Bf5 +D94 Grünfeld Defense: Makogonov Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. e3 O-O 6. b4 +D94 Grünfeld Defense: Opocensky Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. e3 O-O 6. Bd2 +D94 Grünfeld Defense: Smyslov Defense 1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. e3 g6 5. Nf3 Bg7 6. Bd3 O-O 7. O-O Bg4 +D94 Grünfeld Defense: Three Knights Variation, Burille Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. e3 +D94 Grünfeld Defense: Three Knights Variation, Paris Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. e3 O-O 6. Bd3 +D95 Grünfeld Defense: Botvinnik Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. e3 O-O 6. Qb3 e6 +D95 Grünfeld Defense: Pachman Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. e3 Bg7 5. Qb3 dxc4 6. Bxc4 O-O 7. Nf3 Nbd7 8. Ng5 +D95 Grünfeld Defense: Three Knights Variation, Vienna Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. e3 O-O 6. Qb3 +D96 Grünfeld Defense: Russian Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. Qb3 +D97 Grünfeld Defense: Russian Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. Qb3 dxc4 6. Qxc4 O-O 7. e4 +D97 Grünfeld Defense: Russian Variation, Byrne Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. Qb3 dxc4 6. Qxc4 O-O 7. e4 Nc6 +D97 Grünfeld Defense: Russian Variation, Hungarian Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. Qb3 dxc4 6. Qxc4 O-O 7. e4 a6 +D97 Grünfeld Defense: Russian Variation, Levenfish Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. Qb3 dxc4 6. Qxc4 O-O 7. e4 b6 +D97 Grünfeld Defense: Russian Variation, Prins Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. Qb3 dxc4 6. Qxc4 O-O 7. e4 Na6 +D97 Grünfeld Defense: Russian Variation, Szabo Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. Qb3 dxc4 6. Qxc4 O-O 7. e4 c6 +D98 Grünfeld Defense: Russian Variation, Keres Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. Qb3 dxc4 6. Qxc4 O-O 7. e4 Bg4 8. Be3 Nfd7 9. Be2 Nb6 10. Qd3 Nc6 11. O-O-O +D98 Grünfeld Defense: Russian Variation, Smyslov Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. Qb3 dxc4 6. Qxc4 O-O 7. e4 Bg4 +D99 Grünfeld Defense: Russian Variation, Smyslov Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. Qb3 dxc4 6. Qxc4 O-O 7. e4 Bg4 8. Be3 Nfd7 9. Qb3 +D99 Grünfeld Defense: Russian Variation, Yugoslav Variation 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. Nf3 Bg7 5. Qb3 dxc4 6. Qxc4 O-O 7. e4 Bg4 8. Be3 Nfd7 9. Qb3 c5 diff --git a/crates/prep/data/e.tsv b/crates/prep/data/e.tsv new file mode 100644 index 0000000..93a82e1 --- /dev/null +++ b/crates/prep/data/e.tsv @@ -0,0 +1,368 @@ +eco name pgn +E00 Catalan Opening 1. d4 Nf6 2. c4 e6 3. g3 +E00 Catalan Opening 1. d4 Nf6 2. c4 e6 3. g3 d5 +E00 Catalan Opening: Hungarian Gambit 1. d4 Nf6 2. c4 e6 3. g3 e5 +E00 Indian Defense 1. d4 Nf6 2. c4 e6 3. Qb3 +E00 Indian Defense: Devin Gambit 1. d4 Nf6 2. c4 e6 3. g4 +E00 Indian Defense: Seirawan Attack 1. d4 Nf6 2. c4 e6 3. Bg5 +E01 Catalan Opening: Open Defense 1. d4 Nf6 2. c4 e6 3. g3 d5 4. Bg2 +E01 Catalan Opening: Tarrasch Defense 1. d4 Nf6 2. c4 e6 3. g3 d5 4. Bg2 c5 5. Nf3 Nc6 +E02 Catalan Opening: Open Defense 1. d4 Nf6 2. c4 e6 3. g3 d5 4. Bg2 dxc4 +E03 Catalan Opening: Open Defense 1. d4 Nf6 2. c4 e6 3. g3 d5 4. Bg2 dxc4 5. Qa4+ Nbd7 6. Qxc4 +E03 Catalan Opening: Open Defense, Alekhine Variation 1. d4 Nf6 2. c4 e6 3. g3 d5 4. Bg2 dxc4 5. Qa4+ Nbd7 6. Qxc4 a6 7. Qc2 +E04 Catalan Opening: Open Defense 1. d4 Nf6 2. c4 e6 3. g3 d5 4. Bg2 dxc4 5. Nf3 +E04 Catalan Opening: Open Defense 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. g3 c6 5. Bg2 dxc4 +E04 Catalan Opening: Open Defense, Modern Sharp Variation 1. d4 Nf6 2. c4 e6 3. g3 d5 4. Bg2 dxc4 5. Nf3 Nc6 6. Qa4 Bb4+ +E05 Catalan Opening: Open Defense, Classical Line 1. d4 Nf6 2. c4 e6 3. g3 d5 4. Bg2 dxc4 5. Nf3 Be7 +E05 Catalan Opening: Open Defense, Classical Line 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. g3 Be7 5. Bg2 O-O 6. O-O dxc4 +E06 Catalan Opening: Closed 1. d4 Nf6 2. c4 e6 3. g3 d5 4. Bg2 Be7 5. Nf3 +E06 Catalan Opening: Closed 1. c4 e6 2. Nf3 d5 3. g3 Nf6 4. Bg2 Be7 5. d4 O-O 6. O-O c6 +E06 Catalan Opening: Closed 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. g3 Bb4+ 5. Bd2 Be7 6. Bg2 O-O 7. O-O c6 8. Bf4 b6 +E06 Catalan Opening: Closed 1. d4 Nf6 2. c4 e6 3. g3 d5 4. Bg2 Be7 5. Nf3 O-O 6. O-O c6 7. Qc2 b6 8. Nbd2 Bb7 9. e4 Na6 +E07 Catalan Opening: Closed 1. d4 Nf6 2. c4 e6 3. g3 d5 4. Bg2 Be7 5. Nf3 O-O 6. O-O Nbd7 +E07 Catalan Opening: Closed, Botvinnik Variation 1. d4 Nf6 2. c4 e6 3. g3 d5 4. Bg2 Be7 5. Nf3 O-O 6. O-O Nbd7 7. Nc3 c6 8. Qd3 +E08 Catalan Opening: Closed 1. d4 Nf6 2. c4 e6 3. g3 d5 4. Bg2 Be7 5. Nf3 O-O 6. O-O Nbd7 7. Qc2 +E08 Catalan Opening: Closed 1. d4 Nf6 2. c4 e6 3. g3 d5 4. Bg2 Be7 5. Nf3 O-O 6. O-O Nbd7 7. Qc2 c6 8. b3 +E08 Catalan Opening: Closed 1. d4 Nf6 2. c4 e6 3. g3 d5 4. Bg2 Be7 5. Nf3 O-O 6. O-O Nbd7 7. Qc2 c6 8. b3 b6 +E08 Catalan Opening: Closed 1. d4 Nf6 2. c4 e6 3. g3 d5 4. Bg2 Be7 5. Nf3 O-O 6. O-O c6 7. Qc2 b6 8. Rd1 Nbd7 9. Bf4 +E08 Catalan Opening: Closed 1. d4 Nf6 2. c4 e6 3. g3 d5 4. Bg2 Be7 5. Nf3 O-O 6. O-O Nbd7 7. Qc2 c6 8. Bf4 b6 9. Nbd2 Bb7 10. e4 +E08 Catalan Opening: Closed, Spassky Gambit 1. d4 Nf6 2. c4 e6 3. g3 Be7 4. Bg2 d5 5. Nf3 O-O 6. O-O Nbd7 7. Qc2 c6 8. b3 b6 9. Rd1 Bb7 10. Nc3 b5 +E08 Catalan Opening: Closed, Zagoryansky Variation 1. d4 e6 2. c4 Nf6 3. Nf3 d5 4. g3 Be7 5. Bg2 O-O 6. O-O Nbd7 7. Qc2 c6 8. Rd1 b6 9. a4 +E09 Catalan Opening: Closed Variation, Rabinovich Variation 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Qc2 e6 5. Nbd2 Be7 6. g3 Nbd7 7. Bg2 O-O 8. O-O b5 +E09 Catalan Opening: Closed Variation, Traditional Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. g3 Be7 5. Bg2 O-O 6. O-O Nbd7 7. Qc2 c6 8. Nbd2 b6 +E09 Catalan Opening: Closed, Main Line 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. g3 Be7 5. Bg2 O-O 6. O-O Nbd7 7. Qc2 c6 8. Nbd2 +E09 Catalan Opening: Closed, Main Line 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. g3 Be7 5. Bg2 O-O 6. O-O c6 7. Qc2 b6 8. Nbd2 Bb7 9. e4 Nbd7 +E09 Catalan Opening: Closed, Main Line 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. g3 Be7 5. Bg2 O-O 6. O-O Nbd7 7. Qc2 c6 8. Bf4 b6 9. Nbd2 Bb7 10. e4 dxe4 11. Nxe4 Nxe4 12. Qxe4 +E09 Catalan Opening: Closed, Sokolsky Variation 1. d4 Nf6 2. c4 e6 3. g3 d5 4. Bg2 Be7 5. Nf3 O-O 6. O-O Nbd7 7. Qc2 c6 8. Nbd2 b6 9. b3 a5 10. Bb2 Ba6 +E10 Blumenfeld Countergambit 1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 b5 +E10 Blumenfeld Countergambit Accepted 1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 b5 5. dxe6 fxe6 6. cxb5 d5 +E10 Blumenfeld Countergambit: Duz-Khotimirsky Variation 1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 b5 5. Bg5 +E10 Blumenfeld Countergambit: Spielmann Variation 1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 b5 5. Bg5 exd5 6. cxd5 h6 +E10 Indian Defense: Anti-Nimzo-Indian 1. d4 Nf6 2. c4 e6 3. Nf3 +E10 Indian Defense: Dzindzi-Indian Defense 1. d4 Nf6 2. c4 e6 3. Nf3 a6 +E10 Indian Defense: Döry Indian 1. d4 Nf6 2. c4 e6 3. Nf3 Ne4 +E11 Bogo-Indian Defense 1. d4 Nf6 2. c4 e6 3. Nf3 Bb4+ +E11 Bogo-Indian Defense: Exchange Variation 1. d4 Nf6 2. c4 e6 3. Nf3 Bb4+ 4. Bd2 Bxd2+ +E11 Bogo-Indian Defense: Grünfeld Variation 1. d4 Nf6 2. c4 e6 3. Nf3 Bb4+ 4. Nbd2 +E11 Bogo-Indian Defense: Haiti Variation 1. d4 Nf6 2. c4 e6 3. Nf3 Bb4+ 4. Bd2 Nc6 +E11 Bogo-Indian Defense: Monticelli Trap 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 Bb4+ 6. Bd2 Bxd2+ 7. Qxd2 O-O 8. Nc3 Ne4 9. Qc2 Nxc3 10. Ng5 +E11 Bogo-Indian Defense: New England Variation 1. d4 Nf6 2. c4 e6 3. Nf3 Bb4+ 4. Nfd2 +E11 Bogo-Indian Defense: Nimzowitsch Variation 1. d4 Nf6 2. c4 e6 3. Nf3 Bb4+ 4. Bd2 Qe7 +E11 Bogo-Indian Defense: Retreat Variation 1. d4 Nf6 2. c4 e6 3. Nf3 Bb4+ 4. Bd2 Be7 +E11 Bogo-Indian Defense: Retreat Variation 1. d4 Nf6 2. c4 e6 3. g3 Bb4+ 4. Bd2 Be7 5. Bg2 d5 6. Nf3 +E11 Bogo-Indian Defense: Retreat Variation 1. d4 Nf6 2. c4 e6 3. g3 Bb4+ 4. Bd2 Be7 5. Bg2 d5 6. Nf3 O-O +E11 Bogo-Indian Defense: Retreat Variation 1. d4 Nf6 2. c4 e6 3. g3 Bb4+ 4. Bd2 Be7 5. Bg2 d5 6. Nf3 O-O 7. O-O +E11 Bogo-Indian Defense: Retreat Variation 1. d4 Nf6 2. c4 e6 3. g3 Bb4+ 4. Bd2 Be7 5. Bg2 d5 6. Nf3 O-O 7. Qc2 c6 8. O-O +E11 Bogo-Indian Defense: Retreat Variation 1. d4 Nf6 2. c4 e6 3. g3 Bb4+ 4. Bd2 Be7 5. Bg2 d5 6. Nf3 Nbd7 7. O-O O-O 8. Qc2 c6 +E11 Bogo-Indian Defense: Retreat Variation 1. d4 Nf6 2. c4 e6 3. g3 Bb4+ 4. Bd2 Be7 5. Bg2 d5 6. Nf3 Nbd7 7. O-O O-O 8. Qc2 c6 9. b3 +E11 Bogo-Indian Defense: Retreat Variation 1. d4 Nf6 2. c4 e6 3. g3 Bb4+ 4. Bd2 Be7 5. Bg2 d5 6. Nf3 Nbd7 7. O-O O-O 8. Qc2 c6 9. Rc1 +E11 Bogo-Indian Defense: Retreat Variation 1. d4 Nf6 2. c4 e6 3. g3 Bb4+ 4. Bd2 Be7 5. Bg2 d5 6. Nf3 Nbd7 7. O-O O-O 8. Qc2 c6 9. Rd1 +E11 Bogo-Indian Defense: Retreat Variation 1. d4 Nf6 2. c4 e6 3. g3 Bb4+ 4. Bd2 Be7 5. Bg2 d5 6. Nf3 Nbd7 7. O-O O-O 8. Qc2 c6 9. Rd1 h6 +E11 Bogo-Indian Defense: Retreat Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. g3 Bb4+ 5. Bd2 Be7 6. Bg2 O-O 7. O-O c6 8. Qc2 Nbd7 9. Bf4 b6 10. Nbd2 +E11 Bogo-Indian Defense: Retreat Variation 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. g3 Bb4+ 5. Bd2 Be7 6. Bg2 O-O 7. O-O c6 8. Qc2 Nbd7 9. Bf4 b6 10. Nbd2 Ba6 +E11 Bogo-Indian Defense: Vitolins Variation 1. d4 Nf6 2. c4 e6 3. Nf3 Bb4+ 4. Bd2 c5 +E11 Bogo-Indian Defense: Wade-Smyslov Variation 1. d4 Nf6 2. c4 e6 3. Nf3 Bb4+ 4. Bd2 a5 +E12 Queen's Indian Defense 1. d4 Nf6 2. c4 e6 3. Nf3 b6 +E12 Queen's Indian Defense: Kasparov Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. Nc3 +E12 Queen's Indian Defense: Kasparov Variation, Botvinnik Attack 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. Nc3 Bb7 5. Bg5 h6 6. Bh4 g5 7. Bg3 Nh5 +E12 Queen's Indian Defense: Kasparov-Petrosian Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. a3 Bb7 5. Nc3 +E12 Queen's Indian Defense: Kasparov-Petrosian Variation, Andersson Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. a3 Bb7 5. Nc3 Ne4 +E12 Queen's Indian Defense: Kasparov-Petrosian Variation, Classical Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. a3 Bb7 5. Nc3 d5 6. cxd5 exd5 +E12 Queen's Indian Defense: Kasparov-Petrosian Variation, Hedgehog Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. a3 Bb7 5. Nc3 g6 +E12 Queen's Indian Defense: Kasparov-Petrosian Variation, Kasparov Attack 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. a3 Bb7 5. Nc3 d5 6. cxd5 Nxd5 7. Qc2 +E12 Queen's Indian Defense: Kasparov-Petrosian Variation, Main Line 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. a3 Bb7 5. Nc3 d5 +E12 Queen's Indian Defense: Kasparov-Petrosian Variation, Marco Defense 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. a3 Bb7 5. Nc3 Be7 +E12 Queen's Indian Defense: Kasparov-Petrosian Variation, Modern Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. a3 Bb7 5. Nc3 d5 6. cxd5 Nxd5 +E12 Queen's Indian Defense: Kasparov-Petrosian Variation, Petrosian Attack 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. a3 Bb7 5. Nc3 d5 6. cxd5 Nxd5 7. e3 +E12 Queen's Indian Defense: Kasparov-Petrosian Variation, Polovodin Gambit 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. Nc3 Bb7 5. a3 d5 6. cxd5 Nxd5 7. e4 +E12 Queen's Indian Defense: Kasparov-Petrosian Variation, Rashkovsky Attack 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. a3 Bb7 5. Nc3 d5 6. cxd5 Nxd5 7. Qa4+ +E12 Queen's Indian Defense: Kasparov-Petrosian Variation, Romanishin Attack 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. a3 Bb7 5. Nc3 d5 6. cxd5 Nxd5 7. Bd2 +E12 Queen's Indian Defense: Miles Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. Bf4 +E12 Queen's Indian Defense: Petrosian Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. a3 +E12 Queen's Indian Defense: Petrosian Variation, Farago Defense 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. a3 Ba6 5. Qc2 Bb7 +E13 Queen's Indian Defense: Kasparov Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. Nc3 Bb4 5. Bg5 h6 6. Bh4 Bb7 +E14 Queen's Indian Defense, with e3 1. d4 Nf6 2. Nf3 e6 3. e3 b6 4. Bd3 Bb7 5. O-O c5 6. c4 +E14 Queen's Indian Defense, with e3 1. d4 Nf6 2. Nf3 e6 3. e3 b6 4. Bd3 Bb7 5. O-O c5 6. c4 Be7 +E14 Queen's Indian Defense, with e3 1. d4 Nf6 2. Nf3 e6 3. e3 b6 4. Bd3 Bb7 5. O-O c5 6. c4 g6 +E14 Queen's Indian Defense, with e3 1. d4 Nf6 2. Nf3 e6 3. e3 b6 4. Bd3 Bb7 5. O-O Be7 6. c4 O-O 7. Nc3 +E14 Queen's Indian Defense, with e3 1. d4 Nf6 2. Nf3 e6 3. e3 b6 4. Bd3 Bb7 5. Nbd2 c5 6. b3 Be7 7. Bb2 d6 8. O-O O-O 9. c4 +E14 Queen's Indian Defense, with e3 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. e3 b6 5. Nc3 Bb7 +E14 Queen's Indian Defense, with e3 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. e3 b6 5. Nc3 Bd6 6. Bd3 +E14 Queen's Indian Defense, with e3 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. e3 b6 5. Nc3 Bd6 6. Bd3 O-O 7. O-O Bb7 +E14 Queen's Indian Defense, with e3 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. e3 Be7 5. Nc3 O-O 6. b3 b6 +E14 Queen's Indian Defense, with e3 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. e3 Be7 5. b3 O-O 6. Bd3 b6 +E14 Queen's Indian Defense, with e3 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. e3 Be7 5. b3 O-O 6. Bb2 b6 7. Nbd2 Bb7 8. Bd3 +E14 Queen's Indian Defense, with e3 1. d4 Nf6 2. c4 e6 3. Nf3 Bb4+ 4. Nbd2 b6 5. a3 Bxd2+ 6. Qxd2 Bb7 7. e3 +E14 Queen's Indian Defense, with e3 1. Nf3 d5 2. e3 Nf6 3. c4 e6 4. Nc3 Be7 5. d4 O-O 6. b3 b6 7. cxd5 exd5 8. Bb2 Bb7 9. Bd3 +E14 Queen's Indian Defense, with e3 1. d4 Nf6 2. Nf3 d5 3. c4 e6 4. e3 b6 5. b3 Bb7 6. Bd3 Nbd7 7. O-O Bd6 8. Bb2 O-O 9. Nbd2 +E14 Queen's Indian Defense, with e3, Bb4+ Line 1. d4 Nf6 2. c4 e6 3. Nf3 Bb4+ 4. Nbd2 b6 5. e3 Bb7 +E14 Queen's Indian Defense: Averbakh Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. e3 Bb7 5. Bd3 c5 6. O-O Be7 7. b3 O-O 8. Bb2 cxd4 9. Nxd4 +E14 Queen's Indian Defense: Spassky System 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. e3 +E14 Queen's Indian Defense: Spassky System 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. e3 Bb7 +E14 Queen's Indian Defense: Spassky System 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. e3 Bb7 5. Bd3 +E14 Queen's Indian Defense: Spassky System 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. e3 Bb7 5. Bd3 d5 +E14 Queen's Indian Defense: Spassky System3 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. e3 Bb7 5. Bd3 c5 +E14 Queen's Indian Defense: Spassky System3 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. e3 Bb7 5. Bd3 c5 6. Nc3 cxd4 7. exd4 Be7 8. O-O d5 9. cxd5 Nxd5 +E15 Queen's Indian Defense: Buerger Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 c5 6. d5 exd5 7. Ng5 +E15 Queen's Indian Defense: Fianchetto Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 +E15 Queen's Indian Defense: Fianchetto Variation, Check Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Ba6 5. b3 Bb4+ +E15 Queen's Indian Defense: Fianchetto Variation, Check Variation, Intermezzo Line 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Ba6 5. b3 Bb4+ 6. Bd2 Be7 +E15 Queen's Indian Defense: Fianchetto Variation, Check Variation, Modern Line 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Ba6 5. b3 Bb4+ 6. Bd2 Qe7 +E15 Queen's Indian Defense: Fianchetto Variation, Nimzowitsch Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Ba6 +E15 Queen's Indian Defense: Fianchetto Variation, Nimzowitsch Variation, Nimzowitsch Attack 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Ba6 5. Qa4 +E15 Queen's Indian Defense: Fianchetto Variation, Nimzowitsch Variation, Quiet Line 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Ba6 5. b3 +E15 Queen's Indian Defense: Fianchetto Variation, Nimzowitsch Variation, Timman's Line 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Ba6 5. Qb3 +E15 Queen's Indian Defense: Fianchetto Variation, Rubinstein Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 c5 6. d5 exd5 7. Nh4 +E15 Queen's Indian Defense: Fianchetto Variation, Sämisch Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 c5 +E15 Queen's Indian Defense: Fianchetto Variation, Traditional Line 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 +E16 Queen's Indian Defense: Capablanca Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 Bb4+ +E16 Queen's Indian Defense: Capablanca Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 Bb4+ 6. Nbd2 O-O 7. O-O +E16 Queen's Indian Defense: Capablanca Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 Bb4+ 6. Nbd2 O-O 7. O-O d5 +E16 Queen's Indian Defense: Capablanca Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 Bb4+ 6. Nbd2 O-O 7. O-O a5 +E16 Queen's Indian Defense: Riumin Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 Bb4+ 6. Bd2 Be7 +E16 Queen's Indian Defense: Riumin Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 Bb4+ 6. Bd2 Be7 7. O-O O-O 8. Nc3 +E16 Queen's Indian Defense: Riumin Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 Bb4+ 6. Bd2 Be7 7. O-O O-O 8. Nc3 d5 +E16 Queen's Indian Defense: Yates Variation 1. d4 Nf6 2. c4 e6 3. Nf3 Bb4+ 4. Bd2 a5 5. g3 b6 6. Bg2 Bb7 +E17 Queen's Indian Defense: Anti-Queen's Indian System 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 Be7 6. Nc3 +E17 Queen's Indian Defense: Classical Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 Be7 6. O-O +E17 Queen's Indian Defense: Classical Variation, Polugaevsky Gambit 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 Be7 6. O-O O-O 7. d5 exd5 8. Nh4 +E17 Queen's Indian Defense: Classical Variation, Taimanov Gambit 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 Be7 6. O-O O-O 7. d5 exd5 8. Nd4 +E17 Queen's Indian Defense: Euwe Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 Be7 6. O-O O-O 7. b3 +E17 Queen's Indian Defense: Fianchetto Variation, Kramnik Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 Be7 6. O-O O-O 7. Re1 +E17 Queen's Indian Defense: Opocensky Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 Be7 6. Nc3 Ne4 7. Bd2 +E17 Queen's Indian Defense: Traditional Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 Be7 +E18 Queen's Indian Defense: Classical Variation, Tiviakov Defense 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 Be7 6. O-O O-O 7. Nc3 Na6 +E18 Queen's Indian Defense: Classical Variation, Traditional Variation 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 Be7 6. O-O O-O 7. Nc3 +E18 Queen's Indian Defense: Classical Variation, Traditional Variation, Nimzowitsch Line 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 Be7 6. O-O O-O 7. Nc3 d5 +E19 Queen's Indian Defense: Classical Variation, Traditional Variation, Main Line 1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. g3 Bb7 5. Bg2 Be7 6. O-O O-O 7. Nc3 Ne4 8. Qc2 Nxc3 9. Qxc3 +E20 Nimzo-Indian Defense 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 +E20 Nimzo-Indian Defense: Dilworth Gambit 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e4 +E20 Nimzo-Indian Defense: Kmoch Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. f3 +E20 Nimzo-Indian Defense: Mikenas Attack 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qd3 +E20 Nimzo-Indian Defense: Romanishin Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. g3 +E20 Nimzo-Indian Defense: Romanishin Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Nf3 c5 5. g3 O-O 6. Bg2 +E20 Nimzo-Indian Defense: Romanishin Variation, English Hybrid 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Nf3 c5 5. g3 cxd4 6. Nxd4 O-O 7. Bg2 d5 8. cxd5 Nxd5 +E21 Nimzo-Indian Defense: Three Knights Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Nf3 +E21 Nimzo-Indian Defense: Three Knights Variation, Euwe Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Nf3 c5 5. d5 Ne4 +E21 Nimzo-Indian Defense: Three Knights Variation, Korchnoi Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Nf3 c5 5. d5 +E21 Nimzo-Indian Defense: Three Knights Variation, Shocron Gambit 1. d4 Nf6 2. c4 e6 3. Nf3 Bb4+ 4. Nc3 c5 5. d5 b5 +E22 Nimzo-Indian Defense: Spielmann Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qb3 +E23 Nimzo-Indian Defense: Spielmann Variation, Carlsbad Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qb3 c5 5. dxc5 Nc6 6. Nf3 Ne4 7. Bd2 Nxd2 +E23 Nimzo-Indian Defense: Spielmann Variation, Romanovsky Gambit 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qb3 c5 5. dxc5 Nc6 +E23 Nimzo-Indian Defense: Spielmann Variation, Stahlberg Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qb3 c5 5. dxc5 Nc6 6. Nf3 Ne4 7. Bd2 Nxc5 +E23 Nimzo-Indian Defense: Spielmann Variation, Stahlberg Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qb3 c5 5. dxc5 Nc6 6. Nf3 Ne4 7. Bd2 Nxc5 8. Qc2 f5 9. g3 +E24 Nimzo-Indian Defense: Sämisch Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. a3 +E24 Nimzo-Indian Defense: Sämisch Variation, Botvinnik Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. f3 d5 5. a3 Bxc3+ 6. bxc3 c5 7. e3 O-O 8. cxd5 Nxd5 +E25 Nimzo-Indian Defense: Sämisch Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. f3 d5 5. a3 Bxc3+ 6. bxc3 c5 7. cxd5 +E25 Nimzo-Indian Defense: Sämisch Variation, Keres Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. f3 d5 5. a3 Bxc3+ 6. bxc3 c5 7. cxd5 Nxd5 8. dxc5 +E25 Nimzo-Indian Defense: Sämisch Variation, Romanovsky Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. f3 d5 5. a3 Bxc3+ 6. bxc3 c5 7. cxd5 Nxd5 8. dxc5 f5 +E26 Nimzo-Indian Defense: Sämisch Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. a3 Bxc3+ 5. bxc3 c5 6. e3 +E26 Nimzo-Indian Defense: Sämisch Variation, O'Kelly Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. a3 Bxc3+ 5. bxc3 c5 6. e3 b6 +E27 Nimzo-Indian Defense: Sämisch Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. a3 Bxc3+ 5. bxc3 O-O +E28 Nimzo-Indian Defense: Sämisch Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. a3 Bxc3+ 6. bxc3 +E29 Nimzo-Indian Defense: Sämisch Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 c5 5. Bd3 Nc6 6. a3 Bxc3+ 7. bxc3 O-O +E29 Nimzo-Indian Defense: Sämisch Variation, Capablanca Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 c5 5. Bd3 Nc6 6. a3 Bxc3+ 7. bxc3 O-O 8. Ne2 b6 9. e4 Ne8 +E30 Nimzo-Indian Defense: Leningrad Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Bg5 +E30 Nimzo-Indian Defense: Leningrad Variation, Averbakh Gambit 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Bg5 h6 5. Bh4 c5 6. d5 b5 +E31 Nimzo-Indian Defense: Leningrad Variation, Benoni Defense 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Bg5 h6 5. Bh4 c5 6. d5 d6 +E32 Nimzo-Indian Defense: Classical Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 +E32 Nimzo-Indian Defense: Classical Variation, Keres Defense 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 O-O 5. a3 Bxc3+ 6. Qxc3 b6 +E32 Nimzo-Indian Defense: Classical Variation, Vitolins-Adorjan Gambit 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 O-O 5. a3 Bxc3+ 6. Qxc3 b5 +E33 Nimzo-Indian Defense: Classical Variation, Milner-Barry Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 Nc6 5. Nf3 d6 +E33 Nimzo-Indian Defense: Classical Variation, Zurich Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 Nc6 +E33 Nimzo-Indian Defense: Classical Variation, Zurich Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 Nc6 5. Nf3 +E33 Nimzo-Indian Defense: Classical Variation, Zurich Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 Nc6 5. Nf3 O-O 6. e3 +E33 Nimzo-Indian Defense: Classical Variation, Zurich Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 Nc6 5. Nf3 d6 6. Bd2 +E34 Nimzo-Indian Defense: Classical Variation, Belyavsky Gambit 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 d5 5. cxd5 Qxd5 6. Nf3 Qf5 7. Qd1 e5 +E34 Nimzo-Indian Defense: Classical Variation, Noa Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 d5 +E35 Nimzo-Indian Defense: Classical Variation, Noa Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 d5 5. cxd5 exd5 +E36 Nimzo-Indian Defense: Classical Variation, Noa Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 d5 5. a3 +E36 Nimzo-Indian Defense: Classical Variation, Noa Variation, Botvinnik Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 d5 5. a3 Bxc3+ 6. Qxc3 Nc6 +E36 Nimzo-Indian Defense: Classical Variation, Noa Variation, Main Line 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 d5 5. a3 Bxc3+ 6. Qxc3 Ne4 +E36 Nimzo-Indian Defense: Classical Variation, Romanishin Gambit 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 d5 5. a3 Bxc3+ 6. Qxc3 c5 +E37 Nimzo-Indian Defense: Classical Variation, Modern Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 d5 5. a3 Bxc3+ 6. Qxc3 Ne4 7. Qc2 c5 +E37 Nimzo-Indian Defense: Classical Variation, Noa Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 d5 5. a3 Bxc3+ 6. Qxc3 Ne4 7. Qc2 +E37 Nimzo-Indian Defense: Classical Variation, Noa Variation, San Remo Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 d5 5. a3 Bxc3+ 6. Qxc3 Ne4 7. Qc2 Nc6 8. e3 e5 +E38 Nimzo-Indian Defense: Classical Variation, Berlin Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 c5 +E38 Nimzo-Indian Defense: Classical Variation, Berlin Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 O-O 5. e3 d5 6. Nf3 c5 +E38 Nimzo-Indian Defense: Classical Variation, Berlin Variation, Steiner Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 c5 5. dxc5 Bxc3+ +E39 Nimzo-Indian Defense: Classical Variation, Berlin Variation, Macieja System 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 c5 5. dxc5 O-O 6. a3 Bxc5 7. Nf3 b6 +E39 Nimzo-Indian Defense: Classical Variation, Berlin Variation, Pirc Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 c5 5. dxc5 O-O +E40 Nimzo-Indian Defense: Rubinstein System 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 +E40 Nimzo-Indian Defense: Rubinstein System, Taimanov Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 Nc6 +E41 Nimzo-Indian Defense: Rubinstein System 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 c5 +E41 Nimzo-Indian Defense: Rubinstein System, Hübner Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 c5 5. Bd3 Nc6 6. Nf3 Bxc3+ 7. bxc3 d6 +E41 Nimzo-Indian Defense: Rubinstein System, Hübner Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 c5 5. Bd3 Nc6 6. Nf3 Bxc3+ 7. bxc3 d6 8. O-O O-O +E42 Nimzo-Indian Defense: Rubinstein System, Rubinstein Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 c5 5. Ne2 +E42 Nimzo-Indian Defense: Rubinstein System, Rubinstein Variation, Main Line 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 c5 5. Ne2 cxd4 6. exd4 O-O 7. a3 +E42 Nimzo-Indian Defense: Rubinstein System, Rubinstein Variation, Sherbakov Attack 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 c5 5. Ne2 cxd4 6. exd4 O-O 7. c5 +E43 Nimzo-Indian Defense: St. Petersburg Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 b6 +E43 Nimzo-Indian Defense: St. Petersburg Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 b6 5. Bd3 Bb7 6. Nf3 +E43 Nimzo-Indian Defense: St. Petersburg Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 b6 5. Bd3 Bb7 6. Nf3 O-O +E43 Nimzo-Indian Defense: St. Petersburg Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 b6 5. Bd3 Bb7 6. Nf3 O-O 7. O-O +E43 Nimzo-Indian Defense: St. Petersburg Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 b6 5. Bd3 Bb7 6. Nf3 O-O 7. O-O c5 +E43 Nimzo-Indian Defense: St. Petersburg Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 b6 5. Bd3 Bb7 6. Nf3 O-O 7. O-O c5 8. Na4 cxd4 9. a3 Be7 +E43 Nimzo-Indian Defense: St. Petersburg Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 Ne4 5. Qc2 f5 6. Nf3 b6 7. Bd3 Bb7 +E43 Nimzo-Indian Defense: St. Petersburg Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Bd3 c5 6. Nf3 b6 7. O-O Bb7 8. Na4 Qe7 +E43 Nimzo-Indian Defense: St. Petersburg Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Nf3 Bxc3+ 5. bxc3 b6 6. e3 Bb7 7. Bd3 O-O 8. O-O +E43 Nimzo-Indian Defense: St. Petersburg Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Nf3 b6 5. e3 Ne4 6. Qc2 +E43 Nimzo-Indian Defense: St. Petersburg Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Nf3 b6 5. e3 Ne4 6. Qc2 Bb7 7. Bd3 Bxc3+ 8. bxc3 f5 9. O-O +E43 Nimzo-Indian Defense: St. Petersburg Variation, with Ne4 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 b6 5. Bd3 Bb7 6. Nf3 Ne4 +E44 Nimzo-Indian Defense: St. Petersburg Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 b6 5. Ne2 +E44 Nimzo-Indian Defense: St. Petersburg Variation, American Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 b6 5. Ne2 Ne4 +E44 Nimzo-Indian Defense: St. Petersburg Variation, Romanishin-Psakhis Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 b6 5. Ne2 c5 6. a3 Ba5 +E45 Nimzo-Indian Defense: St. Petersburg Variation, Fischer Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 b6 5. Ne2 Ba6 +E46 Nimzo-Indian Defense: Normal Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O +E46 Nimzo-Indian Defense: Reshevsky Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Ne2 +E46 Nimzo-Indian Defense: Simagin Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Ne2 d5 6. a3 Bd6 +E47 Nimzo-Indian Defense: Normal Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Bd3 +E48 Nimzo-Indian Defense: Normal Variation, Classical Defense 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Bd3 d5 +E48 Nimzo-Indian Defense: Ragozin Defense 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Bd3 d5 6. Nf3 Nc6 7. O-O +E49 Nimzo-Indian Defense: Normal Variation, Botvinnik System 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Bd3 d5 6. a3 Bxc3+ 7. bxc3 +E50 Nimzo-Indian Defense 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Nf3 +E51 Nimzo-Indian Defense: Normal Variation, Ragozin Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Nf3 d5 +E51 Nimzo-Indian Defense: Normal Variation, Ragozin Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Nf3 d5 6. Bd2 Nc6 +E51 Nimzo-Indian Defense: Normal Variation, Ragozin Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Nf3 d5 6. Bd2 Nc6 7. a3 +E51 Nimzo-Indian Defense: Normal Variation, Sämisch Deferred 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Nf3 d5 6. a3 +E51 Nimzo-Indian Defense: Ragozin Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Bd3 d5 6. Nf3 Nc6 7. O-O dxc4 +E52 Nimzo-Indian Defense: Normal Variation, Schlechter Defense 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Bd3 d5 6. Nf3 b6 +E52 Nimzo-Indian Defense: Normal Variation, Schlechter Defense 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 b6 5. Bd3 Bb7 6. Nf3 O-O 7. O-O d5 +E53 Nimzo-Indian Defense: Normal Variation, Gligoric System 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Bd3 d5 6. Nf3 c5 +E53 Nimzo-Indian Defense: Normal Variation, Gligoric System 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Bd3 d5 6. Nf3 c5 7. O-O Nbd7 +E53 Nimzo-Indian Defense: Normal Variation, Gligoric System, Keres Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Bd3 d5 6. Nf3 c5 7. O-O b6 +E54 Nimzo-Indian Defense: Normal Variation, Gligoric System, Exchange Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Bd3 d5 6. Nf3 c5 7. O-O dxc4 8. Bxc4 +E54 Nimzo-Indian Defense: Normal Variation, Gligoric System, Exchange Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Bd3 d5 6. Nf3 c5 7. O-O dxc4 8. Bxc4 cxd4 9. exd4 +E54 Nimzo-Indian Defense: Normal Variation, Gligoric System, Smyslov Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Bd3 d5 6. Nf3 c5 7. O-O dxc4 8. Bxc4 Qe7 +E55 Nimzo-Indian Defense: Normal Variation, Gligoric System, Bronstein Variation 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Bd3 d5 6. Nf3 c5 7. O-O dxc4 8. Bxc4 Nbd7 +E56 Nimzo-Indian Defense: Normal Variation, Gligoric System, Bernstein Defense 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Bd3 d5 6. Nf3 c5 7. O-O Nc6 +E57 Nimzo-Indian Defense: Normal Variation, Gligoric System, Bernstein Defense 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Bd3 d5 6. Nf3 c5 7. O-O Nc6 8. a3 dxc4 9. Bxc4 cxd4 +E58 Nimzo-Indian Defense: Normal Variation, Bernstein Defense, Exchange Line 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Bd3 d5 6. Nf3 c5 7. O-O Nc6 8. a3 Bxc3 9. bxc3 +E59 Nimzo-Indian Defense: Normal Variation, Bernstein Defense 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Bd3 d5 6. Nf3 c5 7. O-O Nc6 8. a3 Bxc3 9. bxc3 dxc4 10. Bxc4 +E59 Nimzo-Indian Defense: Normal Variation, Bernstein Defense 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 O-O 5. Bd3 d5 6. a3 Bxc3+ 7. bxc3 dxc4 8. Bxc4 c5 9. Nf3 Nc6 10. O-O Qc7 11. Qc2 +E60 Grünfeld Defense: Counterthrust Variation 1. d4 Nf6 2. c4 g6 3. g3 Bg7 4. Bg2 d5 +E60 Indian Defense: Anti-Grünfeld, Adorjan Gambit 1. d4 Nf6 2. c4 g6 3. d5 b5 +E60 Indian Defense: Anti-Grünfeld, Advance Variation 1. d4 Nf6 2. c4 g6 3. d5 +E60 Indian Defense: Anti-Grünfeld, Alekhine Variation 1. d4 Nf6 2. c4 g6 3. f3 +E60 Indian Defense: Anti-Grünfeld, Alekhine Variation, Leko Gambit 1. d4 Nf6 2. c4 g6 3. f3 e5 +E60 Indian Defense: Anti-Grünfeld, Basman-Williams Attack 1. d4 Nf6 2. c4 g6 3. h4 +E60 Indian Defense: West Indian Defense 1. d4 Nf6 2. c4 g6 +E60 King's Indian Defense: Fianchetto Variation 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 +E60 King's Indian Defense: Fianchetto Variation, Immediate Fianchetto 1. d4 Nf6 2. c4 g6 3. g3 +E60 King's Indian Defense: Normal Variation, King's Knight Variation 1. d4 Nf6 2. Nf3 g6 3. c4 +E60 King's Indian Defense: Santasiere Variation 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. b4 +E60 King's Indian Defense: Semi-Classical Variation, Benoni Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. Nf3 O-O 5. e3 d6 6. Be2 c6 +E60 King's Indian Defense: Semi-Classical Variation, Hollywood Variation 1. d4 Nf6 2. Nf3 g6 3. c4 Bg7 4. Nc3 O-O 5. e3 d6 6. Be2 Nc6 +E60 Queen's Pawn, Mengarini Attack 1. d4 Nf6 2. c4 g6 3. Qc2 +E61 King's Indian Defense 1. d4 Nf6 2. c4 g6 3. Nc3 +E61 King's Indian Defense: Fianchetto Variation, Benjamin Defense 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. Nf3 d6 5. g3 O-O 6. Bg2 c6 7. O-O Qb6 +E61 King's Indian Defense: Semi-Classical Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. Nf3 O-O 5. e3 d6 6. Be2 +E61 King's Indian Defense: Semi-Classical Variation, Exchange Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. Nf3 O-O 5. e3 d6 6. Be2 Nbd7 7. O-O e5 8. dxe5 dxe5 +E61 King's Indian Defense: Semi-Classical Variation, Queenside Storm Line 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. Nf3 O-O 5. e3 d6 6. Be2 Nbd7 7. O-O e5 8. b4 +E61 King's Indian Defense: Smyslov Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. Nf3 d6 5. Bg5 +E62 King's Indian Defense: Fianchetto Variation, Carlsbad Variation 1. d4 Nf6 2. c4 g6 3. g3 Bg7 4. Bg2 O-O 5. Nc3 d6 6. Nf3 Nc6 +E62 King's Indian Defense: Fianchetto Variation, Delayed Fianchetto 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. Nf3 d6 5. g3 +E62 King's Indian Defense: Fianchetto Variation, Kavalek Defense 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 O-O 5. Bg2 d6 6. O-O c6 7. Nc3 Qa5 +E62 King's Indian Defense: Fianchetto Variation, Larsen Defense 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. Nf3 d6 5. g3 O-O 6. Bg2 c6 7. O-O Bf5 +E62 King's Indian Defense: Fianchetto Variation, Lesser Simagin (Spassky) 1. d4 Nf6 2. c4 g6 3. g3 Bg7 4. Bg2 O-O 5. Nc3 d6 6. Nf3 Nc6 7. O-O Bf5 +E62 King's Indian Defense: Fianchetto Variation, Simagin Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. Nf3 d6 5. g3 O-O 6. Bg2 Nc6 7. O-O Bg4 +E62 King's Indian Defense: Fianchetto Variation, Uhlmann-Szabo System 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 O-O 5. Bg2 d6 6. O-O Nc6 7. Nc3 e5 +E63 King's Indian Defense: Fianchetto Variation, Panno Variation 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 O-O 5. Bg2 d6 6. O-O Nc6 7. Nc3 a6 +E63 King's Indian Defense: Fianchetto Variation, Panno Variation, Blockade Line 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 O-O 5. Bg2 d6 6. O-O Nc6 7. Nc3 a6 8. d5 Na5 9. Nd2 c5 10. Qc2 e5 +E63 King's Indian Defense: Fianchetto Variation, Panno Variation, Donner Line 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 O-O 5. Bg2 d6 6. O-O Nc6 7. Nc3 a6 8. d5 Na5 9. Nd2 c5 10. Qc2 Rb8 11. b3 b5 12. Bb2 bxc4 13. bxc4 Bh6 +E63 King's Indian Defense: Fianchetto Variation, Panno Variation, Korchnoi Line 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 O-O 5. Bg2 d6 6. O-O Nc6 7. Nc3 a6 8. h3 Rb8 9. Be3 b5 10. Nd2 +E64 King's Indian Defense: Fianchetto Variation, Double Fianchetto Attack 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 d6 5. Bg2 O-O 6. O-O Nbd7 7. Nc3 e5 8. b3 +E64 King's Indian Defense: Fianchetto Variation, Hungarian Variation 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 d6 5. Bg2 O-O 6. O-O Nbd7 7. Nc3 a6 +E64 King's Indian Defense: Fianchetto Variation, Pterodactyl Variation 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 c5 5. Bg2 Qa5+ +E64 King's Indian Defense: Fianchetto Variation, Yugoslav System 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 d6 5. Bg2 O-O 6. O-O c5 +E64 King's Indian Defense: Fianchetto Variation, Yugoslav Variation, Rare Line 1. d4 Nf6 2. c4 g6 3. g3 Bg7 4. Bg2 O-O 5. Nc3 d6 6. Nf3 c5 +E65 King's Indian Defense: Fianchetto Variation, Yugoslav Variation 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 O-O 5. Bg2 d6 6. O-O c5 7. Nc3 +E65 King's Indian Defense: Fianchetto Variation, Yugoslav Variation, Exchange Line 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 O-O 5. Bg2 d6 6. O-O c5 7. Nc3 Nc6 8. dxc5 dxc5 +E66 King's Indian Defense: Fianchetto Variation, Yugoslav Variation, Advance Line 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 O-O 5. Bg2 d6 6. O-O c5 7. Nc3 Nc6 8. d5 +E67 King's Indian Defense: Fianchetto Variation, Classical Fianchetto 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 O-O 5. Bg2 d6 6. O-O Nbd7 7. Nc3 e5 +E67 King's Indian Defense: Fianchetto Variation, Debrecen Defense 1. d4 Nf6 2. c4 g6 3. g3 Bg7 4. Bg2 O-O 5. Nc3 d6 6. Nf3 Nbd7 +E68 King's Indian Defense: Fianchetto Variation, Classical Variation 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 O-O 5. Bg2 d6 6. O-O Nbd7 7. Nc3 e5 8. e4 +E68 King's Indian Defense: Fianchetto Variation, Long Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. Nf3 d6 5. g3 O-O 6. Bg2 Nbd7 7. O-O e5 8. e4 Re8 9. h3 exd4 10. Nxd4 Nc5 11. Re1 a5 +E69 King's Indian Defense: Fianchetto Variation, Classical Main Line 1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. g3 O-O 5. Bg2 d6 6. O-O Nbd7 7. Nc3 e5 8. e4 c6 9. h3 +E70 King's Indian Defense: Accelerated Averbakh Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Bg5 +E70 King's Indian Defense: Kramer Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nge2 +E70 King's Indian Defense: Normal Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 +E70 King's Indian Defense: Normal Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 +E71 King's Indian Defense: Karpov System 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. h3 O-O 6. Be3 +E71 King's Indian Defense: Makogonov Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. h3 +E72 King's Indian Defense: Normal Variation, Deferred Fianchetto 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. g3 +E72 King's Indian Defense: Pomar System 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. g3 O-O 6. Bg2 e5 7. Nge2 +E73 King's Indian Defense: Averbakh Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Be2 O-O 6. Bg5 +E73 King's Indian Defense: Averbakh Variation, Flexible Defense 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Be2 O-O 6. Bg5 h6 +E73 King's Indian Defense: Averbakh Variation, Geller Defense 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Be2 O-O 6. Bg5 Nbd7 +E73 King's Indian Defense: Averbakh Variation, Modern Defense 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Be2 O-O 6. Bg5 Na6 +E73 King's Indian Defense: Averbakh Variation, Modern Defense, Burgess Line 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Be2 O-O 6. Bg5 Na6 7. Qd2 c6 +E73 King's Indian Defense: Averbakh Variation, Nc6 Defense 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Be2 O-O 6. Bg5 Nc6 +E73 King's Indian Defense: Averbakh Variation, Spanish Defense 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Be2 O-O 6. Bg5 a6 +E73 King's Indian Defense: Normal Variation, Standard Development 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Be2 +E73 King's Indian Defense: Semi-Averbakh System 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Be2 O-O 6. Be3 +E74 King's Indian Defense: Averbakh Variation, Benoni Defense 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Be2 O-O 6. Bg5 c5 +E74 King's Indian Defense: Averbakh Variation, Benoni Defense, Advance Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Be2 O-O 6. Bg5 c5 7. d5 +E74 King's Indian Defense: Averbakh Variation, Benoni Defense, Exchange Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Be2 O-O 6. Bg5 c5 7. dxc5 +E75 King's Indian Defense: Averbakh Variation, Main Line 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Be2 O-O 6. Bg5 c5 7. d5 e6 +E76 King's Indian Defense: Four Pawns Attack 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f4 +E76 King's Indian Defense: Four Pawns Attack, Dynamic Attack 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f4 O-O 6. Nf3 c5 7. d5 +E76 King's Indian Defense: Four Pawns Attack, Modern Defense 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f4 Na6 +E77 King's Indian Defense: Four Pawns Attack 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Be2 O-O 6. f4 +E77 King's Indian Defense: Four Pawns Attack, Florentine Gambit 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f4 O-O 6. Nf3 c5 7. d5 e6 8. Be2 exd5 9. e5 +E77 King's Indian Defense: Four Pawns Attack, Normal Attack 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f4 O-O 6. Nf3 c5 7. d5 e6 8. Be2 +E77 King's Indian Defense: Six Pawns Attack 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f4 O-O 6. Be2 c5 7. d5 e6 8. dxe6 fxe6 9. g4 Nc6 10. h4 +E78 King's Indian Defense: Four Pawns Attack, Fluid Attack 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f4 O-O 6. Nf3 c5 7. Be2 +E79 King's Indian Defense: Four Pawns Attack, Exchange Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f4 O-O 6. Nf3 c5 7. Be2 cxd4 8. Nxd4 Nc6 9. Be3 +E80 King's Indian Defense: Sämisch Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 +E81 King's Indian Defense: Steiner Attack 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Bg5 +E81 King's Indian Defense: Steiner Attack 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Bg5 c5 7. d5 h6 8. Bf4 +E81 King's Indian Defense: Steiner Attack 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Bg5 c5 7. d5 e6 8. Qd2 exd5 9. Nxd5 +E81 King's Indian Defense: Steiner Attack 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Bg5 c5 7. d5 e6 8. Qd2 h6 9. Bxh6 +E81 King's Indian Defense: Sämisch Variation, Bobotsov-Korchnoi-Petrosian Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Nge2 +E81 King's Indian Defense: Sämisch Variation, Byrne Defense 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Be3 c6 7. Bd3 a6 +E81 King's Indian Defense: Sämisch Variation, Normal Defense 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O +E81 King's Indian Defense: Sämisch Variation, Sämisch Gambit 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Be3 c5 +E81 King's Indian Defense: Sämisch Variation, Sämisch Gambit Accepted 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Be3 c5 7. dxc5 dxc5 8. Qxd8 Rxd8 9. Bxc5 +E82 King's Indian Defense: Sämisch Variation, Double Fianchetto 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Be3 b6 +E83 King's Indian Defense: Sämisch Variation, Panno Formation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Be3 Nc6 7. Nge2 a6 +E83 King's Indian Defense: Sämisch Variation, Ruban Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Be3 Nc6 7. Nge2 Rb8 +E83 King's Indian Defense: Sämisch Variation, Yates Defense 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Be3 Nc6 +E84 King's Indian Defense: Sämisch Variation, Panno Main Line 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Be3 Nc6 7. Nge2 a6 8. Qd2 Rb8 +E85 King's Indian Defense: Sämisch Variation, Orthodox Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Be3 e5 +E86 King's Indian Defense: Sämisch Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Be3 e5 7. Nge2 c6 +E87 King's Indian Defense: Sämisch Variation, Bronstein Defense 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Be3 e5 7. d5 Nh5 8. Qd2 Qh4+ 9. g3 Nxg3 10. Qf2 Nxf1 11. Qxh4 Nxe3 12. Ke2 +E87 King's Indian Defense: Sämisch Variation, Closed Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Be3 e5 7. d5 +E87 King's Indian Defense: Sämisch Variation, Orthodox Variation, Bronstein Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Be3 e5 7. d5 Nh5 8. Qd2 Qh4+ 9. g3 Nxg3 10. Qf2 Nxf1 11. Qxh4 Nxe3 12. Ke2 Nxc4 +E88 King's Indian Defense: Sämisch Variation, Closed Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Be3 e5 7. d5 c6 +E89 King's Indian Defense: Sämisch Variation, Closed Variation, Main Line 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f3 O-O 6. Be3 e5 7. Nge2 c6 8. d5 cxd5 +E90 King's Indian Defense: Larsen Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be3 +E90 King's Indian Defense: Normal Variation, Rare Defenses 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 +E90 King's Indian Defense: Zinnowitz Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Bg5 +E91 King's Indian Defense: Kazakh Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 Na6 +E91 King's Indian Defense: Orthodox Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 +E92 King's Indian Defense: Exchange Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. dxe5 +E92 King's Indian Defense: Orthodox Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 +E92 King's Indian Defense: Orthodox Variation, Gligoric-Taimanov System 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. Be3 +E92 King's Indian Defense: Petrosian Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. d5 +E92 King's Indian Defense: Petrosian Variation, Stein Defense 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. d5 a5 +E93 King's Indian Defense: Petrosian Variation, Keres Defense 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. d5 Nbd7 8. Bg5 h6 9. Bh4 g5 10. Bg3 Nh5 11. h4 +E93 King's Indian Defense: Petrosian Variation, Normal Defense 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. d5 Nbd7 +E94 King's Indian Defense: Orthodox Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O +E94 King's Indian Defense: Orthodox Variation, Donner Defense 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O c6 +E94 King's Indian Defense: Orthodox Variation, Glek Defense 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O Na6 +E94 King's Indian Defense: Orthodox Variation, Positional Defense 1. d4 Nf6 2. c4 d6 3. Nc3 Nbd7 4. e4 e5 5. Nf3 g6 6. Be2 Bg7 7. O-O O-O +E94 King's Indian Defense: Orthodox Variation, Positional Defense, Closed Line 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 Nbd7 7. O-O e5 8. d5 +E94 King's Indian Defense: Orthodox Variation, Ukrainian Defense 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O a5 +E95 King's Indian Defense: Orthodox Variation 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O Nbd7 8. Re1 +E96 King's Indian Defense: Orthodox Variation, Positional Defense, Main Line 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O Nbd7 8. Re1 c6 9. Bf1 a5 +E97 King's Indian Defense: Orthodox Variation, Aronin-Taimanov Defense 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O Nc6 +E97 King's Indian Defense: Orthodox Variation, Bayonet Attack 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O Nc6 8. d5 Ne7 9. b4 +E97 King's Indian Defense: Orthodox Variation, Bayonet Attack, Sokolov's Line 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O Nc6 8. d5 Ne7 9. b4 Nh5 10. Re1 +E97 King's Indian Defense: Orthodox Variation, Bayonet Attack, Yepishin's Line 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O Nc6 8. d5 Ne7 9. b4 Nh5 10. Qc2 +E97 King's Indian Defense: Orthodox Variation, Korchnoi Attack 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O Nc6 8. d5 Ne7 9. Bd2 +E97 King's Indian Defense: Orthodox Variation, Modern System 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O Nc6 8. d5 Ne7 9. Nd2 +E98 King's Indian Defense: Orthodox Variation, Classical System 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O Nc6 8. d5 Ne7 9. Ne1 +E98 King's Indian Defense: Orthodox Variation, Classical System, Kozul Gambit 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O Nc6 8. d5 Ne7 9. Ne1 Nd7 10. Be3 f5 11. f3 f4 12. Bf2 g5 13. Rc1 Ng6 14. c5 +E98 King's Indian Defense: Orthodox Variation, Classical System, Neo-Classical Line 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O Nc6 8. d5 Ne7 9. Ne1 Nd7 10. Be3 +E99 King's Indian Defense: Orthodox Variation, Classical System, Benko Attack 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O Nc6 8. d5 Ne7 9. Ne1 Nd7 10. f3 f5 11. g4 +E99 King's Indian Defense: Orthodox Variation, Classical System, Traditional Line 1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O Nc6 8. d5 Ne7 9. Ne1 Nd7 10. f3 f5 diff --git a/crates/prep/examples/prep_report.rs b/crates/prep/examples/prep_report.rs new file mode 100644 index 0000000..408dc0f --- /dev/null +++ b/crates/prep/examples/prep_report.rs @@ -0,0 +1,373 @@ +//! A check of the `prep` crate on a real database, printed as text: the candidates +//! for a name, the repertoire tree of each colour, the opening table, where the games +//! left the book (the database itself, or another one), and, with an engine, the +//! opening errors by opening and the repeated ones. +//! +//! ```text +//! cargo run --release -p prep --example prep_report -- "" \ +//! [--engine ] [--book ] [--plies 20] [--nodes 250000] \ +//! [--threads N] [--min-games 3] [--no-cache] +//! ``` +//! +//! The report and the evaluations are cached under `~/.cache/chesspenguin/prep/` +//! like the application would (`--no-cache` ignores and does not write it). + +use std::path::{Path, PathBuf}; +use std::sync::atomic::{AtomicBool, AtomicUsize}; +use std::time::Instant; + +use prep::{ + BookOptions, ColorReport, Options, Player, PrepReport, PositionCache, Side, Tree, +}; + +struct Args { + db: PathBuf, + player: String, + engine: Option, + book: Option, + plies: usize, + nodes: u64, + threads: u32, + min_games: u32, + cache: bool, +} + +fn args() -> Args { + let mut it = std::env::args().skip(1); + let mut a = Args { + db: PathBuf::new(), + player: String::new(), + engine: None, + book: None, + plies: prep::DEFAULT_PLIES, + nodes: 250_000, + threads: std::thread::available_parallelism() + .map(|n| (n.get() as u32 / 2).max(1)) + .unwrap_or(1), + min_games: 3, + cache: true, + }; + let mut positional = Vec::new(); + while let Some(arg) = it.next() { + match arg.as_str() { + "--engine" => a.engine = it.next().map(PathBuf::from), + "--book" => a.book = it.next().map(PathBuf::from), + "--plies" => a.plies = it.next().and_then(|v| v.parse().ok()).unwrap_or(a.plies), + "--nodes" => a.nodes = it.next().and_then(|v| v.parse().ok()).unwrap_or(a.nodes), + "--threads" => a.threads = it.next().and_then(|v| v.parse().ok()).unwrap_or(a.threads), + "--min-games" => { + a.min_games = it.next().and_then(|v| v.parse().ok()).unwrap_or(a.min_games) + } + "--no-cache" => a.cache = false, + _ => positional.push(arg), + } + } + if positional.len() < 2 { + eprintln!("usage: prep_report [--engine path] [--book path] …"); + std::process::exit(2); + } + a.db = PathBuf::from(&positional[0]); + a.player = positional[1].clone(); + a +} + +fn open(path: &Path) -> chess_import::Database { + let t = Instant::now(); + let opened = chess_import::open(path, &mut |_| {}, &AtomicBool::new(false)) + .unwrap_or_else(|e| { + eprintln!("cannot open {}: {e}", path.display()); + std::process::exit(1); + }); + println!( + "[open] {} ({}): {} games, {:.2} s", + path.display(), + opened.format.label(), + opened.db.games(), + t.elapsed().as_secs_f64() + ); + opened.db +} + +fn tally(t: &prep::Tally) -> String { + format!("{} (+{} ={} -{})", t.games, t.wins, t.draws, t.losses) +} + +fn print_tree(tree: &Tree, node: usize, depth: usize, min_games: u32, report: &PrepReport) { + for &c in &tree.nodes[node].children { + let n = &tree.nodes[c as usize]; + if n.tally.games < min_games { + continue; + } + let name = match (n.named, n.opening) { + (true, Some(o)) => format!(" — {}", report.openings[o].name), + _ => String::new(), + }; + println!( + "{:indent$}{} {} {}{}{}{}", + "", + prep::move_label(usize::from(n.ply) - 1, &n.san), + tally(&n.tally), + n.last_date, + n.average_elo().map_or(String::new(), |e| format!(" Elo {e}")), + if n.transposition { " ↔" } else { "" }, + name, + indent = depth * 2 + ); + if depth < 8 { + print_tree(tree, c as usize, depth + 1, min_games, report); + } + } +} + +fn print_color(report: &PrepReport, cr: &ColorReport, min_games: u32) { + let colour = if cr.white { "White" } else { "Black" }; + println!("\n==== {colour}: {} games, {} tree nodes ====", cr.games.len(), cr.tree.nodes.len()); + println!("-- repertoire (nodes with at least {min_games} games; ↔ = transposition)"); + print_tree(&cr.tree, 0, 0, min_games, report); + println!("-- openings"); + for f in &cr.families { + println!( + "{} {}{}", + tally(&f.tally), + if f.name.is_empty() { "(unnamed)" } else { &f.name }, + errors_text(&f.errors) + ); + for v in &f.variations { + let (name, line, eco) = match v.opening { + Some(o) => { + let o = &report.openings[o]; + (o.name.as_str(), o.line.as_str(), o.eco.as_str()) + } + None => ("(unnamed)", "", ""), + }; + let games: Vec = v + .games + .iter() + .map(|&g| format!("#{}", report.games[g as usize].index + 1)) + .collect(); + println!( + " {} {eco} {name} [{line}]{} — {}", + tally(&v.tally), + errors_text(&v.errors), + games.join(" ") + ); + } + } + if report.book.is_some() { + let (own, other) = cr.book_exits(&report.games); + let total = cr.games.len() as u32; + println!( + "-- book: left by his own move in {own} games, by the opponent's in {other}, \ + within the book for the whole line in {}", + total - own - other + ); + let mut by_ply: Vec<(u32, bool, u32)> = cr + .games + .iter() + .filter_map(|&g| report.games[g as usize].book) + .map(|b| (b.ply, b.by_player, 1)) + .collect(); + by_ply.sort_unstable(); + by_ply.dedup_by(|a, b| { + if a.0 == b.0 && a.1 == b.1 { + b.2 += a.2; + true + } else { + false + } + }); + let text: Vec = by_ply + .iter() + .map(|(ply, own, n)| format!("ply {ply}{}: {n}", if *own { " (his)" } else { "" })) + .collect(); + println!(" {}", text.join(", ")); + } + if !cr.errors.is_empty() || report.engine.is_some() { + println!( + "-- errors: {} inaccuracies, {} mistakes, {} blunders in the player's moves", + cr.counts.inaccuracies, cr.counts.mistakes, cr.counts.blunders + ); + for e in &cr.errors { + let g = &report.games[e.game as usize]; + println!( + " #{} {} {:?}: {} (best {}) {} → {} [{}]", + g.index + 1, + g.move_label(e.ply as usize), + e.judgement, + e.san, + e.best_san, + e.before.format(), + e.after.format(), + e.opening.map_or("", |o| report.openings[o].name.as_str()) + ); + } + println!("-- repeated errors (same position, same move, two or more games)"); + for r in &cr.repeated { + let games: Vec = r + .games + .iter() + .map(|&g| format!("#{}", report.games[g as usize].index + 1)) + .collect(); + println!( + " {}× {} {:?} (best {}) {} — {} [{}]", + r.times(), + prep::move_label(r.ply as usize, &r.san), + r.judgement, + r.best_san, + tally(&r.tally), + games.join(" "), + r.opening.map_or("", |o| report.openings[o].name.as_str()) + ); + } + } +} + +fn errors_text(e: &prep::ErrorCounts) -> String { + if e.total() == 0 { + String::new() + } else { + format!(" ?!{} ?{} ??{}", e.inaccuracies, e.mistakes, e.blunders) + } +} + +fn main() { + let a = args(); + let db = open(&a.db); + let never = AtomicBool::new(false); + let cache_dir = a.cache.then(|| { + std::env::home_dir() + .unwrap_or_else(|| PathBuf::from(".")) + .join(".cache/chesspenguin/prep") + }); + + let t = Instant::now(); + let (list, total) = prep::candidates(&db, &a.player, 10); + println!("[candidates] {total} for «{}», {:.1} ms:", a.player, t.elapsed().as_secs_f64() * 1000.0); + for c in &list { + println!(" {} · {} games (id {})", c.name, c.games, c.id); + } + let Some(chosen) = list + .iter() + .find(|c| c.name.to_lowercase() == a.player.to_lowercase()) + .or(list.first()) + else { + eprintln!("no such player"); + std::process::exit(1); + }; + let player = Player::new([chosen.id]); + println!("[player] {} ({} games)", chosen.name, chosen.games); + + let options = Options { + plies: a.plies, + side: Side::Any, + }; + let t = Instant::now(); + let cached = cache_dir + .as_deref() + .and_then(|d| PrepReport::load(d, &db, &player, &options)); + let mut report = match cached { + Some(r) => { + println!("[report] from the cache, {:.1} ms", t.elapsed().as_secs_f64() * 1000.0); + r + } + None => { + let progress = AtomicUsize::new(0); + let r = prep::build(&db, &player, &options, &progress, &never).expect("not cancelled"); + println!( + "[report] built: {} games ({} skipped), {} plies, {} openings named, {:.1} ms", + r.games.len(), + r.skipped, + r.plies, + r.openings.len(), + t.elapsed().as_secs_f64() * 1000.0 + ); + r + } + }; + + // The book: another database, or this one without the player's own games. + let t = Instant::now(); + let book_options = BookOptions { + threshold: prep::DEFAULT_BOOK_THRESHOLD, + same_database: a.book.is_none(), + }; + let book = a.book.as_deref().map(open); + let book_db = book.as_ref().unwrap_or(&db); + if report.book.as_ref().is_some_and(|b| b.fingerprint == prep::fingerprint(book_db)) { + println!("[book] from the cached report"); + } else { + let progress = AtomicUsize::new(0); + match report.find_book_exits(book_db, &book_options, &progress, &never) { + Some(()) => println!( + "[book] threshold {}: {} of {} games left the book, {:.2} s", + book_options.threshold, + report.book.as_ref().map_or(0, |b| b.left), + report.games.len(), + t.elapsed().as_secs_f64() + ), + None => println!("[book] not searchable (no memory for the position table?)"), + } + } + + for cr in [&report.white, &report.black] { + print_color(&report, cr, a.min_games); + } + + if let Some(engine) = &a.engine { + let mut cache = cache_dir + .as_deref() + .map(PositionCache::load) + .unwrap_or_default(); + println!( + "\n[engine] {} positions, {} distinct; {} cached evaluations on disk", + report.games.iter().map(|g| g.keys.len()).sum::(), + report.distinct_positions(), + cache.len() + ); + let settings = game_review::JobSettings { + threads: a.threads, + hash_mb: 256, + nodes: a.nodes, + eval_file: None, + }; + let t = Instant::now(); + let mut last_shown = Instant::now(); + let mut first = true; + let result = prep::analyse( + &mut report, + &mut cache, + cache_dir.as_deref(), + uci::EngineConfig::new(engine.clone()), + &settings, + &never, + &mut |p| { + if first { + println!("[engine] {} positions to evaluate at {} nodes, {} threads", p.total, a.nodes, a.threads); + first = false; + } + if last_shown.elapsed().as_secs_f64() >= 5.0 { + println!(" {} / {} ({:.0} s, nps {})", p.done, p.total, t.elapsed().as_secs_f64(), p.nps); + last_shown = Instant::now(); + } + }, + ); + match result { + Ok(()) => println!( + "[engine] done in {:.1} s; {} evaluations in the cache; engine {}", + t.elapsed().as_secs_f64(), + cache.len(), + report.engine.as_ref().map_or("?", |e| e.name.as_str()) + ), + Err(e) => println!("[engine] failed: {e:?}"), + } + for cr in [&report.white, &report.black] { + print_color(&report, cr, u32::MAX); + } + } + if let Some(dir) = &cache_dir { + match report.save(dir) { + Ok(()) => println!("[cache] report saved in {}", dir.display()), + Err(e) => println!("[cache] not saved: {e}"), + } + } +} diff --git a/crates/prep/src/book.rs b/crates/prep/src/book.rs new file mode 100644 index 0000000..f2283a4 --- /dev/null +++ b/crates/prep/src/book.rs @@ -0,0 +1,102 @@ +//! Where the player's games leave the book: a second database (a big one from the +//! shelf, or an opening database) is the book, and a game has left it at the first +//! position the book has fewer than a threshold of games for. Whose move led out — +//! the player's or the opponent's — says whether it is his own choice. +//! +//! The positions of a line are searched the way the reference panel finds the end +//! of the theory ([`theory_end`]): the first plies one by one (an opening index +//! answers them at once), then by doubling and halving. Counts are kept per +//! position within one pass: the player's games share their openings. + +use std::collections::{HashMap, HashSet}; +use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; + +use chess_core::shakmaty::uci::UciMove; +use chess_core::shakmaty::{Chess, Position}; +use chess_import::Database; +use chess_import::position::{PositionQuery, theory_end}; + +use crate::games::{BookExit, GameInfo}; + +/// How the book is read. +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct BookOptions { + /// A position with fewer games than this in the book is out of it. + pub threshold: u32, + /// The book is the database the report was built from: the player's own games + /// do not count. + pub same_database: bool, +} + +impl Default for BookOptions { + fn default() -> Self { + BookOptions { + threshold: crate::DEFAULT_BOOK_THRESHOLD, + same_database: false, + } + } +} + +/// Fills in [`GameInfo::book`] of every game; `progress` counts the games done. +/// Returns how many games left the book within their line. `None` when cancelled +/// (or when the book cannot be searched: a PGN book without memory for its table). +pub(crate) fn find_exits( + games: &mut [GameInfo], + book: &Database, + options: &BookOptions, + progress: &AtomicUsize, + cancel: &AtomicBool, +) -> Option { + let exclude: HashSet = if options.same_database { + games.iter().map(|g| g.index).collect() + } else { + HashSet::new() + }; + let mut counts: HashMap = HashMap::new(); + let mut left = 0; + for game in games.iter_mut() { + if cancel.load(Ordering::Relaxed) { + return None; + } + progress.fetch_add(1, Ordering::Relaxed); + let mut pos = Chess::default(); + let mut positions = vec![pos.clone()]; + let mut moves = Vec::with_capacity(game.ucis.len()); + for u in &game.ucis { + let Some(m) = u.parse::().ok().and_then(|u| u.to_move(&pos).ok()) else { + break; + }; + pos.play_unchecked(m); + moves.push(m); + positions.push(pos.clone()); + } + let keys = &game.keys; + let mut count_of = |i: usize| -> Option { + if let Some(c) = counts.get(&keys[i]) { + return Some(*c); + } + let q = PositionQuery::new(positions[i].clone(), Some(moves[..i].to_vec())); + let out = book.search_position(None, &q, &AtomicUsize::new(0), cancel)?; + let c = out + .matches + .iter() + .filter(|m| !exclude.contains(&m.index)) + .count() as u32; + counts.insert(keys[i], c); + Some(c) + }; + let end = theory_end(positions.len(), 0, |i| { + Some(count_of(i)? >= options.threshold) + })?; + game.book = end.first_unknown.map(|i| { + left += 1; + BookExit { + ply: i as u32, + // Position 0 is the start: a book without it is empty. + by_player: i > 0 && game.player_moves_at(i - 1), + count: counts.get(&game.keys[i]).copied().unwrap_or(0), + } + }); + } + Some(left) +} diff --git a/crates/prep/src/errors.rs b/crates/prep/src/errors.rs new file mode 100644 index 0000000..8ac3739 --- /dev/null +++ b/crates/prep/src/errors.rs @@ -0,0 +1,391 @@ +//! Opening errors found by the engine: every distinct position of the first plies of +//! the player's games is evaluated once (the games repeat their openings, so about +//! half the positions are shared), and the player's moves are judged from the +//! evaluations before and after them with the rules of the game analysis. The same +//! error in several games — the same position and the same move — is what matters +//! most for preparation, so those are listed on their own. +//! +//! Evaluations are kept per position in a cache file shared by every report: another +//! player of the same database, or the same player later, is judged from the cache. + +use std::collections::HashMap; +use std::path::{Path, PathBuf}; + +use chess_core::shakmaty::san::SanPlus; +use chess_core::shakmaty::uci::UciMove; +use chess_core::shakmaty::{Chess, Color, Position}; +use game_review::{Eval, Judgement, PosEval}; +use serde::{Deserialize, Serialize}; + +use crate::games::{GameInfo, Tally}; + +/// Nodes of an evaluation that needs no engine (checkmate, stalemate): better than any +/// search. +pub const EXACT: u64 = u64::MAX; + +/// The engine's result for one position. +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PositionEval { + /// Nodes of the search ([`EXACT`] for a position without legal moves). + pub nodes: u64, + pub eval: Eval, + /// The engine's line in UCI; the first move is its best move. + pub pv: Vec, + pub depth: u32, +} + +impl PositionEval { + pub fn from_engine(nodes: u64, e: &PosEval) -> PositionEval { + PositionEval { + nodes, + eval: e.eval, + pv: e.pv.iter().take(8).cloned().collect(), + depth: e.depth, + } + } + + pub fn best(&self) -> Option<&str> { + self.pv.first().map(String::as_str) + } +} + +/// How many inaccuracies, mistakes and blunders. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] +pub struct ErrorCounts { + pub inaccuracies: u32, + pub mistakes: u32, + pub blunders: u32, +} + +impl ErrorCounts { + pub fn add(&mut self, j: Judgement) { + match j { + Judgement::Inaccuracy => self.inaccuracies += 1, + Judgement::Mistake => self.mistakes += 1, + Judgement::Blunder => self.blunders += 1, + Judgement::Great | Judgement::Brilliant => {} + } + } + + pub fn total(&self) -> u32 { + self.inaccuracies + self.mistakes + self.blunders + } +} + +/// A move of the player judged an inaccuracy, a mistake or a blunder. +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct OpeningError { + /// Index into [`crate::PrepReport::games`]. + pub game: u32, + /// The move's place in the line (0-based; see [`GameInfo::move_label`]). + pub ply: u32, + /// The position before the move. + pub key: u64, + pub uci: String, + pub san: String, + /// The engine's move instead. + pub best_uci: String, + pub best_san: String, + pub judgement: Judgement, + pub before: Eval, + pub after: Eval, + /// The game's opening ([`crate::PrepReport::openings`]). + pub opening: Option, +} + +/// The same error in several games: the same position and the same move. +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RepeatedError { + pub key: u64, + pub ply: u32, + pub uci: String, + pub san: String, + pub best_san: String, + pub judgement: Judgement, + /// The games (indices into [`crate::PrepReport::games`]), in order. + pub games: Vec, + /// How those games ended. + pub tally: Tally, + /// The opening of the first of them. + pub opening: Option, +} + +impl RepeatedError { + pub fn times(&self) -> u32 { + self.games.len() as u32 + } +} + +/// Judges the player's moves in `games[g]` for `g` in `which` from `evals`: the +/// move is not the engine's best, and the evaluations before and after it say it +/// lost enough (the rules of the game analysis, [`game_review::judge`]). +pub fn judge_games( + games: &[GameInfo], + which: &[u32], + evals: &HashMap, +) -> Vec { + let mut out = Vec::new(); + for &g in which { + let game = &games[g as usize]; + let mover = if game.white { Color::White } else { Color::Black }; + let mut pos = Chess::default(); + for (i, uci) in game.ucis.iter().enumerate() { + let Some(m) = uci.parse::().ok().and_then(|u| u.to_move(&pos).ok()) else { + break; + }; + if game.player_moves_at(i) + && let (Some(before), Some(after)) = + (evals.get(&game.keys[i]), evals.get(&game.keys[i + 1])) + && let Some(best) = before.best() + && best != uci + && let Some(judgement) = game_review::judge(before.eval, after.eval, mover) + { + let best_san = best + .parse::() + .ok() + .and_then(|u| u.to_move(&pos).ok()) + .map(|bm| SanPlus::from_move(pos.clone(), bm).to_string()) + .unwrap_or_else(|| best.to_owned()); + out.push(OpeningError { + game: g, + ply: i as u32, + key: game.keys[i], + uci: uci.clone(), + san: game.sans.get(i).cloned().unwrap_or_default(), + best_uci: best.to_owned(), + best_san, + judgement, + before: before.eval, + after: after.eval, + opening: game.opening, + }); + } + pos.play_unchecked(m); + } + } + out +} + +/// The errors made in two or more games (same position, same move), most repeated +/// first, then the worst first. +pub fn repeated(errors: &[OpeningError], games: &[GameInfo]) -> Vec { + let mut groups: HashMap<(u64, &str), Vec<&OpeningError>> = HashMap::new(); + for e in errors { + groups.entry((e.key, e.uci.as_str())).or_default().push(e); + } + let mut out: Vec = groups + .into_values() + .filter(|g| g.len() >= 2) + .map(|g| { + let first = g[0]; + let mut tally = Tally::default(); + let mut list: Vec = g.iter().map(|e| e.game).collect(); + list.sort_unstable(); + list.dedup(); + for &game in &list { + tally.add(games[game as usize].outcome); + } + RepeatedError { + key: first.key, + ply: first.ply, + uci: first.uci.clone(), + san: first.san.clone(), + best_san: first.best_san.clone(), + judgement: first.judgement, + games: list, + tally, + opening: first.opening, + } + }) + .filter(|r| r.games.len() >= 2) + .collect(); + out.sort_by(|a, b| { + b.games + .len() + .cmp(&a.games.len()) + .then(b.judgement.cmp(&a.judgement)) + .then(a.ply.cmp(&b.ply)) + .then(a.games.cmp(&b.games)) + }); + out +} + +// ----- the cache of evaluations by position -------------------------------------- + +const CACHE_FILE: &str = "positions.json"; +const CACHE_VERSION: u32 = 1; +/// Positions kept at most (about 100 bytes each on disk). +const CACHE_LIMIT: usize = 1_000_000; + +#[derive(Serialize, Deserialize)] +struct CacheFile { + version: u32, + positions: Vec<(u64, PositionEval)>, +} + +/// Engine evaluations by position, shared by every report: the best quality (most +/// nodes) seen for each position is kept. +#[derive(Default)] +pub struct PositionCache { + entries: HashMap, + dirty: bool, +} + +impl PositionCache { + fn path(dir: &Path) -> PathBuf { + dir.join(CACHE_FILE) + } + + /// The cache in `dir` (empty when there is none, or it cannot be read). + pub fn load(dir: &Path) -> PositionCache { + let entries = std::fs::read(Self::path(dir)) + .ok() + .and_then(|bytes| serde_json::from_slice::(&bytes).ok()) + .filter(|f| f.version == CACHE_VERSION) + .map(|f| f.positions.into_iter().collect()) + .unwrap_or_default(); + PositionCache { + entries, + dirty: false, + } + } + + pub fn len(&self) -> usize { + self.entries.len() + } + + pub fn is_empty(&self) -> bool { + self.entries.is_empty() + } + + pub fn get(&self, key: u64) -> Option<&PositionEval> { + self.entries.get(&key) + } + + /// Keeps `eval` unless the cache has one with more nodes; says whether it was kept. + pub fn insert(&mut self, key: u64, eval: PositionEval) -> bool { + if self.entries.get(&key).is_some_and(|e| e.nodes >= eval.nodes) { + return false; + } + self.entries.insert(key, eval); + self.dirty = true; + true + } + + /// Something was added since the load or the last save. + pub fn dirty(&self) -> bool { + self.dirty + } + + /// Writes the cache to `dir` (through a temporary file, so a crash never leaves + /// half a file); nothing when nothing changed. + pub fn save(&mut self, dir: &Path) -> std::io::Result<()> { + if !self.dirty { + return Ok(()); + } + let mut positions: Vec<(u64, PositionEval)> = + self.entries.iter().map(|(k, v)| (*k, v.clone())).collect(); + if positions.len() > CACHE_LIMIT { + // Over the limit the searches with the fewest nodes go first. + positions.sort_by_key(|a| std::cmp::Reverse(a.1.nodes)); + positions.truncate(CACHE_LIMIT); + } + let file = CacheFile { + version: CACHE_VERSION, + positions, + }; + let bytes = serde_json::to_vec(&file).map_err(std::io::Error::other)?; + write_atomic(&Self::path(dir), &bytes)?; + self.dirty = false; + Ok(()) + } +} + +/// Writes through a temporary file and a rename. +pub(crate) fn write_atomic(path: &Path, bytes: &[u8]) -> std::io::Result<()> { + if let Some(dir) = path.parent() { + std::fs::create_dir_all(dir)?; + } + let tmp = path.with_extension("json.tmp"); + std::fs::write(&tmp, bytes)?; + std::fs::rename(&tmp, path) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::tree::tests::game; + + fn eval(nodes: u64, cp: i32, best: &str) -> PositionEval { + PositionEval { + nodes, + eval: Eval::Cp(cp), + pv: vec![best.to_owned()], + depth: 10, + } + } + + #[test] + fn the_same_error_in_two_games_is_repeated() { + // Three games of the player with White: 1.e4 e5 2.Qh5?! twice, 2.Nf3 once. + let games = vec![ + game(0, true, &["e4", "e5", "Qh5", "Nc6"], "1-0", "", 0), + game(1, true, &["e4", "e5", "Qh5", "Nf6"], "0-1", "", 0), + game(2, true, &["e4", "e5", "Nf3", "Nc6"], "1/2-1/2", "", 0), + game(3, false, &["e4", "e5", "Qh5", "Nc6"], "0-1", "", 0), + ]; + let mut evals = HashMap::new(); + evals.insert(games[0].keys[0], eval(1000, 30, "e2e4")); + evals.insert(games[0].keys[1], eval(1000, 30, "e7e5")); + // 2.Qh5 drops from +0.3 to −1.0: a mistake; 2.Nf3 is the engine's move. + evals.insert(games[0].keys[2], eval(1000, 30, "g1f3")); + evals.insert(games[0].keys[3], eval(1000, -100, "b8c6")); + evals.insert(games[1].keys[3], eval(1000, -100, "g8f6")); + evals.insert(games[2].keys[3], eval(1000, 30, "b8c6")); + let errors = judge_games(&games, &[0, 1, 2], &evals); + assert_eq!(errors.len(), 2); + assert_eq!(errors[0].game, 0); + assert_eq!(errors[0].ply, 2); + assert_eq!(errors[0].san, "Qh5"); + assert_eq!(errors[0].best_san, "Nf3"); + assert_eq!(errors[0].judgement, Judgement::Mistake); + assert_eq!(errors[1].game, 1); + let rep = repeated(&errors, &games); + assert_eq!(rep.len(), 1); + assert_eq!(rep[0].games, vec![0, 1]); + assert_eq!(rep[0].times(), 2); + assert_eq!((rep[0].tally.wins, rep[0].tally.losses), (1, 1)); + // Black's moves in game 3 are the player's: 2.Qh5 is the opponent's there. + let evals_black = evals.clone(); + assert!(judge_games(&games, &[3], &evals_black).is_empty()); + // A position without an evaluation after the move is not judged (the two + // games share the position after 2.Qh5). + let mut partial = evals.clone(); + partial.remove(&games[1].keys[3]); + assert!(judge_games(&games, &[0, 1, 2], &partial).is_empty()); + // One game less: nothing repeats. + assert!(repeated(&judge_games(&games, &[0, 2], &evals), &games).is_empty()); + } + + #[test] + fn the_position_cache_keeps_the_best_quality_and_survives_a_save() { + let dir = std::env::temp_dir().join(format!("prep-cache-test-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + let mut c = PositionCache::load(&dir); + assert!(c.is_empty()); + assert!(c.insert(1, eval(1000, 10, "e2e4"))); + assert!(!c.insert(1, eval(250, 20, "d2d4")), "fewer nodes: not kept"); + assert!(c.insert(1, eval(3000, 30, "c2c4"))); + assert!(c.insert(2, eval(EXACT, 0, ""))); + assert_eq!(c.get(1).map(|e| e.nodes), Some(3000)); + assert!(c.dirty()); + c.save(&dir).expect("saved"); + assert!(!c.dirty()); + let d = PositionCache::load(&dir); + assert_eq!(d.len(), 2); + assert_eq!(d.get(1), c.get(1)); + assert_eq!(d.get(2).map(|e| e.nodes), Some(EXACT)); + assert_eq!(d.get(3), None); + let _ = std::fs::remove_dir_all(&dir); + } +} diff --git a/crates/prep/src/games.rs b/crates/prep/src/games.rs new file mode 100644 index 0000000..d0cc1da --- /dev/null +++ b/crates/prep/src/games.rs @@ -0,0 +1,227 @@ +//! The player's games as the report sees them: the first plies of the main line with +//! the keys of its positions, the result from the player's side, the date and the +//! opponent's rating. Games from a set-up position are left out. + +use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; + +use chess_core::shakmaty::san::SanPlus; +use chess_core::shakmaty::{Chess, Position}; +use chess_import::Database; +use chess_import::pgn_catalog::date_number; +use chess_import::position::{key, uci}; +use serde::{Deserialize, Serialize}; + +use crate::openings::{self, OpeningSet}; + +/// A game's result from the player's side. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum Outcome { + Win, + Draw, + Loss, + Unknown, +} + +impl Outcome { + /// From the result tag and the player's colour. + pub fn of(result: &str, white: bool) -> Outcome { + match (result.trim(), white) { + ("1-0", true) | ("0-1", false) => Outcome::Win, + ("1-0", false) | ("0-1", true) => Outcome::Loss, + ("1/2-1/2" | "½-½", _) => Outcome::Draw, + _ => Outcome::Unknown, + } + } +} + +/// Games and their results from the player's side. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] +pub struct Tally { + pub games: u32, + pub wins: u32, + pub draws: u32, + pub losses: u32, +} + +impl Tally { + pub fn add(&mut self, outcome: Outcome) { + self.games += 1; + match outcome { + Outcome::Win => self.wins += 1, + Outcome::Draw => self.draws += 1, + Outcome::Loss => self.losses += 1, + Outcome::Unknown => {} + } + } + + /// Points per game, 0..1, over the games with a result. + pub fn score(&self) -> Option { + let decided = self.wins + self.draws + self.losses; + (decided > 0).then(|| (f64::from(self.wins) + 0.5 * f64::from(self.draws)) / f64::from(decided)) + } +} + +/// Where a game left the book (see [`crate::PrepReport::find_book_exits`]). +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub struct BookExit { + /// Moves played when the line reached its first position the book rarely has: + /// move `ply - 1` (0-based, [`GameInfo::ucis`]) led out of the book. + pub ply: u32, + /// That move was the player's. + pub by_player: bool, + /// Games of the book with the position (below the threshold). + pub count: u32, +} + +/// One game of the player. +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GameInfo { + /// Record index in the database. + pub index: u32, + /// The player had White. + pub white: bool, + pub opponent: String, + /// 0: unknown. + pub opponent_elo: u16, + /// PGN form ("2026.10.18", "1997.05.??"), empty when unknown. + pub date: String, + pub outcome: Outcome, + /// The first moves of the main line (at most the report's plies), UCI and SAN. + pub ucis: Vec, + pub sans: Vec, + /// Keys of the positions before each move and after the last: `ucis.len() + 1`. + pub keys: Vec, + /// The deepest named position of the line ([`crate::PrepReport::openings`]). + pub opening: Option, + /// Plies of the line up to the named position (`keys[named]` is it). + pub named: Option, + /// Filled in by [`crate::PrepReport::find_book_exits`]; `None` while the line + /// is within the book, or before the book was looked at. + pub book: Option, +} + +impl GameInfo { + /// `yyyymmdd` for ordering (0: no date). + pub fn date_number(&self) -> u32 { + date_number(&self.date) + } + + /// Move `ply` (0-based) was the player's. + pub fn player_moves_at(&self, ply: usize) -> bool { + ply.is_multiple_of(2) == self.white + } + + /// "12. Nf3" / "12... Nf6" for move `ply` (0-based). + pub fn move_label(&self, ply: usize) -> String { + let san = self.sans.get(ply).map_or("", String::as_str); + move_label(ply, san) + } +} + +/// "12. Nf3" / "12... Nf6" for move `ply` (0-based from the usual start position). +pub fn move_label(ply: usize, san: &str) -> String { + let number = ply / 2 + 1; + if ply.is_multiple_of(2) { + format!("{number}. {san}") + } else { + format!("{number}... {san}") + } +} + +/// What a pass over the games produced. +pub struct Collected { + pub games: Vec, + pub openings: OpeningSet, + /// Games left out: from a set-up position, or unreadable. + pub skipped: u32, + /// Final positions of lines that end in checkmate or stalemate: (key, position). + pub terminal: Vec<(u64, Chess)>, +} + +/// Reads the first `plies` of each of `found` (record, the player had White); +/// `progress` counts the games done. `None` when cancelled. +pub fn collect( + db: &Database, + found: &[(u32, bool)], + plies: usize, + progress: &AtomicUsize, + cancel: &AtomicBool, +) -> Option { + let mut out = Collected { + games: Vec::with_capacity(found.len()), + openings: OpeningSet::default(), + skipped: 0, + terminal: Vec::new(), + }; + for &(index, white) in found { + if cancel.load(Ordering::Relaxed) { + return None; + } + progress.fetch_add(1, Ordering::Relaxed); + let Some(line) = db.main_line(index as usize, plies) else { + out.skipped += 1; + continue; + }; + if !line.standard_start { + out.skipped += 1; + continue; + } + let row = db.row(index as usize); + let mut pos = Chess::default(); + let mut keys = Vec::with_capacity(line.moves.len() + 1); + let mut ucis = Vec::with_capacity(line.moves.len()); + let mut sans = Vec::with_capacity(line.moves.len()); + keys.push(key(&pos)); + for m in &line.moves { + ucis.push(uci(m).to_string()); + sans.push(SanPlus::from_move_and_play_unchecked(&mut pos, *m).to_string()); + keys.push(key(&pos)); + } + if pos.is_checkmate() || pos.is_stalemate() { + out.terminal.push((key(&pos), pos)); + } + let (opening, named) = match openings::deepest(&keys) { + Some((at, id)) => (Some(out.openings.intern(id)), Some(at as u32)), + None => (None, None), + }; + out.games.push(GameInfo { + index, + white, + opponent: if white { row.black } else { row.white }, + opponent_elo: if white { row.black_elo } else { row.white_elo }, + date: row.date, + outcome: Outcome::of(row.result, white), + ucis, + sans, + keys, + opening, + named, + book: None, + }); + } + Some(out) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn outcomes_and_tallies() { + assert_eq!(Outcome::of("1-0", true), Outcome::Win); + assert_eq!(Outcome::of("1-0", false), Outcome::Loss); + assert_eq!(Outcome::of("0-1", false), Outcome::Win); + assert_eq!(Outcome::of("1/2-1/2", true), Outcome::Draw); + assert_eq!(Outcome::of("*", true), Outcome::Unknown); + let mut t = Tally::default(); + for o in [Outcome::Win, Outcome::Win, Outcome::Draw, Outcome::Loss, Outcome::Unknown] { + t.add(o); + } + assert_eq!((t.games, t.wins, t.draws, t.losses), (5, 2, 1, 1)); + assert_eq!(t.score(), Some(0.625)); + assert_eq!(Tally::default().score(), None); + assert_eq!(move_label(0, "e4"), "1. e4"); + assert_eq!(move_label(1, "c5"), "1... c5"); + assert_eq!(move_label(22, "Nf3"), "12. Nf3"); + } +} diff --git a/crates/prep/src/lib.rs b/crates/prep/src/lib.rs new file mode 100644 index 0000000..22e278e --- /dev/null +++ b/crates/prep/src/lib.rs @@ -0,0 +1,943 @@ +//! Preparing against an opponent, shared by the desktop and the Android app: what a +//! player of a database plays in the opening and where in the opening he goes wrong. +//! +//! The [`PrepReport`] is built in a moment from the player's games ([`build`]): his +//! main lines up to a number of plies, the repertoire tree of each colour with +//! transpositions marked, the openings named from the Lichess `chess-openings` table +//! (family → variation → games), and, with a second database as the book, where each +//! game left it. The engine step is apart and optional: every distinct position of +//! the lines is evaluated once ([`PrepReport::targets`], run by +//! [`game_review::run`], results taken in by [`PrepReport::apply`]), the player's +//! moves are judged with the rules of the game analysis, and the errors are listed by +//! opening and, when the same error was made in several games, as repeated. The +//! report is cached by database, player and plies; evaluations by position, across +//! reports ([`PositionCache`]). +//! +//! Nothing here touches the database or the games; no user interface. + +use std::collections::HashMap; +use std::path::{Path, PathBuf}; +use std::sync::atomic::{AtomicBool, AtomicUsize}; +use std::time::SystemTime; + +use chess_import::Database; +use game_review::{JobEvent, JobFailure, JobSettings, Target}; +use serde::{Deserialize, Serialize}; +use uci::EnginePosition; + +mod book; +mod errors; +mod games; +pub mod openings; +mod players; +mod tree; + +pub use book::BookOptions; +pub use chess_import::chessbase::base::Side; +pub use errors::{ + EXACT, ErrorCounts, OpeningError, PositionCache, PositionEval, RepeatedError, +}; +pub use game_review::{Eval, Judgement}; +pub use games::{BookExit, GameInfo, Outcome, Tally, move_label}; +pub use openings::Opening; +pub use players::{Candidate, Player, candidates, games_of}; +pub use tree::{Node, Tree}; + +/// Plies of the opening a report looks at unless told otherwise. +pub const DEFAULT_PLIES: usize = 20; +/// A position with fewer games than this in the book is out of it. +pub const DEFAULT_BOOK_THRESHOLD: u32 = 5; + +/// What a report covers. +#[derive(Clone, Debug, PartialEq, Eq, Hash)] +pub struct Options { + /// Plies of each game's main line. + pub plies: usize, + /// The player's colour(s). + pub side: Side, +} + +impl Default for Options { + fn default() -> Self { + Options { + plies: DEFAULT_PLIES, + side: Side::Any, + } + } +} + +/// An opening as played by the player: the games with the same name. +#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] +pub struct Variation { + /// Index into [`PrepReport::openings`]; `None`: no named position in the line. + pub opening: Option, + pub tally: Tally, + /// Indices into [`PrepReport::games`], in order. + pub games: Vec, + pub errors: ErrorCounts, + /// Indices into [`ColorReport::errors`]. + pub error_list: Vec, +} + +/// The openings with the same family name ("Sicilian Defense"), most played first. +#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] +pub struct Family { + /// Empty for games without a named position. + pub name: String, + pub tally: Tally, + /// Most played first. + pub variations: Vec, + pub errors: ErrorCounts, +} + +/// The report for one colour of the player. +#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] +pub struct ColorReport { + pub white: bool, + /// Indices into [`PrepReport::games`], in record order. + pub games: Vec, + pub tree: Tree, + pub families: Vec, + /// The player's opening errors, by game and ply (after the engine step). + pub errors: Vec, + /// The errors made in two or more games. + pub repeated: Vec, + pub counts: ErrorCounts, +} + +impl ColorReport { + /// Games that left the book, by whose move: (the player's, the opponent's); + /// the rest stayed in the book for the whole line (or no book was looked at). + pub fn book_exits(&self, games: &[GameInfo]) -> (u32, u32) { + let mut out = (0, 0); + for &g in &self.games { + match games[g as usize].book { + Some(b) if b.by_player => out.0 += 1, + Some(_) => out.1 += 1, + None => {} + } + } + out + } +} + +/// The engine the evaluations came from. +#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] +pub struct EngineInfo { + pub name: String, + /// Nodes per position asked for (an evaluation from the cache may have more). + pub nodes: u64, +} + +/// The book the exits were found against. +#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] +pub struct BookInfo { + pub fingerprint: u64, + pub threshold: u32, + /// Games that left the book within their line. + pub left: u32, +} + +const REPORT_VERSION: u32 = 1; + +/// Everything the preparation knows about the player. +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct PrepReport { + pub version: u32, + /// Of the database ([`fingerprint`]). + pub fingerprint: u64, + pub player: Player, + /// The player's names in the database. + pub names: Vec, + pub plies: usize, + pub side_white: bool, + pub side_black: bool, + pub games: Vec, + /// Games left out: from a set-up position, or unreadable. + pub skipped: u32, + /// The openings the games and trees refer to. + pub openings: Vec, + pub white: ColorReport, + pub black: ColorReport, + pub book: Option, + pub engine: Option, + /// Engine evaluations by position key. + pub evals: HashMap, +} + +/// Identity of a database for the report cache: the content of a PGN file, the +/// path, size and time of a ChessBase database. +pub fn fingerprint(db: &Database) -> u64 { + match db { + Database::Pgn(p) => { + let f = p.fingerprint(); + fnv(f.content_hash.to_le_bytes().iter().chain(f.len.to_le_bytes().iter())) + } + Database::ChessBase(b) => { + let meta = std::fs::metadata(b.path()).ok(); + let len = meta.as_ref().map_or(0, std::fs::Metadata::len); + let modified = meta + .and_then(|m| m.modified().ok()) + .and_then(|t| t.duration_since(SystemTime::UNIX_EPOCH).ok()) + .map_or(0, |d| d.as_secs()); + fnv(b.path() + .to_string_lossy() + .bytes() + .chain(len.to_le_bytes()) + .chain(modified.to_le_bytes()) + .collect::>() + .iter()) + } + } +} + +fn fnv<'a>(bytes: impl Iterator) -> u64 { + let mut h: u64 = 0xcbf2_9ce4_8422_2325; + for b in bytes { + h ^= u64::from(*b); + h = h.wrapping_mul(0x0000_0100_0000_01b3); + } + h +} + +/// Builds the report of `player` in `db`: his games ([`games_of`]), their first +/// plies, the trees, the names and the opening tables. `progress` counts the games +/// read. `None` when cancelled. Milliseconds for hundreds of games. +pub fn build( + db: &Database, + player: &Player, + options: &Options, + progress: &AtomicUsize, + cancel: &AtomicBool, +) -> Option { + let found = games_of(db, player, options.side, cancel)?; + let collected = games::collect(db, &found, options.plies, progress, cancel)?; + let mut openings = collected.openings; + let games = collected.games; + let mut evals = HashMap::new(); + for (key, pos) in &collected.terminal { + if let Some(eval) = game_review::terminal_eval(pos) { + evals.insert( + *key, + PositionEval { + nodes: EXACT, + eval, + pv: Vec::new(), + depth: 0, + }, + ); + } + } + let color = |white: bool, openings: &mut openings::OpeningSet| -> ColorReport { + let which: Vec = games + .iter() + .enumerate() + .filter(|(_, g)| g.white == white) + .map(|(i, _)| i as u32) + .collect(); + let tree = Tree::build(&games, &which, options.plies, openings); + let families = families(&games, &which, &openings.list); + ColorReport { + white, + games: which, + tree, + families, + errors: Vec::new(), + repeated: Vec::new(), + counts: ErrorCounts::default(), + } + }; + let white = color(true, &mut openings); + let black = color(false, &mut openings); + let mut report = PrepReport { + version: REPORT_VERSION, + fingerprint: fingerprint(db), + player: player.clone(), + names: player.names(db), + plies: options.plies, + side_white: options.side != Side::Black, + side_black: options.side != Side::White, + games, + skipped: collected.skipped, + openings: openings.list, + white, + black, + book: None, + engine: None, + evals, + }; + report.refresh(); + Some(report) +} + +/// Groups `games[g]` for `g` in `which` by opening name: families, most played +/// first, each with its variations, most played first. A name the table gives to +/// several positions ("Sicilian Defense: Closed" after 2.Nc3 and after 2...e6) is one +/// variation, shown with its shortest line. +fn families(games: &[GameInfo], which: &[u32], openings: &[Opening]) -> Vec { + let mut out: Vec = Vec::new(); + let mut family_of: HashMap = HashMap::new(); + let mut variation_of: HashMap<(usize, String), usize> = HashMap::new(); + for &g in which { + let game = &games[g as usize]; + let opening = game.opening.map(|o| &openings[o]); + let name = opening.map(|o| o.family().to_owned()).unwrap_or_default(); + let f = *family_of.entry(name.clone()).or_insert_with(|| { + out.push(Family { + name, + ..Family::default() + }); + out.len() - 1 + }); + let full = opening.map(|o| o.name.clone()).unwrap_or_default(); + let v = *variation_of.entry((f, full)).or_insert_with(|| { + out[f].variations.push(Variation { + opening: game.opening, + ..Variation::default() + }); + out[f].variations.len() - 1 + }); + out[f].tally.add(game.outcome); + let var = &mut out[f].variations[v]; + if let (Some(o), Some(shown)) = (game.opening, var.opening) + && openings[o].plies < openings[shown].plies + { + var.opening = Some(o); + } + var.tally.add(game.outcome); + var.games.push(g); + } + let variation_name = |v: &Variation| -> String { + v.opening + .map(|o| openings[o].name.clone()) + .unwrap_or_default() + }; + for f in &mut out { + f.variations.sort_by(|a, b| { + b.tally + .games + .cmp(&a.tally.games) + .then_with(|| variation_name(a).cmp(&variation_name(b))) + }); + } + out.sort_by(|a, b| { + b.tally + .games + .cmp(&a.tally.games) + .then_with(|| a.name.cmp(&b.name)) + }); + out +} + +impl PrepReport { + /// The colour(s) the report was built for. + pub fn side(&self) -> Side { + match (self.side_white, self.side_black) { + (true, false) => Side::White, + (false, true) => Side::Black, + _ => Side::Any, + } + } + + pub fn color(&self, white: bool) -> &ColorReport { + if white { &self.white } else { &self.black } + } + + // ----- the book ------------------------------------------------------------- + + /// Finds where each game left `book` (see [`book`]); `progress` counts the games + /// done. `None` when cancelled or the book cannot be searched; the report is + /// then left as it was. + pub fn find_book_exits( + &mut self, + book: &Database, + options: &BookOptions, + progress: &AtomicUsize, + cancel: &AtomicBool, + ) -> Option<()> { + let mut games = self.games.clone(); + let left = book::find_exits(&mut games, book, options, progress, cancel)?; + self.games = games; + self.book = Some(BookInfo { + fingerprint: fingerprint(book), + threshold: options.threshold, + left, + }); + Some(()) + } + + // ----- the engine ----------------------------------------------------------- + + /// Every distinct position of the lines (the one after the last move included), + /// first met first; those without legal moves left out. + fn positions(&self) -> Vec<(u64, &GameInfo, usize)> { + let mut seen = std::collections::HashSet::new(); + let mut out = Vec::new(); + for g in &self.games { + for (i, &k) in g.keys.iter().enumerate() { + if self.evals.get(&k).is_some_and(|e| e.nodes == EXACT) { + continue; + } + if seen.insert(k) { + out.push((k, g, i)); + } + } + } + out + } + + /// Distinct positions an engine run looks at. + pub fn distinct_positions(&self) -> usize { + self.positions().len() + } + + /// Positions without an evaluation of at least `nodes`. + pub fn missing(&self, nodes: u64) -> usize { + self.positions() + .iter() + .filter(|(k, _, _)| !self.evals.get(k).is_some_and(|e| e.nodes >= nodes)) + .count() + } + + /// Takes from `cache` the evaluations of at least `nodes` the report lacks; + /// returns how many. + pub fn take_cached(&mut self, cache: &PositionCache, nodes: u64) -> usize { + let keys: Vec = self.positions().iter().map(|(k, _, _)| *k).collect(); + let mut taken = 0; + for k in keys { + if self.evals.get(&k).is_some_and(|e| e.nodes >= nodes) { + continue; + } + if let Some(e) = cache.get(k).filter(|e| e.nodes >= nodes) { + self.evals.insert(k, e.clone()); + taken += 1; + } + } + if taken > 0 { + self.refresh(); + } + taken + } + + /// The positions still to evaluate at `nodes`, for [`game_review::run`] (one + /// search each, no second search for !! and !). Their keys are the position keys + /// in hexadecimal, as [`PrepReport::apply`] reads them. + pub fn targets(&self, nodes: u64) -> Vec { + self.positions() + .into_iter() + .filter(|(k, _, _)| !self.evals.get(k).is_some_and(|e| e.nodes >= nodes)) + .map(|(k, g, i)| Target { + key: format!("{k:016x}"), + pos: EnginePosition::startpos(g.ucis[..i].iter().cloned()), + turn: if i.is_multiple_of(2) { + uci::Side::White + } else { + uci::Side::Black + }, + played: None, + others: Vec::new(), + known: None, + }) + .collect() + } + + /// Takes in what the engine job reported for a run at `nodes`; the evaluation + /// it carried (to cache), if any. The errors are re-judged on the next + /// [`PrepReport::refresh`]. + pub fn apply(&mut self, event: &JobEvent, nodes: u64) -> Option<(u64, PositionEval)> { + match event { + JobEvent::Engine(name) => { + self.engine = Some(EngineInfo { + name: name.clone(), + nodes, + }); + None + } + JobEvent::Eval { key, eval, .. } => { + let k = u64::from_str_radix(key, 16).ok()?; + let e = PositionEval::from_engine(nodes, eval); + self.engine.get_or_insert_with(|| EngineInfo { + name: String::new(), + nodes, + }); + self.evals.insert(k, e.clone()); + Some((k, e)) + } + } + } + + /// Re-judges the player's moves from the evaluations: the errors by colour, + /// opening and repetition. Cheap (the lines of the games). + pub fn refresh(&mut self) { + let PrepReport { + games, + evals, + white, + black, + .. + } = self; + for cr in [white, black] { + let errors = errors::judge_games(games, &cr.games, evals); + cr.repeated = errors::repeated(&errors, games); + cr.counts = ErrorCounts::default(); + let mut at: HashMap = HashMap::new(); + for (f, fam) in cr.families.iter_mut().enumerate() { + fam.errors = ErrorCounts::default(); + for (v, var) in fam.variations.iter_mut().enumerate() { + var.errors = ErrorCounts::default(); + var.error_list.clear(); + for &g in &var.games { + at.insert(g, (f, v)); + } + } + } + for (i, e) in errors.iter().enumerate() { + cr.counts.add(e.judgement); + if let Some(&(f, v)) = at.get(&e.game) { + let fam = &mut cr.families[f]; + fam.errors.add(e.judgement); + fam.variations[v].errors.add(e.judgement); + fam.variations[v].error_list.push(i as u32); + } + } + cr.errors = errors; + } + } + + // ----- the report cache ----------------------------------------------------- + + /// The cache file of a report in `dir`. + pub fn cache_path(dir: &Path, fingerprint: u64, player: &Player, options: &Options) -> PathBuf { + let mut bytes = fingerprint.to_le_bytes().to_vec(); + for id in &player.ids { + bytes.extend(id.to_le_bytes()); + } + bytes.extend((options.plies as u64).to_le_bytes()); + bytes.push(match options.side { + Side::Any => 0, + Side::White => 1, + Side::Black => 2, + }); + dir.join(format!("{:016x}.json", fnv(bytes.iter()))) + } + + /// The report cached in `dir` for this database, player and options, if any. + pub fn load(dir: &Path, db: &Database, player: &Player, options: &Options) -> Option { + let fp = fingerprint(db); + let bytes = std::fs::read(Self::cache_path(dir, fp, player, options)).ok()?; + let report: PrepReport = serde_json::from_slice(&bytes).ok()?; + (report.version == REPORT_VERSION + && report.fingerprint == fp + && report.player == *player + && report.plies == options.plies + && report.side() == options.side) + .then_some(report) + } + + /// Keeps the report in `dir` (atomically). + pub fn save(&self, dir: &Path) -> std::io::Result<()> { + let options = Options { + plies: self.plies, + side: self.side(), + }; + let path = Self::cache_path(dir, self.fingerprint, &self.player, &options); + let bytes = serde_json::to_vec(self).map_err(std::io::Error::other)?; + errors::write_atomic(&path, &bytes) + } +} + +/// Progress of [`analyse`]. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub struct Progress { + /// Positions evaluated in this run. + pub done: usize, + /// Positions the run has to evaluate. + pub total: usize, + /// The engine's speed in the last search (0 if it did not say). + pub nps: u64, +} + +/// Runs the engine over the positions `report` lacks at `settings.nodes` (the cache +/// is consulted first and fed as results come; `cache_dir` saves it every few +/// hundred positions and at the end), updating the report as results come in. +/// Returns when done, or soon after `cancel` is set (what was evaluated stays). +pub fn analyse( + report: &mut PrepReport, + cache: &mut PositionCache, + cache_dir: Option<&Path>, + config: uci::EngineConfig, + settings: &JobSettings, + cancel: &AtomicBool, + on_progress: &mut dyn FnMut(Progress), +) -> Result<(), JobFailure> { + let nodes = settings.nodes; + report.take_cached(cache, nodes); + let targets = report.targets(nodes); + let total = targets.len(); + let mut progress = Progress { + done: 0, + total, + nps: 0, + }; + on_progress(progress); + if total == 0 { + return Ok(()); + } + let mut since_save = 0; + let result = game_review::run(config, settings, targets, cancel, &mut |event| { + if let JobEvent::Eval { nps, .. } = &event { + progress.done += 1; + progress.nps = *nps; + } + if let Some((key, eval)) = report.apply(&event, nodes) { + cache.insert(key, eval); + since_save += 1; + if since_save >= 200 + && let Some(dir) = cache_dir + { + let _ = cache.save(dir); + since_save = 0; + } + } + if matches!(event, JobEvent::Eval { .. }) { + on_progress(progress); + } + }); + report.refresh(); + if let Some(dir) = cache_dir { + let _ = cache.save(dir); + } + result +} + +#[cfg(test)] +mod tests { + use super::*; + use chess_core::PgnDatabase; + use chess_import::PgnDb; + + fn database(pgn: &str) -> Database { + let db = PgnDatabase::from_bytes( + pgn.as_bytes().to_vec(), + None, + &mut |_| {}, + &AtomicBool::new(false), + ) + .expect("pgn"); + Database::Pgn(PgnDb::new(db)) + } + + const PGN: &str = "\ +[White \"Вафин Радель\"] +[Black \"Иванов Иван\"] +[Date \"2026.01.10\"] +[BlackElo \"1500\"] +[Result \"1-0\"] + +1. e4 c5 2. Nf3 Nc6 3. Bb5 g6 4. O-O Bg7 1-0 + +[White \"Петров Пётр\"] +[Black \"Вафин Радель\"] +[Date \"2026.02.11\"] +[WhiteElo \"1700\"] +[Result \"0-1\"] + +1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 0-1 + +[White \"Вафин Радель\"] +[Black \"Вафина Раяна\"] +[Date \"2026.03.12\"] +[Result \"1/2-1/2\"] + +1. e4 c5 2. Nf3 Nc6 3. Bb5 e6 1/2-1/2 + +[White \"Вафин Р.\"] +[Black \"Сидоров\"] +[Date \"2026.04.01\"] +[Result \"0-1\"] + +1. d4 d5 2. c4 0-1 + +[White \"Вафин Радель\"] +[Black \"Set Up\"] +[FEN \"rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1\"] +[SetUp \"1\"] +[Result \"*\"] + +1... e5 * +"; + + #[test] + fn candidates_games_and_openings_of_a_player() { + let db = database(PGN); + // Every name with both words ("Вафина Раяна" has them too): the user picks. + let (list, total) = candidates(&db, "Вафин Р.", 10); + assert_eq!(total, 3, "{list:?}"); + assert_eq!(list[0].name, "Вафин Радель"); + assert_eq!(list[0].games, 4); + assert_eq!(list[1].name, "Вафин Р."); + assert_eq!(list[2].name, "Вафина Раяна"); + let (one, _) = candidates(&db, "Радель", 10); + assert_eq!(one.len(), 1); + // Two spellings merged. + let player = Player::new([list[0].id, list[1].id]); + let never = AtomicBool::new(false); + let found = games_of(&db, &player, Side::Any, &never).expect("games"); + assert_eq!(found, vec![(0, true), (1, false), (2, true), (3, true), (4, true)]); + assert_eq!( + games_of(&db, &player, Side::Black, &never).expect("games"), + vec![(1, false)] + ); + let report = build(&db, &player, &Options::default(), &AtomicUsize::new(0), &never) + .expect("report"); + assert_eq!(report.games.len(), 4, "the set-up game is left out"); + assert_eq!(report.skipped, 1); + assert_eq!(report.names, vec!["Вафин Радель", "Вафин Р."]); + let g = &report.games[0]; + assert_eq!((g.index, g.white, g.opponent.as_str(), g.opponent_elo), (0, true, "Иванов Иван", 1500)); + assert_eq!(g.date, "2026.01.10"); + assert_eq!(g.outcome, Outcome::Win); + assert_eq!(g.sans, vec!["e4", "c5", "Nf3", "Nc6", "Bb5", "g6", "O-O", "Bg7"]); + assert_eq!(g.keys.len(), 9); + let o = &report.openings[g.opening.expect("named")]; + assert!(o.name.starts_with("Sicilian Defense: Nyezhmetdinov-Rossolimo Attack"), "{}", o.name); + assert_eq!(g.named, Some(6)); + assert_eq!(report.games[1].outcome, Outcome::Win); + assert_eq!(report.games[1].opponent_elo, 1700); + // White: two Rossolimo games and one Queen's Gambit; the family first. + let w = &report.white; + assert_eq!(w.games, vec![0, 2, 3]); + assert_eq!(w.families.len(), 2); + assert_eq!(w.families[0].name, "Sicilian Defense"); + assert_eq!(w.families[0].tally.games, 3 - 1); + assert_eq!(w.families[0].variations.len(), 2, "3...g6 and 3...e6 are named apart"); + assert_eq!(w.families[1].name, "Queen's Gambit"); + assert_eq!(w.tree.nodes[0].tally.games, 3); + assert_eq!(w.tree.nodes[0].last_date, "2026.04.01"); + assert_eq!(w.tree.nodes[0].average_elo(), Some(1500)); + let b = &report.black; + assert_eq!(b.games, vec![1]); + assert_eq!(b.families[0].name, "Sicilian Defense"); + let name = &report.openings[b.families[0].variations[0].opening.unwrap()].name; + assert!(name.contains("Najdorf"), "{name}"); + assert!(report.evals.is_empty() && report.engine.is_none()); + assert_eq!(report.side(), Side::Any); + // Only White. + let white_only = build( + &db, + &player, + &Options { + plies: 4, + side: Side::White, + }, + &AtomicUsize::new(0), + &never, + ) + .expect("report"); + assert_eq!(white_only.games.len(), 3); + assert!(white_only.black.games.is_empty()); + assert!(white_only.games.iter().all(|g| g.ucis.len() <= 4)); + assert_eq!(white_only.side(), Side::White); + // Cancelled. + let cancelled = AtomicBool::new(true); + assert!(build(&db, &player, &Options::default(), &AtomicUsize::new(0), &cancelled).is_none()); + } + + #[test] + fn one_name_for_several_positions_is_one_variation() { + // "Sicilian Defense: Closed" is the table's name after 2.Nc3 and after 2...e6. + let db = database( + "[White \"A\"]\n[Black \"B\"]\n[Result \"1-0\"]\n\n1. e4 c5 2. Nc3 e6 1-0\n\n\ + [White \"A\"]\n[Black \"C\"]\n[Result \"0-1\"]\n\n1. e4 c5 2. Nc3 0-1\n\n", + ); + let player = Player::new([candidates(&db, "A", 1).0[0].id]); + let report = build(&db, &player, &Options::default(), &AtomicUsize::new(0), &AtomicBool::new(false)) + .expect("report"); + let fam = &report.white.families[0]; + assert_eq!(fam.name, "Sicilian Defense"); + assert_eq!(fam.variations.len(), 1); + let v = &fam.variations[0]; + assert_eq!(v.games, vec![0, 1]); + let o = &report.openings[v.opening.unwrap()]; + assert_eq!((o.name.as_str(), o.line.as_str()), ("Sicilian Defense: Closed", "1. e4 c5 2. Nc3")); + } + + #[test] + fn the_book_says_where_a_game_left_it() { + let db = database(PGN); + let (list, _) = candidates(&db, "Вафин Р.", 2); + let player = Player::new([list[0].id, list[1].id]); + let never = AtomicBool::new(false); + let mut report = build(&db, &player, &Options::default(), &AtomicUsize::new(0), &never) + .expect("report"); + // The database itself as the book, threshold 2: 1.e4 c5 2.Nf3 is in three + // games; game 0 (3...g6) and game 2 (3...e6) part after 3.Bb5, which is in + // both. `ply` counts the moves to the first rare position. + let options = BookOptions { + threshold: 2, + same_database: false, + }; + report + .find_book_exits(&db, &options, &AtomicUsize::new(0), &never) + .expect("book"); + let exits: Vec> = report.games.iter().map(|g| g.book).collect(); + assert_eq!( + exits[0], + Some(BookExit { + ply: 6, + by_player: false, + count: 1 + }) + ); + assert_eq!(exits[1].map(|b| (b.ply, b.by_player)), Some((4, true)), "2...d6 is his"); + assert_eq!(exits[2].map(|b| (b.ply, b.by_player)), Some((6, false))); + assert_eq!(exits[3].map(|b| (b.ply, b.by_player)), Some((1, true)), "1.d4 is his own"); + assert_eq!(report.book.as_ref().map(|b| (b.threshold, b.left)), Some((2, 4))); + assert_eq!(report.white.book_exits(&report.games), (1, 2)); + // The player's own games excluded: everything is out of the book at once. + let own = BookOptions { + threshold: 1, + same_database: true, + }; + report + .find_book_exits(&db, &own, &AtomicUsize::new(0), &never) + .expect("book"); + assert_eq!(report.games[0].book.map(|b| b.ply), Some(0)); + assert_eq!(report.book.as_ref().map(|b| b.left), Some(4)); + } + + #[test] + fn evaluations_give_the_errors_by_opening_and_the_report_is_cached() { + let db = database(PGN); + let (list, _) = candidates(&db, "Вафин Радель", 1); + let player = Player::new([list[0].id]); + let never = AtomicBool::new(false); + let mut report = build(&db, &player, &Options::default(), &AtomicUsize::new(0), &never) + .expect("report"); + let total = report.distinct_positions(); + // 9 + 11 + 7 positions; the start and 1.e4 c5 2.Nf3 shared by three games, + // 2...Nc6 3.Bb5 by two. + assert_eq!(total, 27 - 10); + let targets = report.targets(1000); + assert_eq!(targets.len(), total); + assert_eq!(targets[0].key, format!("{:016x}", report.games[0].keys[0])); + assert!(targets[0].pos.moves.is_empty()); + assert_eq!(targets[3].pos.moves, vec!["e2e4", "c7c5", "g1f3"]); + assert_eq!(targets[3].turn, uci::Side::Black); + assert!(targets.iter().all(|t| t.played.is_none() && t.known.is_none())); + // The engine says: every move fine but 3.Bb5, a blunder (+0.3 → −1.5). + let mut cache = PositionCache::default(); + for t in &targets { + let key = u64::from_str_radix(&t.key, 16).unwrap(); + let after_bb5 = report.games[0].keys[5]; + let eval = if key == after_bb5 { Eval::Cp(-150) } else { Eval::Cp(30) }; + let before_bb5 = report.games[0].keys[4]; + let pv = if key == before_bb5 { vec!["d2d4".to_owned()] } else { Vec::new() }; + let event = JobEvent::Eval { + key: t.key.clone(), + eval: game_review::PosEval { + eval, + pv, + depth: 12, + second: None, + }, + nps: 0, + }; + let (k, e) = report.apply(&event, 1000).expect("an evaluation"); + cache.insert(k, e); + } + assert_eq!(report.missing(1000), 0); + assert_eq!(report.missing(2000), total); + report.refresh(); + assert_eq!(report.engine.as_ref().map(|e| e.nodes), Some(1000)); + let w = &report.white; + assert_eq!(w.counts.blunders, 2); + assert_eq!(w.errors.len(), 2); + assert_eq!(w.errors[0].san, "Bb5"); + assert_eq!(w.errors[0].best_san, "d4"); + assert_eq!(w.errors[0].ply, 4); + assert_eq!(report.games[w.errors[0].game as usize].move_label(4), "3. Bb5"); + assert_eq!(w.families[0].errors.blunders, 2); + assert_eq!(w.families[0].variations[0].errors.blunders, 1); + assert_eq!(w.families[0].variations[0].error_list.len(), 1); + assert_eq!(w.families.len(), 1); + assert_eq!(w.repeated.len(), 1); + assert_eq!(w.repeated[0].games, vec![0, 2]); + assert_eq!(w.repeated[0].tally.draws, 1); + assert!(report.black.errors.is_empty()); + // Cached: the report by database, player and options; the evaluations by + // position, for anyone. + let dir = std::env::temp_dir().join(format!("prep-report-test-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + assert!(PrepReport::load(&dir, &db, &player, &Options::default()).is_none()); + report.save(&dir).expect("saved"); + let again = PrepReport::load(&dir, &db, &player, &Options::default()).expect("cached"); + assert_eq!(again.white.errors, report.white.errors); + assert_eq!(again.evals.len(), report.evals.len()); + assert!(PrepReport::load(&dir, &db, &player, &Options { plies: 10, side: Side::Any }).is_none()); + let other = Player::new([list[0].id + 1]); + assert!(PrepReport::load(&dir, &db, &other, &Options::default()).is_none()); + let mut fresh = build(&db, &player, &Options::default(), &AtomicUsize::new(0), &never) + .expect("report"); + assert_eq!(fresh.take_cached(&cache, 1000), total); + assert_eq!(fresh.white.repeated, report.white.repeated); + assert_eq!(fresh.take_cached(&cache, 1000), 0); + let _ = std::fs::remove_dir_all(&dir); + } + + /// The fake engine of the `uci` crate (`cargo build -p uci --bin fake_uci`). + #[test] + fn the_engine_run_fills_the_report_and_the_cache() { + let fake = concat!(env!("CARGO_MANIFEST_DIR"), "/../../target/debug/fake_uci"); + assert!( + std::path::Path::new(fake).exists(), + "build the fake engine first: cargo build -p uci --bin fake_uci" + ); + let db = database(PGN); + let (list, _) = candidates(&db, "Вафин Радель", 1); + let player = Player::new([list[0].id]); + let never = AtomicBool::new(false); + let mut report = build(&db, &player, &Options::default(), &AtomicUsize::new(0), &never) + .expect("report"); + let total = report.distinct_positions(); + let settings = JobSettings { + threads: 1, + hash_mb: 16, + nodes: 1000, + eval_file: None, + }; + let mut cache = PositionCache::default(); + let mut last = Progress::default(); + analyse( + &mut report, + &mut cache, + None, + uci::EngineConfig::new(fake), + &settings, + &never, + &mut |p| last = p, + ) + .expect("the job runs"); + assert_eq!((last.done, last.total), (total, total)); + assert_eq!(report.missing(1000), 0); + assert_eq!(cache.len(), total); + assert_eq!(report.engine.as_ref().map(|e| e.name.as_str()), Some("Fake UCI")); + // A second run has nothing to do; a cancelled one ends at once. + let mut again = build(&db, &player, &Options::default(), &AtomicUsize::new(0), &never) + .expect("report"); + let cancelled = AtomicBool::new(true); + let mut calls = 0; + analyse( + &mut again, + &mut cache, + None, + uci::EngineConfig::new(fake), + &settings, + &cancelled, + &mut |_| calls += 1, + ) + .expect("nothing to do"); + assert_eq!(again.missing(1000), 0, "all from the cache"); + assert_eq!(calls, 1); + } +} diff --git a/crates/prep/src/openings.rs b/crates/prep/src/openings.rs new file mode 100644 index 0000000..f7cecb0 --- /dev/null +++ b/crates/prep/src/openings.rs @@ -0,0 +1,213 @@ +//! Opening names from the Lichess `chess-openings` table: a position's ECO code and +//! name, looked up by the position itself, so a line reaching a named position by +//! another move order gets its name too. A line is named by its deepest named +//! position, as the table's README says ("go back through the moves until a named +//! position is found"). +//! +//! The five TSV files in `data/` (`eco`, `name`, `pgn`) were downloaded unmodified from +//! at revision +//! `f06a50d5c7c140e50b068049fa31d289e2c3d347` (2026-10-27), on 2026-10-28; the data set is +//! in the public domain (CC0 1.0). Their SHA-256 sums are in `THIRD_PARTY_NOTICES.md`. +//! The table is parsed on first use (3 865 lines, a fraction of a second). + +use std::collections::HashMap; +use std::sync::OnceLock; + +use chess_core::shakmaty::san::SanPlus; +use chess_core::shakmaty::{Chess, Position}; +use chess_import::position::key; +use serde::{Deserialize, Serialize}; + +const FILES: [&str; 5] = [ + include_str!("../data/a.tsv"), + include_str!("../data/b.tsv"), + include_str!("../data/c.tsv"), + include_str!("../data/d.tsv"), + include_str!("../data/e.tsv"), +]; + +/// A named opening position of the table. +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub struct Opening { + /// "B30". + pub eco: String, + /// "Sicilian Defense: Nyezhmetdinov-Rossolimo Attack". + pub name: String, + /// The table's moves to the position, in SAN ("1. e4 c5 2. Nf3 Nc6 3. Bb5"). + pub line: String, + /// Half-moves of `line`. + pub plies: u8, +} + +impl Opening { + /// The part of the name before the colon ("Sicilian Defense"). + pub fn family(&self) -> &str { + self.name.split(':').next().unwrap_or(&self.name).trim() + } + + /// The part after the colon ("Nyezhmetdinov-Rossolimo Attack"), if any. + pub fn variation(&self) -> Option<&str> { + self.name.split_once(':').map(|(_, v)| v.trim()) + } +} + +struct Table { + entries: Vec, + /// Position key → entry. A position reached by two lines of the table keeps the + /// first (the files are in ECO order). + by_key: HashMap, +} + +fn table() -> &'static Table { + static TABLE: OnceLock = OnceLock::new(); + TABLE.get_or_init(|| { + let mut t = Table { + entries: Vec::with_capacity(4000), + by_key: HashMap::with_capacity(4000), + }; + for text in FILES { + for line in text.lines().skip(1) { + let mut cols = line.split('\t'); + let (Some(eco), Some(name), Some(pgn)) = (cols.next(), cols.next(), cols.next()) + else { + continue; + }; + let Some((pos, plies)) = play(pgn) else { + continue; + }; + let k = key(&pos); + if t.by_key.contains_key(&k) { + continue; + } + t.by_key.insert(k, t.entries.len()); + t.entries.push(Opening { + eco: eco.to_owned(), + name: name.to_owned(), + line: pgn.to_owned(), + plies, + }); + } + } + t + }) +} + +/// Plays a table line ("1. e4 c5 2. Nf3"); `None` if a move is not legal. +fn play(pgn: &str) -> Option<(Chess, u8)> { + let mut pos = Chess::default(); + let mut plies = 0u8; + for tok in pgn.split_whitespace() { + if tok.ends_with('.') { + continue; + } + let m = tok.parse::().ok()?.san.to_move(&pos).ok()?; + pos.play_unchecked(m); + plies = plies.checked_add(1)?; + } + Some((pos, plies)) +} + +/// Number of named positions. +pub fn count() -> usize { + table().entries.len() +} + +/// The entry of a named position (by its [`key`]). +pub fn by_position(k: u64) -> Option { + table().by_key.get(&k).copied() +} + +/// Entry `id` (from [`by_position`] or [`deepest`]). +pub fn get(id: usize) -> &'static Opening { + &table().entries[id] +} + +/// The deepest named position among `keys` (the positions of a line, in order): its +/// index in `keys` and its entry. +pub fn deepest(keys: &[u64]) -> Option<(usize, usize)> { + keys.iter() + .enumerate() + .rev() + .find_map(|(i, k)| by_position(*k).map(|id| (i, id))) +} + +/// The openings a report refers to, each once, in the order they were first met. +#[derive(Default)] +pub struct OpeningSet { + pub list: Vec, + by_table: HashMap, +} + +impl OpeningSet { + /// The place of table entry `id` in [`OpeningSet::list`]. + pub fn intern(&mut self, id: usize) -> usize { + if let Some(&i) = self.by_table.get(&id) { + return i; + } + self.list.push(get(id).clone()); + self.by_table.insert(id, self.list.len() - 1); + self.list.len() - 1 + } +} + +#[cfg(test)] +mod tests { + use super::*; + use chess_core::shakmaty::san::San; + + fn keys(moves: &[&str]) -> Vec { + let mut pos = Chess::default(); + let mut out = vec![key(&pos)]; + for s in moves { + let m = s.parse::().unwrap().to_move(&pos).unwrap(); + pos.play_unchecked(m); + out.push(key(&pos)); + } + out + } + + #[test] + fn the_table_loads() { + // 3 865 lines; a few positions are reached by two lines of the table. + assert!(count() > 3800, "{}", count()); + let start = by_position(key(&Chess::default())); + assert!(start.is_none(), "the start position has no name"); + } + + #[test] + fn the_deepest_named_position_names_the_line_whatever_the_move_order() { + // 1.e4 c5 2.Nf3 Nc6 3.Bb5: the Rossolimo; 3...g6 is named too, 4.O-O is not. + let k = keys(&["e4", "c5", "Nf3", "Nc6", "Bb5", "g6", "O-O"]); + let (at, id) = deepest(&k).expect("named"); + let o = get(id); + assert_eq!(o.eco, "B31"); + assert!(o.name.starts_with("Sicilian Defense: Nyezhmetdinov-Rossolimo Attack"), "{}", o.name); + assert_eq!(at, 6, "the position after 3...g6"); + assert_eq!(o.family(), "Sicilian Defense"); + assert!(o.variation().is_some_and(|v| v.starts_with("Nyezhmetdinov"))); + assert_eq!(o.plies, 6); + assert_eq!(o.line, "1. e4 c5 2. Nf3 Nc6 3. Bb5 g6"); + // A transposition: 1.Nf3 d5 2.d4 reaches the table's 1.d4 d5 2.Nf3. + let a = deepest(&keys(&["Nf3", "d5", "d4"])).expect("named"); + let b = deepest(&keys(&["d4", "d5", "Nf3"])).expect("named"); + assert_eq!(a.1, b.1); + assert_eq!(get(a.1).line, "1. d4 d5 2. Nf3"); + // A family without a variation. + let o = get(deepest(&keys(&["e4", "c5"])).expect("named").1); + assert_eq!(o.name, "Sicilian Defense"); + assert_eq!(o.variation(), None); + // Nothing before the first move. + assert_eq!(deepest(&keys(&[])), None); + } + + #[test] + fn a_set_keeps_each_opening_once() { + let mut set = OpeningSet::default(); + let id = deepest(&keys(&["e4", "c5"])).unwrap().1; + let other = deepest(&keys(&["d4"])).unwrap().1; + assert_eq!(set.intern(id), 0); + assert_eq!(set.intern(other), 1); + assert_eq!(set.intern(id), 0); + assert_eq!(set.list.len(), 2); + } +} diff --git a/crates/prep/src/players.rs b/crates/prep/src/players.rs new file mode 100644 index 0000000..e9cb84b --- /dev/null +++ b/crates/prep/src/players.rs @@ -0,0 +1,92 @@ +//! The player: picked from the names of the database (never free text, so that +//! "Вафин" offers "Вафин Радель · 271" and "Вафина Раяна · 10" and the user chooses), +//! as one or several name ids when the database spells the same person in several +//! ways ("Kasparov, G." and "Kasparov, Garry"), and the player's games by colour. + +use std::sync::atomic::{AtomicBool, AtomicUsize}; + +use chess_import::Database; +use chess_import::chessbase::base::{Filter, NameFilter, Side, SortKey}; +use serde::{Deserialize, Serialize}; + +/// A name of the database that matches a query, with its number of games. +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub struct Candidate { + pub id: u32, + pub name: String, + pub games: u32, +} + +/// Up to `limit` names containing every word of `query` (an initial with its full +/// stop finds the full name), names starting with the first word first, then by +/// number of games; and the number of all matches. +pub fn candidates(db: &Database, query: &str, limit: usize) -> (Vec, usize) { + let (list, total) = db.suggest_players(query, limit); + let list = list + .into_iter() + .map(|s| Candidate { + id: s.id, + name: s.name, + games: s.games, + }) + .collect(); + (list, total) +} + +/// The player of a report: one or more name ids of the database. +#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub struct Player { + pub ids: Vec, +} + +impl Player { + pub fn new(ids: impl IntoIterator) -> Player { + let mut ids: Vec = ids.into_iter().collect(); + ids.sort_unstable(); + ids.dedup(); + Player { ids } + } + + /// The names behind the ids, as the game list shows them. + pub fn names(&self, db: &Database) -> Vec { + self.ids + .iter() + .map(|&id| db.player_name(id).to_owned()) + .collect() + } +} + +/// The player's games for `side`: (record index, the player had White), in record +/// order. `None` when cancelled. +pub fn games_of( + db: &Database, + player: &Player, + side: Side, + cancel: &AtomicBool, +) -> Option> { + let mut out = Vec::new(); + for &id in &player.ids { + for (s, white) in [(Side::White, true), (Side::Black, false)] { + if side != Side::Any && side != s { + continue; + } + let filter = Filter { + player: NameFilter { + text: String::new(), + exact: Some(id), + }, + side: s, + games_only: true, + ..Filter::default() + }; + let found = db.query(&filter, SortKey::Number, true, &AtomicUsize::new(0), cancel)?; + out.extend(found.into_iter().map(|i| (i, white))); + } + } + // The same record with the same colour twice: two ids of the player on one side + // cannot happen, but two ids on both sides of one game can (a game against + // oneself in a spelling-merged list): it is kept once per colour. + out.sort_unstable(); + out.dedup(); + Some(out) +} diff --git a/crates/prep/src/tree.rs b/crates/prep/src/tree.rs new file mode 100644 index 0000000..5796c97 --- /dev/null +++ b/crates/prep/src/tree.rs @@ -0,0 +1,266 @@ +//! The repertoire tree of one colour: the player's games laid over each other by +//! move order (it reads as a repertoire: 1.e4 c5 2.Nf3 …), every node carrying the +//! key of its position, so that two nodes reached by different move orders are seen +//! to be the same position (a transposition) and get the same opening name. + +use std::collections::HashMap; + +use serde::{Deserialize, Serialize}; + +use crate::games::{GameInfo, Tally}; +use crate::openings::{self, OpeningSet}; + +/// A position of the tree: the move that led to it from its parent, and the games +/// that went through it. +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Node { + pub key: u64, + /// Half-moves from the start (0: the root). + pub ply: u8, + /// The move from the parent (empty for the root). + pub uci: String, + pub san: String, + pub parent: Option, + /// Most played first. + pub children: Vec, + pub tally: Tally, + /// The latest date among the games (PGN form; empty when none has one). + pub last_date: String, + /// Sum and number of the known opponent ratings, for the average. + pub elo_sum: u64, + pub elo_count: u32, + /// Games through the node: indices into [`crate::PrepReport::games`], in order. + pub games: Vec, + /// The same position is reached elsewhere in the tree by another move order. + pub transposition: bool, + /// The deepest named position on the path to the node + /// ([`crate::PrepReport::openings`]); `named` when it is this one. + pub opening: Option, + pub named: bool, +} + +impl Node { + pub fn average_elo(&self) -> Option { + (self.elo_count > 0).then(|| (self.elo_sum / u64::from(self.elo_count)) as u32) + } +} + +/// The tree of one colour; `nodes[0]` is the root (the start position). +#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] +pub struct Tree { + pub nodes: Vec, +} + +impl Tree { + /// Lays the lines of `games[g]` for `g` in `which` over each other, `plies` deep. + pub fn build( + games: &[GameInfo], + which: &[u32], + plies: usize, + openings: &mut OpeningSet, + ) -> Tree { + let mut tree = Tree { + nodes: vec![Node { + key: games + .first() + .and_then(|g| g.keys.first().copied()) + .unwrap_or_default(), + ply: 0, + uci: String::new(), + san: String::new(), + parent: None, + children: Vec::new(), + tally: Tally::default(), + last_date: String::new(), + elo_sum: 0, + elo_count: 0, + games: Vec::new(), + transposition: false, + opening: None, + named: false, + }], + }; + for &g in which { + let game = &games[g as usize]; + if let Some(&k) = game.keys.first() { + tree.nodes[0].key = k; + } + tree.count(0, g, game); + let mut at = 0usize; + for i in 0..game.ucis.len().min(plies) { + let next = match tree.nodes[at] + .children + .iter() + .find(|&&c| tree.nodes[c as usize].uci == game.ucis[i]) + { + Some(&c) => c as usize, + None => { + let key = game.keys[i + 1]; + let named = openings::by_position(key); + let opening = named + .map(|id| openings.intern(id)) + .or(tree.nodes[at].opening); + tree.nodes.push(Node { + key, + ply: u8::try_from(i + 1).unwrap_or(u8::MAX), + uci: game.ucis[i].clone(), + san: game.sans[i].clone(), + parent: Some(at as u32), + children: Vec::new(), + tally: Tally::default(), + last_date: String::new(), + elo_sum: 0, + elo_count: 0, + games: Vec::new(), + transposition: false, + opening, + named: named.is_some(), + }); + let c = tree.nodes.len() - 1; + tree.nodes[at].children.push(c as u32); + c + } + }; + tree.count(next, g, game); + at = next; + } + } + // Most played first among the children. + let played: Vec = tree.nodes.iter().map(|n| n.tally.games).collect(); + for n in &mut tree.nodes { + n.children + .sort_by(|a, b| played[*b as usize].cmp(&played[*a as usize]).then(a.cmp(b))); + } + // Transpositions: one key in several nodes. + let mut seen: HashMap = HashMap::new(); + for n in &tree.nodes { + *seen.entry(n.key).or_default() += 1; + } + for n in &mut tree.nodes { + n.transposition = seen.get(&n.key).is_some_and(|c| *c > 1); + } + tree + } + + fn count(&mut self, node: usize, g: u32, game: &GameInfo) { + let n = &mut self.nodes[node]; + n.tally.add(game.outcome); + n.games.push(g); + if game.opponent_elo > 0 { + n.elo_sum += u64::from(game.opponent_elo); + n.elo_count += 1; + } + if game.date_number() > chess_import::pgn_catalog::date_number(&n.last_date) { + n.last_date = game.date.clone(); + } + } + + /// The statistics of the position with `key` over all its move orders (the + /// sum of its nodes). + pub fn position_tally(&self, key: u64) -> Tally { + let mut t = Tally::default(); + for n in self.nodes.iter().filter(|n| n.key == key) { + t.games += n.tally.games; + t.wins += n.tally.wins; + t.draws += n.tally.draws; + t.losses += n.tally.losses; + } + t + } + + /// The path of moves to `node`, in SAN. + pub fn path(&self, node: usize) -> Vec<&str> { + let mut out = Vec::new(); + let mut at = Some(node); + while let Some(i) = at { + let n = &self.nodes[i]; + if n.parent.is_some() { + out.push(n.san.as_str()); + } + at = n.parent.map(|p| p as usize); + } + out.reverse(); + out + } +} + +#[cfg(test)] +pub(crate) mod tests { + use super::*; + use crate::games::Outcome; + use chess_core::shakmaty::san::SanPlus; + use chess_core::shakmaty::Chess; + use chess_import::position::{key, uci}; + + pub(crate) fn game(index: u32, white: bool, moves: &[&str], result: &str, date: &str, elo: u16) -> GameInfo { + let mut pos = Chess::default(); + let (mut ucis, mut sans, mut keys) = (Vec::new(), Vec::new(), vec![key(&pos)]); + for s in moves { + let m = s.parse::().unwrap().san.to_move(&pos).unwrap(); + ucis.push(uci(&m).to_string()); + sans.push(SanPlus::from_move_and_play_unchecked(&mut pos, m).to_string()); + keys.push(key(&pos)); + } + GameInfo { + index, + white, + opponent: "Opp".into(), + opponent_elo: elo, + date: date.into(), + outcome: Outcome::of(result, white), + ucis, + sans, + keys, + opening: None, + named: None, + book: None, + } + } + + #[test] + fn the_tree_counts_games_and_marks_transpositions() { + let games = vec![ + game(0, true, &["d4", "d5", "Nf3", "Nf6"], "1-0", "2026.01.05", 1500), + game(1, true, &["Nf3", "d5", "d4", "Nf6"], "0-1", "2026.03.01", 0), + game(2, true, &["d4", "d5", "c4"], "1/2-1/2", "2025.12.31", 1700), + game(3, false, &["e4", "c5"], "0-1", "2026.02.02", 1600), + game(4, true, &["d4", "d5", "c4", "e6", "Nc3", "Nf6", "h3"], "1-0", "", 0), + ]; + let mut set = OpeningSet::default(); + let tree = Tree::build(&games, &[0, 1, 2], 20, &mut set); + let root = &tree.nodes[0]; + assert_eq!(root.tally.games, 3); + assert_eq!(root.last_date, "2026.03.01"); + assert_eq!(root.average_elo(), Some(1600)); + assert_eq!(root.games, vec![0, 1, 2]); + // 1.d4 (2 games) before 1.Nf3 (1 game). + let kids: Vec<&str> = root.children.iter().map(|&c| tree.nodes[c as usize].san.as_str()).collect(); + assert_eq!(kids, vec!["d4", "Nf3"]); + // The position after 1.d4 d5 2.Nf3 / 1.Nf3 d5 2.d4 is in two nodes. + let shared: Vec<&Node> = tree.nodes.iter().filter(|n| n.transposition).collect(); + let keys: Vec = shared.iter().map(|n| n.key).collect(); + assert_eq!(shared.len(), 4, "{keys:?}"); + let after_nf3 = tree.nodes.iter().find(|n| n.ply == 3 && n.san == "Nf3").unwrap(); + let after_d4 = tree.nodes.iter().find(|n| n.ply == 3 && n.san == "d4").unwrap(); + assert_eq!(after_nf3.key, after_d4.key); + assert_eq!(tree.position_tally(after_nf3.key).games, 2); + assert!(!tree.nodes.iter().find(|n| n.san == "c4").unwrap().transposition); + assert_eq!(tree.path(after_d4.parent.unwrap() as usize), vec!["Nf3", "d5"]); + // Names: 1.d4 d5 2.Nf3 is named in the table, 2...Nf6 is too (Zukertort); + // both move orders get the same name. + assert!(after_nf3.named && after_d4.named); + assert_eq!(after_nf3.opening, after_d4.opening); + let name = &set.list[after_nf3.opening.unwrap()].name; + assert!(name.starts_with("Queen's Pawn Game"), "{name}"); + // A node that is not named (4.h3 in the Queen's Gambit Declined) inherits the + // name of its path. + let tree = Tree::build(&games, &[0, 1, 2, 4], 20, &mut set); + let h3 = tree.nodes.iter().find(|n| n.san == "h3").unwrap(); + assert!(!h3.named); + assert_eq!(h3.opening, tree.nodes[h3.parent.unwrap() as usize].opening); + assert!(set.list[h3.opening.unwrap()].name.starts_with("Queen's Gambit Declined")); + // Depth limit. + let short = Tree::build(&games, &[0, 1, 2], 1, &mut set); + assert_eq!(short.nodes.len(), 3); + } +} From f02f1403944a3ca7078254250d4cfb14e02049f5 Mon Sep 17 00:00:00 2001 From: vrubelroman Date: Wed, 28 Oct 2026 15:43:15 +0300 Subject: [PATCH 5/9] Opponent prep: the desktop screen (dialog, report, engine run) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The «Prepare against…» entry points in the library (the filter panel's button when a player is set, the game row's context menu, Ctrl+Shift+P), the dialog (database, the player's spellings with the similar names apart, colour, book) and the report screen in the stack between the library and the game: the repertoire tree with transpositions, opening names, scores and the book column, the openings table by family and variation, the errors tab (repeated errors and by opening), the board of the chosen position with the line under it, and the games of the selection, which open in the game screen at that move with «⬅ Back to preparation». The engine run reuses the game analysis job over the distinct opening positions of the chosen colour: the launch dialog shares the engine picker and the quality/threads/memory grid with review.rs (quality «Fast» by default, its own setting), marks appear as positions are evaluated, «Stop» keeps what was done, the evaluations and the report are cached under /prep. One engine job per program: game analysis and the live engine are blocked meanwhile. Core: targets and counts by colour (`targets_for`, `missing_for`), the book step keeps its per-position counts (`book_counts`) for the tree column. Narrow windows: the board stacks over the lists under 804 px and folds into a button under 720 px of height; the right column is split explicitly (a nested bottom panel is not reserved from the content above it in egui). Co-Authored-By: Claude Fable 5.1 --- apps/desktop/Cargo.toml | 1 + apps/desktop/src/app.rs | 236 +- apps/desktop/src/engine_offer.rs | 8 + apps/desktop/src/game_view.rs | 42 +- apps/desktop/src/i18n.rs | 1245 +++++++++ apps/desktop/src/large_db.rs | 51 + apps/desktop/src/library.rs | 21 + apps/desktop/src/main.rs | 1 + apps/desktop/src/prep_ui.rs | 4288 ++++++++++++++++++++++++++++++ apps/desktop/src/review.rs | 183 +- apps/desktop/src/settings.rs | 37 + crates/prep/src/book.rs | 9 +- crates/prep/src/lib.rs | 50 +- docs/dev/desktop.md | 2 +- 14 files changed, 6072 insertions(+), 102 deletions(-) create mode 100644 apps/desktop/src/prep_ui.rs diff --git a/apps/desktop/Cargo.toml b/apps/desktop/Cargo.toml index 99350c0..e3f2cd0 100644 --- a/apps/desktop/Cargo.toml +++ b/apps/desktop/Cargo.toml @@ -13,6 +13,7 @@ license.workspace = true chess-core.workspace = true maia.workspace = true game-review.workspace = true +prep.workspace = true chess-import.workspace = true shakmaty.workspace = true uci.workspace = true diff --git a/apps/desktop/src/app.rs b/apps/desktop/src/app.rs index 1a60d7b..6a315d7 100644 --- a/apps/desktop/src/app.rs +++ b/apps/desktop/src/app.rs @@ -13,6 +13,7 @@ use crate::analysis::Analysis; use crate::assets::Sound; use crate::game_view::{GameAction, GameSource, GameView}; use crate::library::{Library, LibraryAction}; +use crate::prep_ui::{DialogOutcome, PrepAction, PrepDialog, PrepScreen}; use crate::own_db::{ self, Answer, ChooserFor, ChooserOutcome, EditorMode, EditorOutcome, NewBaseOutcome, QuestionKind, @@ -244,6 +245,10 @@ pub struct App { restart_to: Option, /// The reference tab of games (kept across games: its results stay cached). reference: crate::reference::Reference, + /// Preparing against an opponent: the dialog, and the report screen in the stack + /// between the library and the game (opponent-prep.md §3.1). + prep_dialog: Option, + prep: Option, allow_quit: bool, applied_dark: Option, debug: DebugStartup, @@ -279,6 +284,9 @@ struct DebugStartup { next_key: f64, /// `CP_TYPE=`: typed into the field that has the keyboard, 2.5 s after start. typed: Option, + /// `CP_PREP=`: «Prepare against…» for this name in the first database + /// (`CP_PREP_OPEN=1` presses «Open report», `CP_PREP_TAB`, `CP_PREP_ENGINE=1`). + prep: Option, } impl DebugStartup { @@ -321,6 +329,7 @@ impl DebugStartup { .collect(), next_key: 2.0, typed: std::env::var("CP_TYPE").ok(), + prep: std::env::var("CP_PREP").ok(), } } } @@ -410,6 +419,8 @@ impl App { update_ui: crate::update_ui::UpdateDialog::from_env(), restart_to: None, reference: Default::default(), + prep_dialog: None, + prep: None, engine_offer: crate::engine_offer::EngineOffer::new(), offer_hook_done: false, online_probe: crate::online::Probe::start(ctx), @@ -642,6 +653,23 @@ impl App { } fn debug_step(&mut self, ctx: &egui::Context) { + if self.debug.prep.is_some() + && let Some(path) = self.settings.databases.first().cloned() + && self.library.database(&path).is_some() + { + let query = self.debug.prep.take().unwrap_or_default(); + let side = match std::env::var("CP_PREP_COLOR").as_deref() { + Ok("white") => chess_import::chessbase::base::Side::White, + Ok("black") => chess_import::chessbase::base::Side::Black, + _ => chess_import::chessbase::base::Side::Any, + }; + let entry = crate::prep_ui::PrepEntry { + query, + exact: None, + side, + }; + self.prep_dialog = Some(PrepDialog::new(path, entry, &self.settings)); + } let Some(index) = self.debug.open else { return }; let Some(path) = self.settings.databases.first().cloned() else { return; @@ -736,6 +764,134 @@ impl App { self.toast_for(ctx, msg, 3.5); } + /// The shelf as the reference tab and the preparation see it. + fn shelf_dbs(&self) -> Vec { + self.settings + .databases + .iter() + .filter(|p| self.library.files.exists(p)) + .map(|p| crate::reference::RefDb { + path: p.clone(), + name: p + .file_stem() + .map(|s| s.to_string_lossy().into_owned()) + .unwrap_or_default(), + db: self.library.database(p), + failed: self.library.failure(p).map(str::to_owned), + bytes: self.library.file_size(p), + }) + .collect() + } + + // ----- preparing against an opponent (docs/design/opponent-prep.md) ------------ + + /// «Open report»: the report of the same player as it was, else a new one. + fn open_prep(&mut self, ctx: &egui::Context, start: crate::prep_ui::PrepStart) { + let Some(db) = self.library.database(&start.path) else { + return; + }; + if let Some(p) = self.prep.as_mut() + && p.matches(&start.path, &start.player) + { + p.shown = true; + return; + } + if let Some(mut old) = self.prep.take() { + old.save(); + } + self.prep = Some(PrepScreen::new(start, db, &self.settings, ctx)); + } + + /// The preparation's dialog, when it is open. + fn prep_dialog(&mut self, ctx: &egui::Context) { + if self.prep_dialog.is_none() { + return; + } + let dbs = self.shelf_dbs(); + let Some(d) = self.prep_dialog.as_mut() else { + return; + }; + d.dbs = dbs; + let outcome = d.show(ctx, &mut self.settings); + match outcome { + Some(DialogOutcome::Open(start)) => { + self.prep_dialog = None; + self.settings_dirty = true; + self.open_prep(ctx, start); + } + Some(DialogOutcome::Cancel) => self.prep_dialog = None, + Some(DialogOutcome::LoadDb(p)) + if !self.library.loading(&p) && self.library.database(&p).is_none() => + { + self.library.load(&p, ctx); + } + Some(DialogOutcome::LoadDb(_)) | None => {} + } + } + + fn prep_actions(&mut self, ctx: &egui::Context, actions: Vec) { + for a in actions { + match a { + PrepAction::Back => { + if let Some(p) = self.prep.as_mut() { + p.shown = false; + p.save(); + } + } + PrepAction::OpenSettings => self.settings_ui.open = !self.settings_ui.open, + PrepAction::OpenGame { path, index, ply } => { + let title = self.prep.as_ref().map(|p| p.title()); + self.open_game(ctx, path, index, None); + if let Some(g) = self.game.as_mut() { + g.previous = title; + g.previous_prep = true; + g.goto_ply(ply); + } + } + PrepAction::LoadDb(p) => { + if !self.library.loading(&p) && self.library.database(&p).is_none() { + self.library.load(&p, ctx); + } + } + // One engine job for the whole program: the live engine is off while + // the report is on the screen anyway (no game is open then). + PrepAction::EngineStarted => { + self.analysis.stop(); + self.live_paused = false; + } + PrepAction::EngineEnded => {} + PrepAction::NeedEngine => self + .engine_offer + .ask(crate::engine_offer::Pending::OpeningErrors, &self.settings), + PrepAction::EngineSwitch | PrepAction::SettingsChanged => self.settings_dirty = true, + PrepAction::OpenEngines => { + self.settings_ui.open = true; + self.settings_ui.tab = Tab::Engines; + } + PrepAction::Toast(m) => self.toast(ctx, m), + PrepAction::CopyText(text, msg) => { + ctx.copy_text(text); + self.toast(ctx, msg); + } + PrepAction::OpenPgn(text) => { + let title = self.prep.as_ref().map(|p| p.title()); + self.open_pgn_text(ctx, text, true); + if let Some(g) = self.game.as_mut() { + g.previous = title; + g.previous_prep = true; + } + } + PrepAction::FindPosition(path, start, line, flipped) => { + if let Some(p) = self.prep.as_mut() { + p.shown = false; + } + self.library.show_position(&path, start, line, flipped, ctx); + } + PrepAction::PlayFrom(from) => self.play_new(ctx, PlayNext::Dialog(Some(from))), + } + } + } + /// A message said once and seldom (a database made for the player): longer in view. fn toast_for(&mut self, ctx: &egui::Context, msg: impl Into, secs: f64) { self.toast = Some(Toast { @@ -2351,6 +2507,9 @@ impl App { return; } self.previous_games.clear(); + if let Some(p) = self.prep.as_mut() { + p.shown = false; + } if let Some(g) = closed && let Some(src) = g.source { @@ -2401,6 +2560,13 @@ impl App { fn toggle_engine(&mut self, ctx: &egui::Context) { self.live_paused = false; + if self.prep.as_ref().is_some_and(|p| p.running()) && !self.analysis.is_on() { + self.toast( + ctx, + tr("Opening errors are being searched — wait or stop it in the report"), + ); + return; + } if self.analysis.is_on() { self.analysis.stop(); return; @@ -2454,6 +2620,13 @@ impl App { } } } + Some(crate::engine_offer::Pending::OpeningErrors) => { + let actions = match self.prep.as_mut() { + Some(p) => p.start_after_engine(&self.settings, ctx), + None => Vec::new(), + }; + self.prep_actions(ctx, actions); + } None => {} } } @@ -2723,27 +2896,18 @@ impl eframe::App for App { // A new game's target base that left the shelf or stopped taking games is // dropped before the game is drawn (its header names the target). let _ = self.current_target(); + let shelf = self.shelf_dbs(); if let Some(game) = &mut self.game { let input_enabled = self.confirm_close.is_none(); // A database opened for the reference tab arrives here (the library is // not drawn while a game is shown). self.library.poll(); - self.reference.dbs = self - .settings - .databases - .iter() - .filter(|p| self.library.files.exists(p)) - .map(|p| crate::reference::RefDb { - path: p.clone(), - name: p - .file_stem() - .map(|s| s.to_string_lossy().into_owned()) - .unwrap_or_default(), - db: self.library.database(p), - failed: self.library.failure(p).map(str::to_owned), - bytes: self.library.file_size(p), - }) - .collect(); + self.reference.dbs = shelf; + // The preparation's engine goes on under the game; no game analysis meanwhile. + game.engine_busy = self.prep.as_ref().is_some_and(|p| p.running()); + if let Some(p) = self.prep.as_mut() { + p.poll_quietly(&ctx, &self.settings); + } let review = self.settings.review.clone(); let actions = game.show( ui, @@ -2794,7 +2958,9 @@ impl eframe::App for App { } GameAction::OpenUpdate => self.update_ui.open = true, GameAction::ReturnToPrevious => { - if !self.previous_games.is_empty() { + if !self.previous_games.is_empty() + || self.prep.as_ref().is_some_and(|p| p.shown) + { self.request_close(&ctx, CloseIntent::ReturnToPrevious); } } @@ -2923,8 +3089,37 @@ impl eframe::App for App { } } } + } else if self.prep.as_ref().is_some_and(|p| p.shown) { + // A database opened for the book arrives here (the library is not drawn). + self.library.poll(); + let actions = match self.prep.as_mut() { + Some(p) => { + p.dbs = shelf; + p.show(ui, &mut self.settings) + } + None => Vec::new(), + }; + self.prep_actions(&ctx, actions); } else { let dbs = self.settings.databases.clone(); + if let Some(p) = self.prep.as_mut() { + p.poll_quietly(&ctx, &self.settings); + } + // Ctrl+Shift+P: «Prepare against…» with the player of the filter. + if ctx.input_mut(|i| { + i.consume_shortcut(&KeyboardShortcut::new( + Modifiers::COMMAND | Modifiers::SHIFT, + Key::P, + )) + }) && self.prep_dialog.is_none() + && let Some((path, entry)) = self.library.prep_entry() + { + self.prep_dialog = Some(PrepDialog::new( + path, + entry.unwrap_or_default(), + &self.settings, + )); + } self.online_probe.poll(); self.library.online = self.online_probe.any(); self.library.online_busy = self.online.busy(); @@ -2992,6 +3187,9 @@ impl eframe::App for App { self.open_game(&ctx, path, index, None); self.edit_game_data(); } + LibraryAction::PrepareAgainst { path, entry } => { + self.prep_dialog = Some(PrepDialog::new(path, entry, &self.settings)); + } } } } @@ -3132,6 +3330,7 @@ impl eframe::App for App { self.confirm_dialog(&ctx); self.own_dialogs(&ctx); + self.prep_dialog(&ctx); // Whether the database the dialog names is there, as last found. if let Some(d) = self.play_dialog.as_mut() { d.target_there = d @@ -3227,6 +3426,9 @@ impl eframe::App for App { fn on_exit(&mut self) { self.analysis.stop(); + if let Some(p) = self.prep.as_mut() { + p.save(); + } // Downloads of online games stop and save what they got; a new database goes on // the shelf with it (the next download continues it). for p in self.online.stop_all() { diff --git a/apps/desktop/src/engine_offer.rs b/apps/desktop/src/engine_offer.rs index 7f732f6..73b11a3 100644 --- a/apps/desktop/src/engine_offer.rs +++ b/apps/desktop/src/engine_offer.rs @@ -19,6 +19,8 @@ pub const DOWNLOAD_INDICATOR: &str = "download_indicator"; pub enum Pending { LiveAnalysis, GameAnalysis, + /// The opponent preparation's search for opening errors. + OpeningErrors, } /// What the owner should do. @@ -129,6 +131,9 @@ impl EngineOffer { Some(Pending::LiveAnalysis) => { tr("Stockfish installed — analysis is on") } + Some(Pending::OpeningErrors) => { + tr("Stockfish installed — the search for opening errors started") + } None => tr("Stockfish installed"), } .to_string(), @@ -328,6 +333,9 @@ impl EngineOffer { Some(Pending::GameAnalysis) => { tr("Game analysis will start by itself when the download finishes.") } + Some(Pending::OpeningErrors) => { + tr("The search for opening errors will start by itself when the download finishes.") + } _ => tr("Analysis will start by itself when the download finishes."), }; ui.label(RichText::new(after).weak()); diff --git a/apps/desktop/src/game_view.rs b/apps/desktop/src/game_view.rs index 627d6a1..e652813 100644 --- a/apps/desktop/src/game_view.rs +++ b/apps/desktop/src/game_view.rs @@ -95,6 +95,11 @@ pub struct GameView { side_tab: SideTab, /// The game this one was opened from (reference tab): the title for "← back to". pub previous: Option, + /// The game was opened from the opponent preparation: «⬅ Back to preparation». + pub previous_prep: bool, + /// The engine is busy with the opponent preparation: no game analysis meanwhile + /// (one engine job for the whole program, opponent-prep.md §4.3). + pub engine_busy: bool, /// The game's data were asked once (on its first add); not again. pub data_asked: bool, /// A newer version to offer (its number), next to Settings. @@ -204,6 +209,8 @@ impl GameView { SideTab::Notation }, previous: None, + previous_prep: false, + engine_busy: false, data_asked: false, target: None, update: None, @@ -776,7 +783,11 @@ impl GameView { // «Analyse»: at once with the options chosen before, else the dialog first. if std::mem::take(&mut self.review_asked) { - if settings.review.chosen { + if self.engine_busy { + actions.push(GameAction::Toast( + tr("Opening errors are being searched — wait or stop it in the report").to_owned(), + )); + } else if settings.review.chosen { self.start_review(settings, true, ui.ctx(), &mut actions); } else { self.review.dialog_open = true; @@ -889,10 +900,13 @@ impl GameView { "Report: show or hide the evaluation graph and the report (Shift+A)", )); } else if ui - .button(big("📈")) + .add_enabled(!self.engine_busy, egui::Button::new(big("📈"))) .on_hover_text(tr( "Analyse game: accuracy, inaccuracies, mistakes, blunders (Shift+A)", )) + .on_disabled_hover_text(tr( + "Opening errors are being searched — wait or stop it in the report", + )) .clicked() { self.review_asked = true; @@ -935,10 +949,13 @@ impl GameView { RichText::new(format!("ℹ {}", self.diagnostics.len())).weak() } }); - let back_to = self - .previous - .as_ref() - .map(|t| trf("⬅ Back to {game}", &[("game", t)])); + let back_to = self.previous.as_ref().map(|t| { + if self.previous_prep { + tr("⬅ Back to preparation").to_owned() + } else { + trf("⬅ Back to {game}", &[("game", t)]) + } + }); // The buttons are measured first: the title gets what they leave (shortened with // "…"; the result always shows). When it would get under 160 pt, the buttons // around it give up their words for their icons (the words go to the tooltips). @@ -2125,6 +2142,19 @@ impl GameView { Some((start, line, self.flipped)) } + /// The cursor on move `ply` of the main line (0: the start; past the end: the + /// last move). + pub fn goto_ply(&mut self, ply: usize) { + let mut at = self.game.root(); + for _ in 0..ply { + match self.game.main_child(at) { + Some(n) => at = n, + None => break, + } + } + self.goto(at); + } + pub fn debug_advance(&mut self, plies: usize) { for _ in 0..plies { match self.game.main_child(self.cursor) { diff --git a/apps/desktop/src/i18n.rs b/apps/desktop/src/i18n.rs index 3b2e0c0..798d1df 100644 --- a/apps/desktop/src/i18n.rs +++ b/apps/desktop/src/i18n.rs @@ -13741,6 +13741,1249 @@ const ROWS: &[[&str; 9]] = &[ "Keyinga qoldirilgan o‘yin", "Кейінге қалдырылған ойын", ], + [ + "Opening errors are being searched — wait or stop it in the report", + "Идёт поиск ошибок в дебютах — дождитесь или остановите его в отчёте", + "La recherche d'erreurs d'ouverture est en cours — attendez ou arrêtez-la dans le rapport", + "Die Suche nach Eröffnungsfehlern läuft — warten Sie oder stoppen Sie sie im Bericht", + "Se están buscando errores de apertura — espere o deténgala en el informe", + "È in corso la ricerca degli errori di apertura — attendi o fermala nel rapporto", + "A busca de erros de abertura está em andamento — aguarde ou pare-a no relatório", + "Debyut xatolari qidirilmoqda — kuting yoki hisobotda to‘xtating", + "Дебют қателері ізделуде — күтіңіз немесе есепте тоқтатыңыз", + ], + [ + "⬅ Back to preparation", + "⬅ К подготовке", + "⬅ Retour à la préparation", + "⬅ Zurück zur Vorbereitung", + "⬅ Volver a la preparación", + "⬅ Torna alla preparazione", + "⬅ Voltar à preparação", + "⬅ Tayyorgarlikka qaytish", + "⬅ Дайындыққа оралу", + ], + [ + "♟ Prepare against an opponent…", + "♟ Подготовиться к сопернику…", + "♟ Se préparer contre un adversaire…", + "♟ Auf einen Gegner vorbereiten…", + "♟ Prepararse contra un rival…", + "♟ Prepararsi contro un avversario…", + "♟ Preparar-se contra um adversário…", + "♟ Raqibga tayyorlanish…", + "♟ Қарсыласқа дайындалу…", + ], + [ + "The player's openings by colour, with names, and the opening errors the engine finds (Ctrl+Shift+P)", + "Дебюты игрока по цветам, с названиями, и ошибки в дебюте, которые находит движок (Ctrl+Shift+P)", + "Les ouvertures du joueur par couleur, avec leurs noms, et les erreurs d'ouverture trouvées par le moteur (Ctrl+Maj+P)", + "Die Eröffnungen des Spielers nach Farbe, mit Namen, und die Eröffnungsfehler, die die Engine findet (Strg+Umschalt+P)", + "Las aperturas del jugador por color, con nombres, y los errores de apertura que encuentra el motor (Ctrl+Mayús+P)", + "Le aperture del giocatore per colore, con i nomi, e gli errori di apertura trovati dal motore (Ctrl+Maiusc+P)", + "As aberturas do jogador por cor, com nomes, e os erros de abertura que o motor encontra (Ctrl+Shift+P)", + "O‘yinchining ranglar bo‘yicha debyutlari, nomlari bilan, va dvijok topgan debyut xatolari (Ctrl+Shift+P)", + "Ойыншының түстер бойынша дебюттері, атауларымен, және қозғалтқыш тапқан дебют қателері (Ctrl+Shift+P)", + ], + [ + "♟ Prepare against {name}…", + "♟ Подготовиться к {name}…", + "♟ Se préparer contre {name}…", + "♟ Auf {name} vorbereiten…", + "♟ Prepararse contra {name}…", + "♟ Prepararsi contro {name}…", + "♟ Preparar-se contra {name}…", + "♟ {name} ga tayyorlanish…", + "♟ {name} қарсыласына дайындалу…", + ], + [ + "Stockfish installed — the search for opening errors started", + "Stockfish установлен — поиск ошибок в дебютах начат", + "Stockfish installé — la recherche d'erreurs d'ouverture a commencé", + "Stockfish installiert — die Suche nach Eröffnungsfehlern hat begonnen", + "Stockfish instalado — la búsqueda de errores de apertura ha comenzado", + "Stockfish installato — la ricerca degli errori di apertura è iniziata", + "Stockfish instalado — a busca de erros de abertura começou", + "Stockfish o‘rnatildi — debyut xatolarini qidirish boshlandi", + "Stockfish орнатылды — дебют қателерін іздеу басталды", + ], + [ + "The search for opening errors will start by itself when the download finishes.", + "Поиск ошибок в дебютах начнётся сам, когда загрузка закончится.", + "La recherche d'erreurs d'ouverture démarrera d'elle-même à la fin du téléchargement.", + "Die Suche nach Eröffnungsfehlern startet von selbst, wenn der Download fertig ist.", + "La búsqueda de errores de apertura empezará sola cuando termine la descarga.", + "La ricerca degli errori di apertura partirà da sola al termine del download.", + "A busca de erros de abertura começará sozinha quando o download terminar.", + "Yuklab olish tugagach debyut xatolarini qidirish o‘zi boshlanadi.", + "Жүктеу аяқталғанда дебют қателерін іздеу өзі басталады.", + ], + [ + "Both", + "Оба", + "Les deux", + "Beide", + "Ambos", + "Entrambi", + "Ambas", + "Ikkalasi", + "Екеуі", + ], + [ + "None", + "Нет", + "Aucun", + "Keines", + "Ninguno", + "Nessuno", + "Nenhum", + "Yo‘q", + "Жоқ", + ], + [ + "A book is a large database that shows up to which move his line is common and where he plays a rare move. A rare move is not a mistake.", + "Книга — большая база, по которой видно, до какого хода его линия обычна и где он играет редкий ход. Редкий ход — не ошибка.", + "Le livre est une grande base qui montre jusqu'à quel coup sa ligne est courante et où il joue un coup rare. Un coup rare n'est pas une erreur.", + "Das Buch ist eine große Datenbank, die zeigt, bis zu welchem Zug seine Linie üblich ist und wo er einen seltenen Zug spielt. Ein seltener Zug ist kein Fehler.", + "El libro es una base grande que muestra hasta qué jugada su línea es habitual y dónde juega una jugada rara. Una jugada rara no es un error.", + "Il libro è un grande database che mostra fino a quale mossa la sua linea è comune e dove gioca una mossa rara. Una mossa rara non è un errore.", + "O livro é uma base grande que mostra até que lance a linha dele é comum e onde ele joga um lance raro. Um lance raro não é um erro.", + "Kitob — katta baza: undan uning chizig‘i qaysi yurishgacha odatiy ekani va qayerda kam uchraydigan yurish qilishi ko‘rinadi. Kam uchraydigan yurish xato emas.", + "Кітап — үлкен база: одан оның желісі қай жүріске дейін әдеттегі екені және қай жерде сирек жүріс жасайтыны көрінеді. Сирек жүріс қате емес.", + ], + [ + "Preparing against an opponent", + "Подготовка к сопернику", + "Préparation contre un adversaire", + "Vorbereitung auf einen Gegner", + "Preparación contra un rival", + "Preparazione contro un avversario", + "Preparação contra um adversário", + "Raqibga tayyorgarlik", + "Қарсыласқа дайындық", + ], + [ + "Name or part of it", + "Имя или его часть", + "Nom ou une partie", + "Name oder ein Teil davon", + "Nombre o parte de él", + "Nome o parte di esso", + "Nome ou parte dele", + "Ism yoki uning qismi", + "Аты немесе оның бөлігі", + ], + [ + "Colour", + "Цвет", + "Couleur", + "Farbe", + "Color", + "Colore", + "Cor", + "Rang", + "Түс", + ], + [ + "Book", + "Книга", + "Livre", + "Buch", + "Libro", + "Libro", + "Livro", + "Kitob", + "Кітап", + ], + [ + "The book shows where he leaves the theory. «None» — without that column.", + "По книге видно, где он уходит из теории. «Нет» — без этой колонки.", + "Le livre montre où il quitte la théorie. « Aucun » — sans cette colonne.", + "Das Buch zeigt, wo er die Theorie verlässt. „Keines“ — ohne diese Spalte.", + "El libro muestra dónde deja la teoría. «Ninguno» — sin esa columna.", + "Il libro mostra dove lascia la teoria. «Nessuno» — senza quella colonna.", + "O livro mostra onde ele deixa a teoria. «Nenhum» — sem essa coluna.", + "Kitobdan uning nazariyadan qayerda chiqishi ko‘rinadi. «Yo‘q» — bu ustunsiz.", + "Кітаптан оның теориядан қай жерде шығатыны көрінеді. «Жоқ» — бұл бағансыз.", + ], + [ + "Open report", + "Открыть отчёт", + "Ouvrir le rapport", + "Bericht öffnen", + "Abrir informe", + "Apri rapporto", + "Abrir relatório", + "Hisobotni ochish", + "Есепті ашу", + ], + [ + "Tick a player", + "Отметьте игрока", + "Cochez un joueur", + "Wählen Sie einen Spieler", + "Marque un jugador", + "Spunta un giocatore", + "Marque um jogador", + "O‘yinchini belgilang", + "Ойыншыны белгілеңіз", + ], + [ + "Searching…", + "Ищу…", + "Recherche…", + "Suche…", + "Buscando…", + "Ricerca…", + "Procurando…", + "Qidirilmoqda…", + "Ізделуде…", + ], + [ + "Type a name: the players of the database are offered", + "Введите имя: будут предложены игроки базы", + "Tapez un nom : les joueurs de la base sont proposés", + "Geben Sie einen Namen ein: die Spieler der Datenbank werden angeboten", + "Escriba un nombre: se ofrecen los jugadores de la base", + "Digita un nome: vengono proposti i giocatori del database", + "Digite um nome: os jogadores da base são sugeridos", + "Ism kiriting: bazadagi o‘yinchilar taklif qilinadi", + "Атын теріңіз: базадағы ойыншылар ұсынылады", + ], + [ + "No such player in this database", + "В этой базе нет такого игрока", + "Aucun joueur de ce nom dans cette base", + "Kein solcher Spieler in dieser Datenbank", + "No hay tal jugador en esta base", + "Nessun giocatore così in questo database", + "Não há tal jogador nesta base", + "Bu bazada bunday o‘yinchi yo‘q", + "Бұл базада мұндай ойыншы жоқ", + ], + [ + "Similar names — most likely other people", + "Похожие имена — скорее всего, другие люди", + "Noms proches — probablement d'autres personnes", + "Ähnliche Namen — wahrscheinlich andere Personen", + "Nombres parecidos — probablemente otras personas", + "Nomi simili — probabilmente altre persone", + "Nomes parecidos — provavelmente outras pessoas", + "O‘xshash ismlar — ehtimol boshqa odamlar", + "Ұқсас есімдер — бәлкім, басқа адамдар", + ], + [ + "The games could not be read", + "Партии не удалось прочитать", + "Les parties n'ont pas pu être lues", + "Die Partien konnten nicht gelesen werden", + "No se pudieron leer las partidas", + "Impossibile leggere le partite", + "Não foi possível ler as partidas", + "Partiyalarni o‘qib bo‘lmadi", + "Партияларды оқу мүмкін болмады", + ], + [ + "the position search failed (not enough memory?)", + "поиск позиций не удался (не хватает памяти?)", + "la recherche de positions a échoué (mémoire insuffisante ?)", + "die Stellungssuche ist fehlgeschlagen (zu wenig Speicher?)", + "la búsqueda de posiciones falló (¿falta memoria?)", + "la ricerca delle posizioni è fallita (memoria insufficiente?)", + "a busca de posições falhou (memória insuficiente?)", + "pozitsiya qidiruvi bajarilmadi (xotira yetmayaptimi?)", + "позиция іздеу сәтсіз аяқталды (жад жетпей ме?)", + ], + [ + "Opening errors", + "Ошибки в дебютах", + "Erreurs d'ouverture", + "Eröffnungsfehler", + "Errores de apertura", + "Errori di apertura", + "Erros de abertura", + "Debyut xatolari", + "Дебют қателері", + ], + [ + "For opening errors “Fast” is usually enough. “Normal” is for adult databases and takes 4 times longer.", + "Для поиска ошибок в дебюте обычно достаточно «Быстро». «Обычно» — для взрослых баз, в 4 раза дольше.", + "Pour les erreurs d'ouverture, « Rapide » suffit en général. « Normal » est pour les bases d'adultes et prend 4 fois plus de temps.", + "Für Eröffnungsfehler reicht meist „Schnell“. „Normal“ ist für Datenbanken Erwachsener und dauert 4-mal länger.", + "Para errores de apertura suele bastar «Rápido». «Normal» es para bases de adultos y tarda 4 veces más.", + "Per gli errori di apertura di solito basta «Veloce». «Normale» è per database di adulti e richiede 4 volte più tempo.", + "Para erros de abertura, «Rápido» costuma bastar. «Normal» é para bases de adultos e leva 4 vezes mais.", + "Debyut xatolari uchun odatda «Tez» yetarli. «Oddiy» — kattalar bazalari uchun, 4 barobar uzoq.", + "Дебют қателері үшін әдетте «Жылдам» жеткілікті. «Қалыпты» — ересектер базалары үшін, 4 есе ұзақ.", + ], + [ + "identical positions are counted once", + "одинаковые позиции считаются один раз", + "les positions identiques ne sont comptées qu'une fois", + "gleiche Stellungen werden einmal gezählt", + "las posiciones idénticas se cuentan una vez", + "le posizioni identiche si contano una volta", + "posições idênticas são contadas uma vez", + "bir xil pozitsiyalar bir marta hisoblanadi", + "бірдей позициялар бір рет саналады", + ], + [ + "Find errors", + "Найти ошибки", + "Chercher les erreurs", + "Fehler suchen", + "Buscar errores", + "Trova errori", + "Procurar erros", + "Xatolarni topish", + "Қателерді табу", + ], + [ + "Settings (Ctrl+,)", + "Настройки (Ctrl+,)", + "Paramètres (Ctrl+,)", + "Einstellungen (Strg+,)", + "Ajustes (Ctrl+,)", + "Impostazioni (Ctrl+,)", + "Configurações (Ctrl+,)", + "Sozlamalar (Ctrl+,)", + "Баптаулар (Ctrl+,)", + ], + [ + "How deep the tree and the engine look", + "Как глубоко смотрят дерево и движок", + "Profondeur de l'arbre et du moteur", + "Wie tief Baum und Engine schauen", + "Hasta dónde miran el árbol y el motor", + "Quanto in profondità guardano l'albero e il motore", + "Até onde a árvore e o motor olham", + "Daraxt va dvijok qanchalik chuqur qaraydi", + "Ағаш пен қозғалтқыш қаншалықты терең қарайды", + ], + [ + "♙ Board", + "♙ Доска", + "♙ Échiquier", + "♙ Brett", + "♙ Tablero", + "♙ Scacchiera", + "♙ Tabuleiro", + "♙ Taxta", + "♙ Тақта", + ], + [ + "The board of the chosen position", + "Доска выбранной позиции", + "L'échiquier de la position choisie", + "Das Brett der gewählten Stellung", + "El tablero de la posición elegida", + "La scacchiera della posizione scelta", + "O tabuleiro da posição escolhida", + "Tanlangan pozitsiya taxtasi", + "Таңдалған позиция тақтасы", + ], + [ + "Errors found", + "Ошибки найдены", + "Erreurs trouvées", + "Fehler gefunden", + "Errores encontrados", + "Errori trovati", + "Erros encontrados", + "Xatolar topildi", + "Қателер табылды", + ], + [ + "The engine finds the opening errors in his games (Shift+A)", + "Движок находит ошибки в дебютах его партий (Shift+A)", + "Le moteur trouve les erreurs d'ouverture dans ses parties (Maj+A)", + "Die Engine findet die Eröffnungsfehler in seinen Partien (Umschalt+A)", + "El motor encuentra los errores de apertura en sus partidas (Mayús+A)", + "Il motore trova gli errori di apertura nelle sue partite (Maiusc+A)", + "O motor encontra os erros de abertura nas partidas dele (Shift+A)", + "Dvijok uning partiyalaridagi debyut xatolarini topadi (Shift+A)", + "Қозғалтқыш оның партияларындағы дебют қателерін табады (Shift+A)", + ], + [ + "Options…", + "Параметры…", + "Options…", + "Optionen…", + "Opciones…", + "Opzioni…", + "Opções…", + "Parametrlar…", + "Параметрлер…", + ], + [ + "As White", + "Белыми", + "Avec les Blancs", + "Mit Weiß", + "Con blancas", + "Con il Bianco", + "De brancas", + "Oq bilan", + "Ақпен", + ], + [ + "As Black", + "Чёрными", + "Avec les Noirs", + "Mit Schwarz", + "Con negras", + "Con il Nero", + "De pretas", + "Qora bilan", + "Қарамен", + ], + [ + "book…", + "книга…", + "livre…", + "Buch…", + "libro…", + "libro…", + "livro…", + "kitob…", + "кітап…", + ], + [ + "Choose a move in the tree, an opening or an error: its position is shown here", + "Выберите ход в дереве, дебют или ошибку: здесь будет его позиция", + "Choisissez un coup dans l'arbre, une ouverture ou une erreur : sa position s'affiche ici", + "Wählen Sie einen Zug im Baum, eine Eröffnung oder einen Fehler: seine Stellung erscheint hier", + "Elija una jugada del árbol, una apertura o un error: su posición se muestra aquí", + "Scegli una mossa nell'albero, un'apertura o un errore: la sua posizione appare qui", + "Escolha um lance na árvore, uma abertura ou um erro: a posição aparece aqui", + "Daraxtdan yurish, debyut yoki xatoni tanlang: uning pozitsiyasi shu yerda ko‘rinadi", + "Ағаштан жүріс, дебют немесе қате таңдаңыз: оның позициясы осында көрінеді", + ], + [ + "Open as a game", + "Открыть как партию", + "Ouvrir comme partie", + "Als Partie öffnen", + "Abrir como partida", + "Apri come partita", + "Abrir como partida", + "Partiya sifatida ochish", + "Партия ретінде ашу", + ], + [ + "The line as a new game, to add moves and comments", + "Линия как новая партия — чтобы дописать ходы и комментарии", + "La ligne comme nouvelle partie, pour ajouter des coups et des commentaires", + "Die Linie als neue Partie, um Züge und Kommentare hinzuzufügen", + "La línea como partida nueva, para añadir jugadas y comentarios", + "La linea come nuova partita, per aggiungere mosse e commenti", + "A linha como nova partida, para acrescentar lances e comentários", + "Chiziq yangi partiya sifatida — yurishlar va izohlar qo‘shish uchun", + "Желі жаңа партия ретінде — жүрістер мен түсініктемелер қосу үшін", + ], + [ + "Repertoire", + "Репертуар", + "Répertoire", + "Repertoire", + "Repertorio", + "Repertorio", + "Repertório", + "Repertuar", + "Репертуар", + ], + [ + "Openings", + "Дебюты", + "Ouvertures", + "Eröffnungen", + "Aperturas", + "Aperture", + "Aberturas", + "Debyutlar", + "Дебюттер", + ], + [ + "Errors", + "Ошибки", + "Erreurs", + "Fehler", + "Errores", + "Errori", + "Erros", + "Xatolar", + "Қателер", + ], + [ + "Collapse", + "Свернуть", + "Replier", + "Einklappen", + "Contraer", + "Comprimi", + "Recolher", + "Yig‘ish", + "Жию", + ], + [ + "Expand all", + "Раскрыть всё", + "Tout déplier", + "Alles ausklappen", + "Expandir todo", + "Espandi tutto", + "Expandir tudo", + "Hammasini yoyish", + "Барлығын жаю", + ], + [ + "Moves with fewer games fold into «other moves»", + "Ходы с меньшим числом партий сворачиваются в «другие ходы»", + "Les coups avec moins de parties sont regroupés dans « autres coups »", + "Züge mit weniger Partien werden zu „andere Züge“ zusammengefasst", + "Las jugadas con menos partidas se agrupan en «otras jugadas»", + "Le mosse con meno partite si raggruppano in «altre mosse»", + "Lances com menos partidas são agrupados em «outros lances»", + "Partiyasi kamroq yurishlar «boshqa yurishlar»ga yig‘iladi", + "Партиясы азырақ жүрістер «басқа жүрістерге» жиналады", + ], + [ + "In database", + "В базе", + "Dans la base", + "In der Datenbank", + "En la base", + "Nel database", + "Na base", + "Bazada", + "Базада", + ], + [ + "His moves plain, the opponents' weak; ⇄ — the position is reached by another move order too", + "Его ходы — обычным, ходы соперников — слабым; ⇄ — к позиции приходят и другим порядком ходов", + "Ses coups en clair, ceux des adversaires en pâle ; ⇄ — la position est aussi atteinte par un autre ordre de coups", + "Seine Züge normal, die der Gegner blass; ⇄ — die Stellung wird auch über eine andere Zugfolge erreicht", + "Sus jugadas en normal, las de los rivales en tenue; ⇄ — la posición también se alcanza por otro orden de jugadas", + "Le sue mosse in chiaro, quelle degli avversari attenuate; ⇄ — la posizione si raggiunge anche con un altro ordine di mosse", + "Os lances dele em normal, os dos adversários esmaecidos; ⇄ — a posição também é alcançada por outra ordem de lances", + "Uning yurishlari oddiy, raqiblarniki xira; ⇄ — pozitsiyaga boshqa tartibda ham kelinadi", + "Оның жүрістері әдеттегі, қарсыластарынікі күңгірт; ⇄ — позицияға басқа жүріс ретімен де келеді", + ], + [ + "Share of the games of the move above", + "Доля от партий хода выше", + "Part des parties du coup au-dessus", + "Anteil an den Partien des Zuges darüber", + "Parte de las partidas de la jugada superior", + "Quota delle partite della mossa sopra", + "Parte das partidas do lance acima", + "Yuqoridagi yurish partiyalaridan ulush", + "Жоғарыдағы жүріс партияларынан үлес", + ], + [ + "Score", + "Счёт", + "Score", + "Ergebnis", + "Puntuación", + "Punteggio", + "Pontuação", + "Hisob", + "Есеп", + ], + [ + "The opponent's points in these games", + "Очки соперника в этих партиях", + "Les points de l'adversaire dans ces parties", + "Die Punkte des Gegners in diesen Partien", + "Los puntos del rival en estas partidas", + "I punti dell'avversario in queste partite", + "Os pontos do adversário nestas partidas", + "Raqibning bu partiyalardagi ochkolari", + "Қарсыластың осы партиялардағы ұпайлары", + ], + [ + "Last", + "Последняя", + "Dernière", + "Letzte", + "Última", + "Ultima", + "Última", + "Oxirgi", + "Соңғы", + ], + [ + "Games of the book in this position; the first number under the threshold is where he leaves the book", + "Партий книги в этой позиции; первое число ниже порога — здесь он выходит из книги", + "Parties du livre dans cette position ; le premier nombre sous le seuil marque sa sortie du livre", + "Partien des Buches in dieser Stellung; die erste Zahl unter der Schwelle: hier verlässt er das Buch", + "Partidas del libro en esta posición; el primer número bajo el umbral es donde deja el libro", + "Partite del libro in questa posizione; il primo numero sotto la soglia è dove lascia il libro", + "Partidas do livro nesta posição; o primeiro número abaixo do limite é onde ele deixa o livro", + "Bu pozitsiyadagi kitob partiyalari; chegaradan past birinchi son — u kitobdan shu yerda chiqadi", + "Осы позициядағы кітап партиялары; шектен төмен бірінші сан — ол кітаптан осы жерде шығады", + ], + [ + "Few games: percentages are unreliable", + "Мало партий — проценты ненадёжны", + "Peu de parties : les pourcentages ne sont pas fiables", + "Wenige Partien: die Prozente sind unzuverlässig", + "Pocas partidas: los porcentajes no son fiables", + "Poche partite: le percentuali non sono affidabili", + "Poucas partidas: as porcentagens não são confiáveis", + "Partiyalar kam: foizlar ishonchsiz", + "Партиялар аз: пайыздар сенімсіз", + ], + [ + "First moves", + "Первые ходы", + "Premiers coups", + "Erste Züge", + "Primeras jugadas", + "Prime mosse", + "Primeiros lances", + "Birinchi yurishlar", + "Алғашқы жүрістер", + ], + [ + "♙ White", + "♙ Белыми", + "♙ Blancs", + "♙ Weiß", + "♙ Blancas", + "♙ Bianco", + "♙ Brancas", + "♙ Oq", + "♙ Ақ", + ], + [ + "♟ Black", + "♟ Чёрными", + "♟ Noirs", + "♟ Schwarz", + "♟ Negras", + "♟ Nero", + "♟ Pretas", + "♟ Qora", + "♟ Қара", + ], + [ + "no name", + "без названия", + "sans nom", + "ohne Namen", + "sin nombre", + "senza nome", + "sem nome", + "nomsiz", + "атаусыз", + ], + [ + "no deeper name", + "без названия глубже", + "sans nom plus loin", + "kein tieferer Name", + "sin nombre más adelante", + "nessun nome più avanti", + "sem nome mais adiante", + "chuqurroq nom yo‘q", + "тереңірек атау жоқ", + ], + [ + "in both colours", + "обоими цветами", + "avec les deux couleurs", + "mit beiden Farben", + "con ambos colores", + "con entrambi i colori", + "com ambas as cores", + "ikkala rang bilan", + "екі түспен де", + ], + [ + "▶ Find opening errors", + "▶ Найти ошибки в дебютах", + "▶ Chercher les erreurs d'ouverture", + "▶ Eröffnungsfehler suchen", + "▶ Buscar errores de apertura", + "▶ Trova gli errori di apertura", + "▶ Procurar erros de abertura", + "▶ Debyut xatolarini topish", + "▶ Дебют қателерін табу", + ], + [ + "More precisely…", + "Точнее…", + "Plus précisément…", + "Genauer…", + "Con más precisión…", + "Più precisamente…", + "Com mais precisão…", + "Aniqroq…", + "Дәлірек…", + ], + [ + "The same positions at «Normal» quality", + "Те же позиции с качеством «Обычно»", + "Les mêmes positions en qualité « Normal »", + "Dieselben Stellungen in Qualität „Normal“", + "Las mismas posiciones con calidad «Normal»", + "Le stesse posizioni con qualità «Normale»", + "As mesmas posições com qualidade «Normal»", + "O‘sha pozitsiyalar «Oddiy» sifatda", + "Сол позициялар «Қалыпты» сапада", + ], + [ + "of the checked positions", + "из проверенных позиций", + "sur les positions vérifiées", + "von den geprüften Stellungen", + "de las posiciones comprobadas", + "delle posizioni verificate", + "das posições verificadas", + "tekshirilgan pozitsiyalardan", + "тексерілген позициялардан", + ], + [ + "Repeated errors — the same position, the same move", + "Повторяющиеся ошибки — одна и та же позиция, тот же ход", + "Erreurs répétées — même position, même coup", + "Wiederholte Fehler — dieselbe Stellung, derselbe Zug", + "Errores repetidos — la misma posición, la misma jugada", + "Errori ripetuti — la stessa posizione, la stessa mossa", + "Erros repetidos — a mesma posição, o mesmo lance", + "Takrorlanuvchi xatolar — o‘sha pozitsiya, o‘sha yurish", + "Қайталанатын қателер — сол позиция, сол жүріс", + ], + [ + "None so far", + "Пока нет", + "Aucune pour l'instant", + "Bisher keine", + "Ninguno por ahora", + "Nessuno finora", + "Nenhum até agora", + "Hozircha yo‘q", + "Әзірге жоқ", + ], + [ + "Position", + "Позиция", + "Position", + "Stellung", + "Posición", + "Posizione", + "Posição", + "Pozitsiya", + "Позиция", + ], + [ + "Played", + "Сыграл", + "Joué", + "Gespielt", + "Jugó", + "Giocata", + "Jogou", + "O‘ynadi", + "Жүрді", + ], + [ + "Better", + "Лучше", + "Mieux", + "Besser", + "Mejor", + "Meglio", + "Melhor", + "Yaxshiroq", + "Жақсырақ", + ], + [ + "start", + "начало", + "début", + "Anfang", + "inicio", + "inizio", + "início", + "boshlanish", + "басы", + ], + [ + "By opening", + "По дебютам", + "Par ouverture", + "Nach Eröffnung", + "Por apertura", + "Per apertura", + "Por abertura", + "Debyutlar bo‘yicha", + "Дебюттер бойынша", + ], + [ + "All games", + "Все партии", + "Toutes les parties", + "Alle Partien", + "Todas las partidas", + "Tutte le partite", + "Todas as partidas", + "Barcha partiyalar", + "Барлық партиялар", + ], + [ + "His marked moves in the opening of this game", + "Его отмеченные ходы в дебюте этой партии", + "Ses coups marqués dans l'ouverture de cette partie", + "Seine markierten Züge in der Eröffnung dieser Partie", + "Sus jugadas marcadas en la apertura de esta partida", + "Le sue mosse segnate nell'apertura di questa partita", + "Os lances marcados dele na abertura desta partida", + "Bu partiya debyutidagi uning belgilangan yurishlari", + "Осы партия дебютіндегі оның белгіленген жүрістері", + ], + [ + "This database ({name})", + "Эта же база ({name})", + "Cette base ({name})", + "Diese Datenbank ({name})", + "Esta misma base ({name})", + "Questo database ({name})", + "Esta mesma base ({name})", + "Shu baza ({name})", + "Осы база ({name})", + ], + [ + "Selected: {names} · {n}", + "Отмечено: {names} · {n}", + "Sélection : {names} · {n}", + "Gewählt: {names} · {n}", + "Marcados: {names} · {n}", + "Selezionati: {names} · {n}", + "Marcados: {names} · {n}", + "Belgilandi: {names} · {n}", + "Белгіленді: {names} · {n}", + ], + [ + "White — {n}", + "Белые — {n}", + "Blancs — {n}", + "Weiß — {n}", + "Blancas — {n}", + "Bianco — {n}", + "Brancas — {n}", + "Oq — {n}", + "Ақ — {n}", + ], + [ + "Black — {n}", + "Чёрные — {n}", + "Noirs — {n}", + "Schwarz — {n}", + "Negras — {n}", + "Nero — {n}", + "Pretas — {n}", + "Qora — {n}", + "Қара — {n}", + ], + [ + "Preparing against {name}", + "Подготовка к сопернику: {name}", + "Préparation contre {name}", + "Vorbereitung auf {name}", + "Preparación contra {name}", + "Preparazione contro {name}", + "Preparação contra {name}", + "Tayyorgarlik: {name}", + "Дайындық: {name}", + ], + [ + "The engine evaluates the first {n} moves of every game of the opponent. The games are not changed.", + "Движок оценит первые {n} ходов каждой партии соперника. Партии не меняются.", + "Le moteur évalue les {n} premiers coups de chaque partie de l'adversaire. Les parties ne sont pas modifiées.", + "Die Engine bewertet die ersten {n} Züge jeder Partie des Gegners. Die Partien werden nicht verändert.", + "El motor evalúa las primeras {n} jugadas de cada partida del rival. Las partidas no se modifican.", + "Il motore valuta le prime {n} mosse di ogni partita dell'avversario. Le partite non vengono modificate.", + "O motor avalia os primeiros {n} lances de cada partida do adversário. As partidas não são alteradas.", + "Dvijok raqibning har bir partiyasidagi dastlabki {n} yurishni baholaydi. Partiyalar o‘zgarmaydi.", + "Қозғалтқыш қарсыластың әр партиясының алғашқы {n} жүрісін бағалайды. Партиялар өзгермейді.", + ], + [ + "identical positions are counted once; {n} already evaluated earlier", + "одинаковые позиции считаются один раз; {n} уже оценены раньше", + "les positions identiques ne sont comptées qu'une fois ; {n} déjà évaluées", + "gleiche Stellungen werden einmal gezählt; {n} schon früher bewertet", + "las posiciones idénticas se cuentan una vez; {n} ya evaluadas antes", + "le posizioni identiche si contano una volta; {n} già valutate prima", + "posições idênticas são contadas uma vez; {n} já avaliadas antes", + "bir xil pozitsiyalar bir marta hisoblanadi; {n} tasi avval baholangan", + "бірдей позициялар бір рет саналады; {n} бұрын бағаланған", + ], + [ + "+{n} spelling", + "+{n} написание", + "+{n} orthographe", + "+{n} Schreibweise", + "+{n} grafía", + "+{n} grafia", + "+{n} grafia", + "+{n} yozilish", + "+{n} жазылу", + ], + [ + "not counted: from a set position — {n}", + "не учтены: с заданной позиции — {n}", + "non comptées : depuis une position donnée — {n}", + "nicht gezählt: aus einer Ausgangsstellung — {n}", + "no contadas: desde una posición dada — {n}", + "non contate: da una posizione data — {n}", + "não contadas: de uma posição dada — {n}", + "hisobga olinmadi: berilgan pozitsiyadan — {n}", + "есептелмеді: берілген позициядан — {n}", + ], + [ + "Book: could not open — {reason}", + "Книга: не открылась — {reason}", + "Livre : ouverture impossible — {reason}", + "Buch: konnte nicht geöffnet werden — {reason}", + "Libro: no se pudo abrir — {reason}", + "Libro: impossibile aprire — {reason}", + "Livro: não foi possível abrir — {reason}", + "Kitob: ochilmadi — {reason}", + "Кітап: ашылмады — {reason}", + ], + [ + "Opening: {n} moves", + "Дебют: {n} ходов", + "Ouverture : {n} coups", + "Eröffnung: {n} Züge", + "Apertura: {n} jugadas", + "Apertura: {n} mosse", + "Abertura: {n} lances", + "Debyut: {n} yurish", + "Дебют: {n} жүріс", + ], + [ + "Finding errors: {done} of {total} positions · ≈ {time}", + "Ищу ошибки: {done} из {total} позиций · ≈ {time}", + "Recherche d'erreurs : {done} sur {total} positions · ≈ {time}", + "Fehlersuche: {done} von {total} Stellungen · ≈ {time}", + "Buscando errores: {done} de {total} posiciones · ≈ {time}", + "Ricerca errori: {done} di {total} posizioni · ≈ {time}", + "Procurando erros: {done} de {total} posições · ≈ {time}", + "Xatolar qidirilmoqda: {total} dan {done} pozitsiya · ≈ {time}", + "Қателер ізделуде: {total} ішінен {done} позиция · ≈ {time}", + ], + [ + "▶ Errors ≈ {time}", + "▶ Ошибки ≈ {time}", + "▶ Erreurs ≈ {time}", + "▶ Fehler ≈ {time}", + "▶ Errores ≈ {time}", + "▶ Errori ≈ {time}", + "▶ Erros ≈ {time}", + "▶ Xatolar ≈ {time}", + "▶ Қателер ≈ {time}", + ], + [ + "Analyse {n} more positions ≈ {time}", + "Доразобрать {n} позиций ≈ {time}", + "Analyser {n} positions de plus ≈ {time}", + "{n} weitere Stellungen analysieren ≈ {time}", + "Analizar {n} posiciones más ≈ {time}", + "Analizza altre {n} posizioni ≈ {time}", + "Analisar mais {n} posições ≈ {time}", + "Yana {n} pozitsiyani tahlil qilish ≈ {time}", + "Тағы {n} позицияны талдау ≈ {time}", + ], + [ + "▶ Find opening errors ≈ {time}", + "▶ Найти ошибки в дебютах ≈ {time}", + "▶ Chercher les erreurs d'ouverture ≈ {time}", + "▶ Eröffnungsfehler suchen ≈ {time}", + "▶ Buscar errores de apertura ≈ {time}", + "▶ Trova gli errori di apertura ≈ {time}", + "▶ Procurar erros de abertura ≈ {time}", + "▶ Debyut xatolarini topish ≈ {time}", + "▶ Дебют қателерін табу ≈ {time}", + ], + [ + "Errors found · {engine} · {quality} · {n} positions", + "Ошибки найдены · {engine} · {quality} · {n} позиций", + "Erreurs trouvées · {engine} · {quality} · {n} positions", + "Fehler gefunden · {engine} · {quality} · {n} Stellungen", + "Errores encontrados · {engine} · {quality} · {n} posiciones", + "Errori trovati · {engine} · {quality} · {n} posizioni", + "Erros encontrados · {engine} · {quality} · {n} posições", + "Xatolar topildi · {engine} · {quality} · {n} pozitsiya", + "Қателер табылды · {engine} · {quality} · {n} позиция", + ], + [ + "opponents ≈ {elo}", + "соперники ≈ {elo}", + "adversaires ≈ {elo}", + "Gegner ≈ {elo}", + "rivales ≈ {elo}", + "avversari ≈ {elo}", + "adversários ≈ {elo}", + "raqiblar ≈ {elo}", + "қарсыластар ≈ {elo}", + ], + [ + "last {date}", + "последняя {date}", + "dernière {date}", + "letzte {date}", + "última {date}", + "ultima {date}", + "última {date}", + "oxirgisi {date}", + "соңғысы {date}", + ], + [ + "leaves the book at move {n}, first in {p} % of games", + "из книги выходит на {n}-м ходу, первым — в {p} % партий", + "quitte le livre au coup {n}, le premier dans {p} % des parties", + "verlässt das Buch bei Zug {n}, als Erster in {p} % der Partien", + "deja el libro en la jugada {n}, el primero en el {p} % de las partidas", + "lascia il libro alla mossa {n}, per primo nel {p} % delle partite", + "deixa o livro no lance {n}, primeiro em {p} % das partidas", + "kitobdan {n}-yurishda chiqadi, partiyalarning {p} % ida birinchi bo‘lib", + "кітаптан {n}-жүрісте шығады, партиялардың {p} % інде бірінші болып", + ], + [ + "Opening errors: {i} inaccuracies · {m} mistakes · {b} blunders — in {g} games ({p} %)", + "Ошибок в дебюте: неточностей {i} · ошибок {m} · зевков {b} — в {g} партиях ({p} %)", + "Erreurs d'ouverture : {i} imprécisions · {m} erreurs · {b} gaffes — dans {g} parties ({p} %)", + "Eröffnungsfehler: {i} Ungenauigkeiten · {m} Fehler · {b} grobe Fehler — in {g} Partien ({p} %)", + "Errores de apertura: {i} imprecisiones · {m} errores · {b} errores graves — en {g} partidas ({p} %)", + "Errori di apertura: {i} imprecisioni · {m} errori · {b} svarioni — in {g} partite ({p} %)", + "Erros de abertura: {i} imprecisões · {m} erros · {b} erros graves — em {g} partidas ({p} %)", + "Debyut xatolari: {i} noaniqlik · {m} xato · {b} qo‘pol xato — {g} partiyada ({p} %)", + "Дебют қателері: {i} дәлсіздік · {m} қате · {b} өрескел қате — {g} партияда ({p} %)", + ], + [ + "Few games ({n}): percentages and scores are unreliable", + "Партий мало ({n}) — проценты и счёт ненадёжны", + "Peu de parties ({n}) : pourcentages et scores ne sont pas fiables", + "Wenige Partien ({n}): Prozente und Ergebnisse sind unzuverlässig", + "Pocas partidas ({n}): porcentajes y puntuaciones no son fiables", + "Poche partite ({n}): percentuali e punteggi non sono affidabili", + "Poucas partidas ({n}): porcentagens e pontuações não são confiáveis", + "Partiyalar kam ({n}): foizlar va hisob ishonchsiz", + "Партиялар аз ({n}): пайыздар мен есеп сенімсіз", + ], + [ + "Collecting games… {p} %", + "Собираю партии… {p} %", + "Collecte des parties… {p} %", + "Partien werden gesammelt… {p} %", + "Reuniendo partidas… {p} %", + "Raccolta delle partite… {p} %", + "Reunindo partidas… {p} %", + "Partiyalar yig‘ilmoqda… {p} %", + "Партиялар жиналуда… {p} %", + ], + [ + "Branches from {n} games", + "Ветви от {n} партий", + "Branches dès {n} parties", + "Zweige ab {n} Partien", + "Ramas desde {n} partidas", + "Rami da {n} partite", + "Ramos a partir de {n} partidas", + "{n} partiyadan shoxlar", + "{n} партиядан тармақтар", + ], + [ + "other moves ({n})", + "другие ходы ({n})", + "autres coups ({n})", + "andere Züge ({n})", + "otras jugadas ({n})", + "altre mosse ({n})", + "outros lances ({n})", + "boshqa yurishlar ({n})", + "басқа жүрістер ({n})", + ], + [ + "Reached by another move order too: {orders}", + "К позиции приходили и другим порядком: {orders}", + "Aussi atteinte par un autre ordre de coups : {orders}", + "Auch über eine andere Zugfolge erreicht: {orders}", + "También alcanzada por otro orden de jugadas: {orders}", + "Raggiunta anche con un altro ordine di mosse: {orders}", + "Também alcançada por outra ordem de lances: {orders}", + "Boshqa tartibda ham kelingan: {orders}", + "Басқа жүріс ретімен де келген: {orders}", + ], + [ + "Mistake: better {best} ({before} → {after}) · in {n} games", + "Ошибка: лучше {best} (оценка {before} → {after}) · в {n} партиях", + "Erreur : mieux {best} ({before} → {after}) · dans {n} parties", + "Fehler: besser {best} ({before} → {after}) · in {n} Partien", + "Error: mejor {best} ({before} → {after}) · en {n} partidas", + "Errore: meglio {best} ({before} → {after}) · in {n} partite", + "Erro: melhor {best} ({before} → {after}) · em {n} partidas", + "Xato: yaxshisi {best} ({before} → {after}) · {n} partiyada", + "Қате: жақсысы {best} ({before} → {after}) · {n} партияда", + ], + [ + "Here he leaves the book: in “{book}” this position occurs {n} times", + "Здесь он выходит из книги: в «{book}» такая позиция встречается {n} раз", + "Ici il quitte le livre : dans « {book} » cette position apparaît {n} fois", + "Hier verlässt er das Buch: in „{book}“ kommt diese Stellung {n}-mal vor", + "Aquí deja el libro: en «{book}» esta posición aparece {n} veces", + "Qui lascia il libro: in «{book}» questa posizione compare {n} volte", + "Aqui ele deixa o livro: em «{book}» esta posição aparece {n} vezes", + "Bu yerda u kitobdan chiqadi: «{book}» da bu pozitsiya {n} marta uchraydi", + "Мұнда ол кітаптан шығады: «{book}» ішінде бұл позиция {n} рет кездеседі", + ], + [ + "No games as {colour}. As {other} — {n}", + "{colour} партий нет. {other} — {n}", + "Aucune partie avec les {colour}. Avec les {other} — {n}", + "Keine Partien mit {colour}. Mit {other} — {n}", + "No hay partidas con {colour}. Con {other} — {n}", + "Nessuna partita con il {colour}. Con il {other} — {n}", + "Nenhuma partida de {colour}. De {other} — {n}", + "{colour} bilan partiyalar yo‘q. {other} bilan — {n}", + "{colour} партиялар жоқ. {other} — {n}", + ], + [ + "Show {other}", + "Показать {other}", + "Afficher {other}", + "{other} zeigen", + "Mostrar {other}", + "Mostra {other}", + "Mostrar {other}", + "{other} ko‘rsatish", + "{other} көрсету", + ], + [ + "The engine has not searched for errors yet. It will check the first {n} moves of {games} games {colour} — {positions} positions, about {time}.", + "Движок ещё не искал ошибки. Он проверит первые {n} ходов {games} партий {colour} — {positions} позиций, около {time}.", + "Le moteur n'a pas encore cherché d'erreurs. Il vérifiera les {n} premiers coups de {games} parties {colour} — {positions} positions, environ {time}.", + "Die Engine hat noch nicht nach Fehlern gesucht. Sie prüft die ersten {n} Züge von {games} Partien {colour} — {positions} Stellungen, etwa {time}.", + "El motor aún no ha buscado errores. Comprobará las primeras {n} jugadas de {games} partidas {colour} — {positions} posiciones, unos {time}.", + "Il motore non ha ancora cercato errori. Controllerà le prime {n} mosse di {games} partite {colour} — {positions} posizioni, circa {time}.", + "O motor ainda não procurou erros. Ele verificará os primeiros {n} lances de {games} partidas {colour} — {positions} posições, cerca de {time}.", + "Dvijok hali xatolarni qidirmadi. U {colour} {games} partiyaning dastlabki {n} yurishini tekshiradi — {positions} pozitsiya, taxminan {time}.", + "Қозғалтқыш әлі қателерді іздеген жоқ. Ол {colour} {games} партияның алғашқы {n} жүрісін тексереді — {positions} позиция, шамамен {time}.", + ], + [ + "Checked {done} of {total} positions", + "Проверено {done} из {total} позиций", + "{done} positions vérifiées sur {total}", + "{done} von {total} Stellungen geprüft", + "Comprobadas {done} de {total} posiciones", + "Verificate {done} di {total} posizioni", + "Verificadas {done} de {total} posições", + "{total} dan {done} pozitsiya tekshirildi", + "{total} ішінен {done} позиция тексерілді", + ], + [ + "{i} inaccuracies · {m} mistakes · {b} blunders — in {g} games of {t} ({p} %)", + "неточностей {i} · ошибок {m} · зевков {b} — в {g} партиях из {t} ({p} %)", + "{i} imprécisions · {m} erreurs · {b} gaffes — dans {g} parties sur {t} ({p} %)", + "{i} Ungenauigkeiten · {m} Fehler · {b} grobe Fehler — in {g} von {t} Partien ({p} %)", + "{i} imprecisiones · {m} errores · {b} errores graves — en {g} partidas de {t} ({p} %)", + "{i} imprecisioni · {m} errori · {b} svarioni — in {g} partite su {t} ({p} %)", + "{i} imprecisões · {m} erros · {b} erros graves — em {g} partidas de {t} ({p} %)", + "{i} noaniqlik · {m} xato · {b} qo‘pol xato — {t} tadan {g} partiyada ({p} %)", + "{i} дәлсіздік · {m} қате · {b} өрескел қате — {t} ішінен {g} партияда ({p} %)", + ], + [ + "No errors in the first {n} moves ({i} inaccuracies).", + "В первых {n} ходах ошибок не нашлось (неточностей {i}).", + "Pas d'erreur dans les {n} premiers coups ({i} imprécisions).", + "Keine Fehler in den ersten {n} Zügen ({i} Ungenauigkeiten).", + "Sin errores en las primeras {n} jugadas ({i} imprecisiones).", + "Nessun errore nelle prime {n} mosse ({i} imprecisioni).", + "Sem erros nos primeiros {n} lances ({i} imprecisões).", + "Dastlabki {n} yurishda xato topilmadi ({i} noaniqlik).", + "Алғашқы {n} жүрісте қате табылмады ({i} дәлсіздік).", + ], + [ + "Deeper: {n} moves", + "Глубже: {n} ходов", + "Plus loin : {n} coups", + "Tiefer: {n} Züge", + "Más profundo: {n} jugadas", + "Più a fondo: {n} mosse", + "Mais fundo: {n} lances", + "Chuqurroq: {n} yurish", + "Тереңірек: {n} жүріс", + ], + [ + "better {best}", + "лучше {best}", + "mieux {best}", + "besser {best}", + "mejor {best}", + "meglio {best}", + "melhor {best}", + "yaxshisi {best}", + "жақсысы {best}", + ], + [ + "Games · {n}", + "Партии · {n}", + "Parties · {n}", + "Partien · {n}", + "Partidas · {n}", + "Partite · {n}", + "Partidas · {n}", + "Partiyalar · {n}", + "Партиялар · {n}", + ], + [ + "Games · after {move} · {n}", + "Партии · после {move} · {n}", + "Parties · après {move} · {n}", + "Partien · nach {move} · {n}", + "Partidas · tras {move} · {n}", + "Partite · dopo {move} · {n}", + "Partidas · após {move} · {n}", + "Partiyalar · {move} dan keyin · {n}", + "Партиялар · {move} кейін · {n}", + ], + [ + "Games · {opening} · {n}", + "Партии · {opening} · {n}", + "Parties · {opening} · {n}", + "Partien · {opening} · {n}", + "Partidas · {opening} · {n}", + "Partite · {opening} · {n}", + "Partidas · {opening} · {n}", + "Partiyalar · {opening} · {n}", + "Партиялар · {opening} · {n}", + ], + [ + "Games · {move} · {n}", + "Партии · {move} · {n}", + "Parties · {move} · {n}", + "Partien · {move} · {n}", + "Partidas · {move} · {n}", + "Partite · {move} · {n}", + "Partidas · {move} · {n}", + "Partiyalar · {move} · {n}", + "Партиялар · {move} · {n}", + ], + [ + "{played} — better {best} · {before} → {after}", + "{played} — лучше {best} · {before} → {after}", + "{played} — mieux {best} · {before} → {after}", + "{played} — besser {best} · {before} → {after}", + "{played} — mejor {best} · {before} → {after}", + "{played} — meglio {best} · {before} → {after}", + "{played} — melhor {best} · {before} → {after}", + "{played} — yaxshisi {best} · {before} → {after}", + "{played} — жақсысы {best} · {before} → {after}", + ], ]; #[cfg(test)] @@ -13799,6 +15042,7 @@ mod tests { include_str!("translate_ui.rs"), include_str!("chatgpt.rs"), include_str!("san.rs"), + include_str!("prep_ui.rs"), ]; let mut chars = std::collections::BTreeSet::new(); for row in ROWS { @@ -13870,6 +15114,7 @@ mod tests { include_str!("translate_ui.rs"), include_str!("chatgpt.rs"), include_str!("san.rs"), + include_str!("prep_ui.rs"), ]; let mut missing = Vec::new(); let mut found = 0; diff --git a/apps/desktop/src/large_db.rs b/apps/desktop/src/large_db.rs index c0a2dfc..bc11dbd 100644 --- a/apps/desktop/src/large_db.rs +++ b/apps/desktop/src/large_db.rs @@ -22,6 +22,7 @@ use shakmaty::uci::UciMove; use crate::board_search::{self, Background, BoardEvent, SearchBoard}; use crate::i18n::{tr, trf}; use crate::library::LibraryAction; +use crate::prep_ui::PrepEntry; use crate::settings::Settings; use crate::viewed::{self, Viewed}; @@ -335,6 +336,9 @@ pub struct LargeView { drawer_top: f32, /// The quick search has the keyboard (arrows and Enter go to the table). search_focused: bool, + /// «Prepare against…» was asked (the panel's button, a row's menu): the library + /// takes it (docs/design/opponent-prep.md §2.1). + pub prepare: Option, } impl LargeView { @@ -419,6 +423,7 @@ impl LargeView { drawer_open: drawer, drawer_asked: false, drawer_top: 0.0, + prepare: None, } } @@ -1297,9 +1302,36 @@ impl LargeView { .response .on_disabled_hover_text(tr("Enter a player first")); }); + // Preparing against the player: with the name picked from the list, else the + // dialog offers the names that match the text (opponent-prep.md §2.1). + if player_set { + let label = match self.form.player.exact { + Some(_) => trf("♟ Prepare against {name}…", &[("name", &self.form.player.text)]), + None => tr("♟ Prepare against an opponent…").to_owned(), + }; + if ui + .add(egui::Button::new(label).truncate()) + .on_hover_text(tr( + "The player's openings by colour, with names, and the opening errors the engine finds (Ctrl+Shift+P)", + )) + .clicked() + { + self.prepare = self.prep_entry(); + } + } self.name_field(ui, db, NameField::Opponent, tr("Opponent")); } + /// «Prepare against…» for the player of the filter: the name picked from the list + /// (or the text typed) and the colour of the filter. + pub fn prep_entry(&self) -> Option { + self.form.player.is_set().then(|| PrepEntry { + query: self.form.player.text.trim().to_owned(), + exact: self.form.player.exact, + side: self.form.side, + }) + } + fn event_group(&mut self, ui: &mut Ui, db: &Arc) { let count = usize::from(self.form.event.is_set()) + usize::from(!self.form.annotator.trim().is_empty()); @@ -2216,6 +2248,25 @@ impl LargeView { opened = Some(index); ui.close(); } + // One item per player of the game (the same name once). + let mut players: Vec<&str> = vec![r.white.as_str(), r.black.as_str()]; + players.dedup(); + for name in players { + if name.trim().is_empty() || name == "?" { + continue; + } + if ui + .button(trf("♟ Prepare against {name}…", &[("name", &name)])) + .clicked() + { + self.prepare = Some(PrepEntry { + query: name.to_owned(), + exact: None, + side: Side::Any, + }); + ui.close(); + } + } if ui.button(tr("Game data… (F2)")).clicked() { actions.push(LibraryAction::EditGameData { path: path.to_path_buf(), index }); ui.close(); diff --git a/apps/desktop/src/library.rs b/apps/desktop/src/library.rs index ff7db1f..a917dbf 100644 --- a/apps/desktop/src/library.rs +++ b/apps/desktop/src/library.rs @@ -73,6 +73,11 @@ pub enum LibraryAction { path: PathBuf, index: usize, }, + /// «Prepare against…» for a player of this database (opponent-prep.md §2). + PrepareAgainst { + path: PathBuf, + entry: crate::prep_ui::PrepEntry, + }, } /// How a database was imported, and what is worth knowing about it. @@ -630,10 +635,26 @@ impl Library { { ui.input_mut(|i| i.consume_key(egui::Modifiers::NONE, egui::Key::Escape)); } + if let Some(path) = self.selected_db.clone() + && let Some(view) = self.large.get_mut(&path) + && let Some(entry) = view.prepare.take() + { + actions.push(LibraryAction::PrepareAgainst { path, entry }); + } self.notes_window(ui.ctx()); actions } + /// Ctrl+Shift+P: the chosen database (when it is read) and the player of its + /// filter, if one is set. + pub fn prep_entry(&self) -> Option<(PathBuf, Option)> { + let path = self.selected_db.clone()?; + if !matches!(self.slots.get(&path), Some(Slot::Ready(_))) { + return None; + } + Some((path.clone(), self.large.get(&path).and_then(|v| v.prep_entry()))) + } + fn notes_window(&mut self, ctx: &egui::Context) { let Some(path) = self.notes_open.clone() else { return; diff --git a/apps/desktop/src/main.rs b/apps/desktop/src/main.rs index cb13429..b7a2ab1 100644 --- a/apps/desktop/src/main.rs +++ b/apps/desktop/src/main.rs @@ -26,6 +26,7 @@ mod online_ui; mod own_db; mod play; mod player_games; +mod prep_ui; mod reference; mod review; mod rodent4_download; diff --git a/apps/desktop/src/prep_ui.rs b/apps/desktop/src/prep_ui.rs new file mode 100644 index 0000000..9ada6d6 --- /dev/null +++ b/apps/desktop/src/prep_ui.rs @@ -0,0 +1,4288 @@ +//! Preparing against an opponent on the desktop (docs/design/opponent-prep.md): the +//! dialog that picks the database, the player's spellings, the colour and the book; +//! the report screen — the repertoire tree, the openings, the errors, the board of the +//! chosen position and the games through it — and the engine run over the opening +//! positions. The data are the `prep` crate's; the engine job is the same as the game +//! analysis's (`game_review::run`), one at a time for the whole program. + +use std::collections::{HashMap, HashSet}; +use std::path::{Path, PathBuf}; +use std::sync::Arc; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::mpsc::{Receiver, channel}; + +use chess_import::Database; +use chess_import::chessbase::base::{Side, fold}; +use egui::{Color32, Key, KeyboardShortcut, Modifiers, RichText, Sense, Ui, vec2}; +use egui_extras::{Column, TableBuilder}; +use game_review::{JobEvent, JobFailure, JobSettings, Judgement}; +use prep::{ + BookExit, BookOptions, Candidate, ErrorCounts, GameInfo, Options, Player, + PositionCache, PrepReport, Tally, +}; +use shakmaty::uci::UciMove; +use shakmaty::{Chess, Color, Move, Position, Square}; + +use crate::board::{Arrow, BoardState, BoardView}; +use crate::board_search::{self, Background, PREVIEW_ARROW}; +use crate::i18n::{tr, trf}; +use crate::reference::RefDb; +use crate::review::{self, DialogAction}; +use crate::settings::{REVIEW_QUALITY, Settings}; + +/// «Prepare against…» as the library asks it: the name typed or picked and the colour +/// of the filter (§2.1). +#[derive(Clone, Debug, Default)] +pub struct PrepEntry { + pub query: String, + /// The name id when it was picked from the list. + pub exact: Option, + pub side: Side, +} + +/// The colour switch of the report. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum ColorChoice { + White, + Black, + Both, +} + +impl ColorChoice { + fn side(self) -> Side { + match self { + ColorChoice::White => Side::White, + ColorChoice::Black => Side::Black, + ColorChoice::Both => Side::Any, + } + } + + fn from_side(side: Side) -> Self { + match side { + Side::White => ColorChoice::White, + Side::Black => ColorChoice::Black, + Side::Any => ColorChoice::Both, + } + } + + /// The colours shown, White first. + fn colours(self) -> Vec { + match self { + ColorChoice::White => vec![true], + ColorChoice::Black => vec![false], + ColorChoice::Both => vec![true, false], + } + } + + fn label(self) -> &'static str { + match self { + ColorChoice::White => tr("White"), + ColorChoice::Black => tr("Black"), + ColorChoice::Both => tr("Both"), + } + } +} + +/// The book: a database of the shelf, none, or the report's own database. +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum BookChoice { + None, + Database(PathBuf), + Same, +} + +impl BookChoice { + /// From the setting: an empty path is «none», the report's database «the same», + /// `None` the largest database on the shelf but the report's. + fn from_setting(setting: Option<&Path>, own: &Path, dbs: &[RefDb]) -> BookChoice { + match setting { + Some(p) if p.as_os_str().is_empty() => BookChoice::None, + Some(p) if p == own => BookChoice::Same, + Some(p) if dbs.iter().any(|d| d.path == p) => BookChoice::Database(p.to_owned()), + _ => dbs + .iter() + .filter(|d| d.path != own) + .max_by_key(|d| d.bytes) + .map_or(BookChoice::None, |d| BookChoice::Database(d.path.clone())), + } + } + + fn setting(&self, own: &Path) -> PathBuf { + match self { + BookChoice::None => PathBuf::new(), + BookChoice::Database(p) => p.clone(), + BookChoice::Same => own.to_owned(), + } + } + + fn label(&self, own_name: &str, dbs: &[RefDb]) -> String { + match self { + BookChoice::None => tr("None").to_owned(), + BookChoice::Same => trf("This database ({name})", &[("name", &own_name)]), + BookChoice::Database(p) => dbs + .iter() + .find(|d| d.path == *p) + .map_or_else(|| p.display().to_string(), db_label), + } + } +} + +/// "Mega Database 2026 · 11.7M games" for the pickers. +fn db_label(d: &RefDb) -> String { + match &d.db { + Some(db) => format!("{} · {}", d.name, crate::i18n::games_short(db.len())), + None => format!("{} · {}", d.name, tr("not open")), + } +} + +/// The book picker: «None», the databases of the shelf but the report's own, «This +/// database». Returns the new choice. +fn book_picker( + ui: &mut Ui, + id: &str, + current: &BookChoice, + own: &Path, + own_name: &str, + dbs: &[RefDb], + width: f32, +) -> Option { + let mut picked = None; + egui::ComboBox::from_id_salt(id) + .selected_text(current.label(own_name, dbs)) + .width(width) + .truncate() + .show_ui(ui, |ui| { + if ui + .selectable_label(*current == BookChoice::None, tr("None")) + .clicked() + { + picked = Some(BookChoice::None); + } + for d in dbs.iter().filter(|d| d.path != own) { + let choice = BookChoice::Database(d.path.clone()); + if ui.selectable_label(*current == choice, db_label(d)).clicked() { + picked = Some(choice); + } + } + if ui + .selectable_label( + *current == BookChoice::Same, + trf("This database ({name})", &[("name", &own_name)]), + ) + .clicked() + { + picked = Some(BookChoice::Same); + } + }) + .response + .on_hover_text(tr( + "A book is a large database that shows up to which move his line is common and where he plays a rare move. A rare move is not a mistake.", + )); + picked.filter(|p| p != current) +} + +// ----- the dialog ------------------------------------------------------------------ + +/// What «Open report» starts. +pub struct PrepStart { + pub path: PathBuf, + pub player: Player, + pub side: ColorChoice, + pub book: BookChoice, +} + +pub enum DialogOutcome { + Open(PrepStart), + Cancel, + /// A database of the shelf is needed but not read yet. + LoadDb(PathBuf), +} + +/// The words of a name for matching: folded, without full stops and commas. +fn name_words(s: &str) -> Vec { + fold(s) + .split(|c: char| c.is_whitespace() || c == ',') + .map(|w| w.trim_matches('.').to_owned()) + .filter(|w| !w.is_empty()) + .collect() +} + +/// Splits the names that match a query into those that match it word for word (an +/// initial like «Р.» matches the beginning of a word) and the similar ones, which +/// only start with its words («Вафин» ⊂ «Вафина»): most likely other people. +pub fn split_candidates(query: &str, list: Vec) -> (Vec, Vec) { + let folded = fold(query); + let wanted: Vec<(String, bool)> = folded + .split(|c: char| c.is_whitespace() || c == ',') + .filter(|w| !w.is_empty()) + .map(|w| (w.trim_matches('.').to_owned(), w.ends_with('.'))) + .filter(|(w, _)| !w.is_empty()) + .collect(); + let (mut exact, mut similar) = (Vec::new(), Vec::new()); + for c in list { + let words = name_words(&c.name); + let whole = wanted.iter().all(|(q, initial)| { + words + .iter() + .any(|w| w == q || (*initial && w.starts_with(q.as_str()))) + }); + if whole { + exact.push(c); + } else { + similar.push(c); + } + } + (exact, similar) +} + +/// Up to this many names are offered. +const CANDIDATES: usize = 40; + +/// The name search in the background: the names and how many match in all. +type SearchJob = Background<(Vec, usize)>; +/// The count of the ticked names' games by colour (White, Black). +type CountJob = Background<(u32, u32)>; +/// The book step: every game's exit, how many left the book, the counts by position. +type BookJob = Background<(Vec>, u32, HashMap)>; + +pub struct PrepDialog { + pub path: PathBuf, + /// The shelf (set by the application every frame). + pub dbs: Vec, + query: String, + /// The query the lists answer. + answered: Option, + search: Option<(String, SearchJob)>, + exact: Vec, + similar: Vec, + total: usize, + ticked: Vec, + /// The name the dialog was opened with (ticked by itself when found). + wanted: Option, + side: ColorChoice, + book: BookChoice, + /// Games of the ticked names by colour, and the job counting them. + counts: Option<(Vec, (u32, u32))>, + count_job: Option<(Vec, CountJob)>, + focus_query: bool, + typed_at: f64, + /// `CP_PREP_OPEN`: «Open report» pressed by itself once a name is ticked. + auto_open: bool, +} + +impl PrepDialog { + pub fn new(path: PathBuf, entry: PrepEntry, settings: &Settings) -> Self { + PrepDialog { + book: BookChoice::from_setting(settings.prep.book.as_deref(), &path, &[]), + path, + dbs: Vec::new(), + query: entry.query, + answered: None, + search: None, + exact: Vec::new(), + similar: Vec::new(), + total: 0, + ticked: Vec::new(), + wanted: entry.exact, + side: ColorChoice::from_side(entry.side), + counts: None, + count_job: None, + focus_query: true, + typed_at: f64::NEG_INFINITY, + auto_open: std::env::var_os("CP_PREP_OPEN").is_some(), + } + } + + fn db(&self) -> Option> { + self.dbs + .iter() + .find(|d| d.path == self.path) + .and_then(|d| d.db.clone()) + } + + /// Starts the name search for the query, when the lists do not answer it yet. + fn search(&mut self, ctx: &egui::Context, db: &Arc) { + let query = self.query.trim().to_owned(); + if self.answered.as_deref() == Some(query.as_str()) + || self.search.as_ref().is_some_and(|(q, _)| *q == query) + { + return; + } + if query.is_empty() { + self.answered = Some(query); + self.search = None; + self.exact.clear(); + self.similar.clear(); + self.total = 0; + return; + } + let (db, q) = (db.clone(), query.clone()); + let now = ctx.input(|i| i.time); + self.search = Background::spawn(ctx, now, move |_, _| Some(prep::candidates(&db, &q, CANDIDATES))) + .map(|j| (query, j)); + } + + fn poll(&mut self, ctx: &egui::Context, db: &Arc) { + if let Some((q, job)) = &self.search + && let Some(r) = job.poll() + { + let q = q.clone(); + self.search = None; + if let Some((list, total)) = r { + let (exact, similar) = split_candidates(&q, list); + self.exact = exact; + self.similar = similar; + self.total = total; + self.answered = Some(q.clone()); + // Ticked by itself: the name the dialog was opened with, the name equal + // to the query, else the only name that matches word for word. + let folded = fold(&q); + let auto = self + .wanted + .take() + .filter(|id| self.exact.iter().any(|c| c.id == *id)) + .or_else(|| { + self.exact + .iter() + .find(|c| fold(&c.name) == folded) + .map(|c| c.id) + }) + .or_else(|| (self.exact.len() == 1).then(|| self.exact[0].id)); + self.ticked = auto.into_iter().collect(); + } + } + // The games by colour of the ticked names. + if let Some((ids, job)) = &self.count_job + && let Some(r) = job.poll() + { + let ids = ids.clone(); + self.count_job = None; + if let Some(c) = r { + self.counts = Some((ids, c)); + } + } + let mut ids = self.ticked.clone(); + ids.sort_unstable(); + if !ids.is_empty() + && self.counts.as_ref().is_none_or(|(c, _)| *c != ids) + && self.count_job.as_ref().is_none_or(|(c, _)| *c != ids) + { + let (db, player) = (db.clone(), Player::new(ids.iter().copied())); + let now = ctx.input(|i| i.time); + self.count_job = Background::spawn(ctx, now, move |_, cancel| { + let found = prep::games_of(&db, &player, Side::Any, cancel)?; + let white = found.iter().filter(|(_, w)| *w).count() as u32; + Some((white, found.len() as u32 - white)) + }) + .map(|j| (ids, j)); + } + } + + /// Draws the dialog; what was chosen, if anything. + pub fn show(&mut self, ctx: &egui::Context, settings: &mut Settings) -> Option { + let db = self.db(); + if let Some(db) = &db { + self.search(ctx, db); + self.poll(ctx, db); + } + let own_name = base_name(&self.path); + if self.book == BookChoice::None && settings.prep.book.is_none() && !self.dbs.is_empty() { + // The default book: the largest database on the shelf (once the shelf is known). + self.book = BookChoice::from_setting(None, &self.path, &self.dbs); + } + let mut outcome = None; + let ready = db.is_some() && !self.ticked.is_empty(); + let ticked_names: Vec = self + .exact + .iter() + .chain(self.similar.iter()) + .filter(|c| self.ticked.contains(&c.id)) + .map(|c| c.name.clone()) + .collect(); + let ticked_games: u32 = self + .exact + .iter() + .chain(self.similar.iter()) + .filter(|c| self.ticked.contains(&c.id)) + .map(|c| c.games) + .sum(); + let counts = self + .counts + .as_ref() + .filter(|(ids, _)| { + let mut t = self.ticked.clone(); + t.sort_unstable(); + *ids == t + }) + .map(|(_, c)| *c); + let modal = egui::Modal::new(egui::Id::new("prep_dialog")).show(ctx, |ui| { + let screen = ctx.content_rect(); + ui.set_width((screen.width() - 40.0).min(520.0)); + ui.heading(tr("Preparing against an opponent")); + ui.add_space(6.0); + let label_w = 60.0; + // The body scrolls in a low window; the buttons stay under it. + egui::ScrollArea::vertical() + .max_height((screen.height() - 140.0).max(120.0)) + .auto_shrink([false, true]) + .show(ui, |ui| { + ui.horizontal(|ui| { + ui.add_sized([label_w, 20.0], egui::Label::new(tr("Database"))); + let width = ui.available_width() - 8.0; + let mut pick = None; + let current = self + .dbs + .iter() + .find(|d| d.path == self.path) + .map(db_label) + .unwrap_or_else(|| own_name.clone()); + egui::ComboBox::from_id_salt("prep_dialog_db") + .selected_text(current) + .width(width) + .truncate() + .show_ui(ui, |ui| { + for d in &self.dbs { + if ui.selectable_label(d.path == self.path, db_label(d)).clicked() { + pick = Some(d.path.clone()); + } + } + }); + if let Some(p) = pick.filter(|p| *p != self.path) { + self.path = p; + self.answered = None; + self.search = None; + self.ticked.clear(); + self.counts = None; + self.count_job = None; + self.book = BookChoice::from_setting( + settings.prep.book.as_deref(), + &self.path, + &self.dbs, + ); + } + }); + ui.horizontal(|ui| { + ui.add_sized([label_w, 20.0], egui::Label::new(tr("Player"))); + let r = ui.add( + egui::TextEdit::singleline(&mut self.query) + .hint_text(tr("Name or part of it")) + .desired_width(ui.available_width() - 34.0), + ); + if std::mem::take(&mut self.focus_query) && self.query.is_empty() { + r.request_focus(); + } + if r.changed() { + self.typed_at = ui.input(|i| i.time); + self.ticked.clear(); + } + if !self.query.is_empty() + && crate::widgets::small_close_button(ui) + .on_hover_text(tr("Clear")) + .clicked() + { + self.query.clear(); + self.ticked.clear(); + self.typed_at = ui.input(|i| i.time); + } + }); + ui.add_space(2.0); + match &db { + None if self.dbs.iter().any(|d| d.path == self.path && d.failed.is_some()) => { + let why = self + .dbs + .iter() + .find(|d| d.path == self.path) + .and_then(|d| d.failed.clone()) + .unwrap_or_default(); + ui.label( + RichText::new(trf("This database cannot be opened: {e}", &[("e", &why)])) + .color(ui.visuals().warn_fg_color), + ); + } + None => { + ui.horizontal(|ui| { + ui.add(egui::Spinner::new().size(14.0)); + ui.label(RichText::new(tr("Opening the database…")).weak()); + }); + outcome = Some(DialogOutcome::LoadDb(self.path.clone())); + } + Some(_) => self.candidate_list(ui, label_w), + } + if !self.ticked.is_empty() { + ui.add_space(2.0); + ui.label( + RichText::new(trf( + "Selected: {names} · {n}", + &[ + ("names", &ticked_names.join(", ")), + ("n", &crate::i18n::games(ticked_games as usize)), + ], + )) + .weak(), + ); + } + ui.add_space(8.0); + ui.horizontal_wrapped(|ui| { + ui.add_sized([label_w, 20.0], egui::Label::new(tr("Colour"))); + ui.radio_value(&mut self.side, ColorChoice::Both, tr("Both")); + let (w, b) = match counts { + Some((w, b)) => (w.to_string(), b.to_string()), + None if self.ticked.is_empty() => ("—".to_owned(), "—".to_owned()), + None => ("…".to_owned(), "…".to_owned()), + }; + ui.radio_value( + &mut self.side, + ColorChoice::White, + trf("White — {n}", &[("n", &w)]), + ); + ui.radio_value( + &mut self.side, + ColorChoice::Black, + trf("Black — {n}", &[("n", &b)]), + ); + }); + ui.horizontal(|ui| { + ui.add_sized([label_w, 20.0], egui::Label::new(tr("Book"))); + let width = ui.available_width() - 8.0; + if let Some(b) = book_picker(ui, "prep_dialog_book", &self.book, &self.path, &own_name, &self.dbs, width) { + self.book = b; + settings.prep.book = Some(self.book.setting(&self.path)); + } + }); + ui.label( + RichText::new(tr( + "The book shows where he leaves the theory. «None» — without that column.", + )) + .weak() + .small(), + ); + }); + ui.add_space(10.0); + ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { + let open = ui + .add_enabled(ready, egui::Button::new(RichText::new(tr("Open report")).strong()).min_size(vec2(0.0, 30.0))) + .on_disabled_hover_text(tr("Tick a player")); + if open.clicked() { + outcome = Some(DialogOutcome::Open(self.start())); + } + if ui.button(tr("Cancel")).clicked() { + outcome = Some(DialogOutcome::Cancel); + } + }); + }); + if modal.should_close() { + outcome = Some(DialogOutcome::Cancel); + } + if outcome.is_none() && ready && ctx.input_mut(|i| i.consume_key(Modifiers::NONE, Key::Enter)) { + outcome = Some(DialogOutcome::Open(self.start())); + } + if outcome.is_none() && ready && self.auto_open && self.search.is_none() { + self.auto_open = false; + outcome = Some(DialogOutcome::Open(self.start())); + } + if self.search.is_some() || self.count_job.is_some() { + ctx.request_repaint_after(std::time::Duration::from_millis(100)); + } + outcome + } + + fn start(&self) -> PrepStart { + PrepStart { + path: self.path.clone(), + player: Player::new(self.ticked.iter().copied()), + side: self.side, + book: self.book.clone(), + } + } + + /// The names that match: tick boxes, the similar names apart. + fn candidate_list(&mut self, ui: &mut Ui, indent: f32) { + if self.search.is_some() && self.answered.as_deref() != Some(self.query.trim()) { + ui.horizontal(|ui| { + ui.add_space(indent); + ui.add(egui::Spinner::new().size(12.0)); + ui.label(RichText::new(tr("Searching…")).weak()); + }); + return; + } + if self.query.trim().is_empty() { + ui.horizontal(|ui| { + ui.add_space(indent); + ui.label(RichText::new(tr("Type a name: the players of the database are offered")).weak()); + }); + return; + } + if self.exact.is_empty() && self.similar.is_empty() { + ui.horizontal(|ui| { + ui.add_space(indent); + ui.label(RichText::new(tr("No such player in this database")).weak()); + }); + return; + } + let rows = self.exact.len() + self.similar.len() + usize::from(!self.similar.is_empty()); + let height = (rows as f32 * 22.0).min(8.0 * 22.0) + 4.0; + egui::ScrollArea::vertical() + .id_salt("prep_candidates") + .max_height(height) + .auto_shrink([false, true]) + .show(ui, |ui| { + let row = |ui: &mut Ui, c: &Candidate, ticked: &mut Vec| { + ui.horizontal(|ui| { + ui.add_space(indent); + let mut on = ticked.contains(&c.id); + let width = ui.available_width() - 90.0; + ui.allocate_ui(vec2(width, 20.0), |ui| { + if ui.add(egui::Checkbox::new(&mut on, &c.name)).changed() { + if on { + ticked.push(c.id); + } else { + ticked.retain(|id| *id != c.id); + } + } + }); + ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { + ui.label(RichText::new(crate::i18n::games(c.games as usize)).weak()); + }); + }); + }; + for c in &self.exact { + row(ui, c, &mut self.ticked); + } + if !self.similar.is_empty() { + ui.horizontal(|ui| { + ui.add_space(indent); + ui.label( + RichText::new(tr("Similar names — most likely other people")) + .weak() + .small(), + ); + }); + for c in &self.similar { + row(ui, c, &mut self.ticked); + } + } + if self.total > self.exact.len() + self.similar.len() { + ui.horizontal(|ui| { + ui.add_space(indent); + ui.label( + RichText::new(trf( + "{n} more matches…", + &[("n", &(self.total - self.exact.len() - self.similar.len()))], + )) + .weak(), + ); + }); + } + }); + } +} + +/// The file's name without its extension. +fn base_name(path: &Path) -> String { + path.file_stem() + .map(|s| s.to_string_lossy().into_owned()) + .unwrap_or_default() +} + +// ----- the screen ------------------------------------------------------------------ + +/// What the screen asks of the application. +pub enum PrepAction { + /// «⬅ Library»: the report stays in the stack. + Back, + OpenSettings, + /// A game of the report in the game screen, at move `ply` (0: the start). + OpenGame { + path: PathBuf, + index: usize, + ply: usize, + }, + /// A database of the shelf is needed (the book) but not read yet. + LoadDb(PathBuf), + /// The engine run started (the live engine pauses) / ended. + EngineStarted, + EngineEnded, + NeedEngine, + EngineSwitch, + OpenEngines, + Toast(String), + CopyText(String, &'static str), + /// The line as a new game (no database). + OpenPgn(String), + /// The position on the search board of this database. + FindPosition(PathBuf, Chess, Vec, bool), + PlayFrom(Box), + SettingsChanged, +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +enum Tab { + Repertoire, + Openings, + Errors, +} + +/// What is chosen: a node of the tree, an opening, an error — the board and the games +/// list follow it. +#[derive(Clone, Debug, PartialEq, Eq)] +enum Selection { + None, + Node { + white: bool, + node: u32, + }, + Opening { + white: bool, + family: usize, + variation: Option, + }, + Repeated { + white: bool, + index: usize, + }, + Error { + white: bool, + index: usize, + }, +} + +/// A row of the games list (the names and the event come from the database once). +#[derive(Clone)] +struct ListRow { + white: String, + black: String, + white_elo: u16, + black_elo: u16, + result: &'static str, + event: String, +} + +enum JobMsg { + Event(JobEvent), + Done, + Failed(String), +} + +struct EngineJob { + rx: Receiver, + cancel: Arc, + total: usize, + done: usize, + threads: u32, + nodes: u64, + /// Evaluations since the cache was saved. + unsaved: usize, +} + +impl Drop for EngineJob { + fn drop(&mut self) { + self.cancel.store(true, Ordering::Relaxed); + } +} + +/// The position shown on the board: the line to it and the positions along it. +struct Shown { + sans: Vec, + ucis: Vec, + positions: Vec, + /// The ply shown (`positions[ply]`); the last by default, a click on the line + /// takes the board back along it. + ply: usize, + /// Arrows at the last ply (an error: the move played and the better one). + arrows: Vec, + /// «after 3.Bb5 · better 3.d4 · +0.3 → −1.5» under the line, for an error. + note: Option, + opening: Option, + /// The player's colour the position was chosen from (the board's orientation). + white: bool, +} + +/// An error at a node of the tree: by (the key before the move, the move). +#[derive(Clone)] +struct Mark { + judgement: Judgement, + best_san: String, + before: game_review::Eval, + after: game_review::Eval, + games: u32, +} + +/// A row of the repertoire tree as laid out. +#[derive(Clone, Copy, PartialEq, Eq)] +enum TreeRow { + Node { white: bool, node: u32, depth: usize }, + /// «other moves (n)» under a node. + Others { white: bool, parent: u32, depth: usize, count: usize }, +} + +/// The default expansion: nodes with at least this many games, this deep. +const EXPAND_GAMES: u32 = 5; +const EXPAND_PLIES: u8 = 6; +/// Fewer games: the percentages are shown weak. +const FEW_GAMES: u32 = 5; +const BOARD_MIN: f32 = 220.0; +const RIGHT_MIN: f32 = 560.0; +const ROW_H: f32 = 24.0; + +/// The folder of the prep caches (the reports and the evaluations by position). +fn cache_dir() -> Option { + Settings::cache_dir().map(|d| d.join("prep")) +} + +pub struct PrepScreen { + pub path: PathBuf, + db: Arc, + db_name: String, + pub player: Player, + pub names: Vec, + /// On the screen (else kept in the stack under the library). + pub shown: bool, + /// The shelf (set by the application every frame; the book comes from it). + pub dbs: Vec, + color: ColorChoice, + plies: usize, + book: BookChoice, + report: Option, + rows: Vec, + /// The games read in the background (hundreds in a moment, a Mega filter in seconds). + build: Option>, + build_total: usize, + book_job: Option<(u64, BookJob)>, + /// The book that could not be searched (its fingerprint, why). + book_failed: Option<(u64, String)>, + book_asked: Option, + job: Option, + cache: PositionCache, + nps_per_thread: Option, + error: Option, + dialog_open: bool, + /// The report changed since it was written to the cache. + dirty: bool, + /// Evaluations came in since the last re-judging (done at most once a second). + pending_refresh: bool, + last_refresh: f64, + marks: [HashMap<(u64, String), Mark>; 2], + tab: Tab, + branches_from: u32, + expanded: HashSet<(bool, u32)>, + others_open: HashSet<(bool, u32)>, + open_families: HashSet<(bool, usize)>, + open_repeated: HashSet<(bool, usize)>, + selection: Selection, + shown_pos: Option, + /// The user turned the board (else it is the player's colour). + flipped: Option, + board_state: BoardState, + /// In a low window the board is a panel over the lists, opened by a button. + board_popup: bool, + newest_first: bool, + /// The keyboard is in the games list (else in the tab's table). + focus_games: bool, + games_cursor: Option, + hover_arrow: Option<(Square, Square)>, + scroll_to_selected: bool, + /// The games list's height, once the user dragged the border (else 35 %). + games_height: Option, + /// `CP_PREP_ENGINE`: the engine run started by itself once the report is built. + auto_engine: bool, +} + +/// Plays `ucis` from the start; stops at a move that cannot be read. +fn replay(ucis: &[String]) -> Vec { + let mut pos = Chess::default(); + let mut out = vec![pos.clone()]; + for u in ucis { + let Some(m) = u.parse::().ok().and_then(|u| u.to_move(&pos).ok()) else { + break; + }; + pos.play_unchecked(m); + out.push(pos.clone()); + } + out +} + +/// "3.Bb5" / "2…Nc6" for move `ply` (0-based), in the chosen notation. +fn short_label(ply: usize, san: &str) -> String { + let number = ply / 2 + 1; + let label = if ply.is_multiple_of(2) { + format!("{number}.{san}") + } else { + format!("{number}…{san}") + }; + crate::san::show(&label).into_owned() +} + +/// The line as text: "1.e4 c5 2.Nf3 Nc6". +fn line_text(sans: &[String]) -> String { + let mut out = String::new(); + for (i, san) in sans.iter().enumerate() { + if !out.is_empty() { + out.push(' '); + } + if i.is_multiple_of(2) { + out.push_str(&format!("{}.", i / 2 + 1)); + } + out.push_str(san); + } + crate::san::show_line(&out) +} + +/// "…" in the middle when the text is longer than `max` characters: the first and +/// the last moves of a line matter more than the middle. +fn shorten_middle(s: &str, max: usize) -> String { + let n = s.chars().count(); + if n <= max { + return s.to_owned(); + } + let keep = max.saturating_sub(1) / 2; + let head: String = s.chars().take(keep).collect(); + let tail: String = s.chars().skip(n - keep).collect(); + format!("{head}…{tail}") +} + +/// "01.2026 – 10.2026" from the games' dates (empty without dates). +fn period(games: &[GameInfo]) -> String { + let dated: Vec<&GameInfo> = games.iter().filter(|g| g.date_number() > 0).collect(); + let first = dated.iter().min_by_key(|g| g.date_number()); + let last = dated.iter().max_by_key(|g| g.date_number()); + let month = |g: &GameInfo| -> String { + let parts: Vec<&str> = g.date.split('.').collect(); + match parts.as_slice() { + [y, m, ..] if m.chars().all(|c| c.is_ascii_digit()) && !m.is_empty() => format!("{m}.{y}"), + [y, ..] => (*y).to_string(), + _ => String::new(), + } + }; + match (first, last) { + (Some(a), Some(b)) => { + let (a, b) = (month(a), month(b)); + if a == b { a } else { format!("{a} – {b}") } + } + _ => String::new(), + } +} + +/// The player's tally as the result bar wants it (White's wins · draws · Black's wins). +fn bar_tally(t: &Tally, white: bool) -> chess_import::position::Tally { + let (white_wins, black_wins) = if white { (t.wins, t.losses) } else { (t.losses, t.wins) }; + chess_import::position::Tally { + games: t.games, + white_wins, + draws: t.draws, + black_wins, + ..Default::default() + } +} + +fn score_text(t: &Tally) -> String { + t.score().map_or_else(|| "—".to_owned(), |s| format!("{:.0} %", 100.0 * s)) +} + +/// "+10 =1 −3". +fn tally_hint(t: &Tally) -> String { + format!("+{} ={} −{}", t.wins, t.draws, t.losses) +} + +fn judgement_weight(j: Judgement) -> u32 { + match j { + Judgement::Blunder => 3, + Judgement::Mistake => 2, + Judgement::Inaccuracy => 1, + Judgement::Great | Judgement::Brilliant => 0, + } +} + +/// A move's mark as a pill: the symbol in white on the colour of the sign. +fn pill(ui: &mut Ui, j: Judgement) -> egui::Response { + let text = review::judgement_symbol(j); + let font = egui::FontId::proportional(11.0); + let galley = ui.painter().layout_no_wrap(text.to_owned(), font, Color32::WHITE); + let size = vec2(galley.size().x + 8.0, 16.0); + let (rect, resp) = ui.allocate_exact_size(size, Sense::hover()); + ui.painter().rect_filled(rect, 8.0, review::judgement_color(j)); + ui.painter().galley( + rect.center() - galley.size() / 2.0, + galley, + Color32::WHITE, + ); + resp +} + +/// "3 ? · 1 ??" in the colours of the signs (nothing when there are none). +fn counts_text(ui: &mut Ui, c: &ErrorCounts) { + let dark = ui.visuals().dark_mode; + let mut first = true; + for (n, j) in [ + (c.inaccuracies, Judgement::Inaccuracy), + (c.mistakes, Judgement::Mistake), + (c.blunders, Judgement::Blunder), + ] { + if n == 0 { + continue; + } + if !first { + ui.label(RichText::new("·").weak()); + } + first = false; + ui.label( + RichText::new(format!("{n} {}", review::judgement_symbol(j))) + .color(review::judgement_text_color(j, dark)), + ); + } +} + +impl PrepScreen { + pub fn new(start: PrepStart, db: Arc, settings: &Settings, ctx: &egui::Context) -> Self { + let dir = cache_dir(); + let cache = dir.as_deref().map(PositionCache::load).unwrap_or_default(); + let plies = settings.prep.plies.clamp(2, 60); + let options = Options { + plies, + side: Side::Any, + }; + let names = start.player.names(&db); + let mut screen = PrepScreen { + db_name: base_name(&start.path), + path: start.path, + db, + player: start.player, + names, + shown: true, + dbs: Vec::new(), + color: start.side, + plies, + book: start.book, + report: None, + rows: Vec::new(), + build: None, + build_total: 0, + book_job: None, + book_failed: None, + book_asked: None, + job: None, + cache, + nps_per_thread: None, + error: None, + dialog_open: false, + dirty: false, + pending_refresh: false, + last_refresh: 0.0, + marks: [HashMap::new(), HashMap::new()], + tab: match std::env::var("CP_PREP_TAB").as_deref() { + Ok("openings") => Tab::Openings, + Ok("errors") => Tab::Errors, + _ => Tab::Repertoire, + }, + branches_from: settings.prep.branches_from.clamp(1, 20), + expanded: HashSet::new(), + others_open: HashSet::new(), + open_families: HashSet::new(), + open_repeated: HashSet::new(), + selection: Selection::None, + shown_pos: None, + flipped: None, + board_state: BoardState::default(), + board_popup: false, + newest_first: true, + focus_games: false, + games_cursor: None, + hover_arrow: None, + scroll_to_selected: false, + games_height: None, + auto_engine: std::env::var_os("CP_PREP_ENGINE").is_some(), + }; + let cached = dir + .as_deref() + .and_then(|d| PrepReport::load(d, &screen.db, &screen.player, &options)); + match cached { + Some(r) => screen.take_report(r, settings), + None => screen.rebuild(ctx), + } + screen + } + + /// The same database and player: the report as it was. + pub fn matches(&self, path: &Path, player: &Player) -> bool { + self.path == path && self.player == *player + } + + pub fn running(&self) -> bool { + self.job.is_some() + } + + /// The background work goes on while the report is not on the screen (a game + /// opened from it, the library): its results are taken in here. + pub fn poll_quietly(&mut self, ctx: &egui::Context, settings: &Settings) { + let mut actions = Vec::new(); + self.poll(ctx, settings, &mut actions); + } + + /// The engine run after an engine was installed for it. + pub fn start_after_engine(&mut self, settings: &Settings, ctx: &egui::Context) -> Vec { + let mut actions = Vec::new(); + self.start_engine(settings, ctx, &mut actions); + actions + } + + pub fn title(&self) -> String { + let name = self.names.first().cloned().unwrap_or_default(); + trf("Preparing against {name}", &[("name", &name)]) + } + + /// Reads the games anew (a new depth; the database read again). + fn rebuild(&mut self, ctx: &egui::Context) { + self.job = None; + self.book_job = None; + let (db, player) = (self.db.clone(), self.player.clone()); + let options = Options { + plies: self.plies, + side: Side::Any, + }; + self.build_total = 0; + let now = ctx.input(|i| i.time); + self.build = Background::spawn(ctx, now, move |progress, cancel| { + prep::build(&db, &player, &options, progress, cancel) + }); + } + + /// A report arrived (built or from the cache): the rows of the games list, the + /// cached evaluations, the default expansion. + fn take_report(&mut self, mut report: PrepReport, settings: &Settings) { + let taken = report.take_cached(&self.cache, settings.prep.nodes()); + self.dirty |= taken > 0; + self.rows = report + .games + .iter() + .map(|g| { + let r = self.db.row(g.index as usize); + ListRow { + white: r.white, + black: r.black, + white_elo: r.white_elo, + black_elo: r.black_elo, + result: r.result, + event: r.event, + } + }) + .collect(); + self.expanded.clear(); + self.others_open.clear(); + for cr in [&report.white, &report.black] { + for (i, n) in cr.tree.nodes.iter().enumerate() { + if n.tally.games >= EXPAND_GAMES && n.ply <= EXPAND_PLIES { + self.expanded.insert((cr.white, i as u32)); + } + } + } + self.report = Some(report); + self.rebuild_marks(); + self.selection = Selection::None; + self.shown_pos = None; + self.games_cursor = None; + } + + /// The errors by node, for the tree and the hover texts. + fn rebuild_marks(&mut self) { + let Some(report) = &self.report else { return }; + for (i, cr) in [&report.white, &report.black].into_iter().enumerate() { + let mut map: HashMap<(u64, String), Mark> = HashMap::new(); + for e in &cr.errors { + let m = map.entry((e.key, e.uci.clone())).or_insert_with(|| Mark { + judgement: e.judgement, + best_san: e.best_san.clone(), + before: e.before, + after: e.after, + games: 0, + }); + m.games += 1; + } + self.marks[i] = map; + } + } + + fn mark_of(&self, white: bool, key: u64, uci: &str) -> Option<&Mark> { + self.marks[usize::from(!white)].get(&(key, uci.to_owned())) + } + + // ----- the background work ----------------------------------------------------- + + fn poll(&mut self, ctx: &egui::Context, settings: &Settings, actions: &mut Vec) { + if let Some(job) = &self.build + && let Some(r) = job.poll() + { + self.build = None; + match r { + Some(report) => self.take_report(report, settings), + None => self.error = Some(tr("The games could not be read").to_owned()), + } + } + if let Some((fp, job)) = &self.book_job + && let Some(r) = job.poll() + { + let fp = *fp; + self.book_job = None; + match r { + Some((exits, left, counts)) => { + if let Some(report) = self.report.as_mut() { + for (g, b) in report.games.iter_mut().zip(exits) { + g.book = b; + } + report.book = Some(prep::BookInfo { + fingerprint: fp, + threshold: prep::DEFAULT_BOOK_THRESHOLD, + left, + }); + report.book_counts = counts; + self.dirty = true; + } + } + None => { + self.book_failed = Some((fp, tr("the position search failed (not enough memory?)").to_owned())) + } + } + } + self.poll_engine(ctx, actions); + self.start_book(ctx, actions); + if self.auto_engine && self.report.is_some() && self.build.is_none() { + self.auto_engine = false; + self.start_engine(settings, ctx, actions); + } + if self.build.is_some() || self.book_job.is_some() || self.job.is_some() { + ctx.request_repaint_after(std::time::Duration::from_millis(100)); + } + } + + /// The book step for the chosen book, once the report and the book are there. + fn start_book(&mut self, ctx: &egui::Context, actions: &mut Vec) { + let Some(report) = &self.report else { return }; + if self.book_job.is_some() || self.build.is_some() { + return; + } + let (book_db, same) = match &self.book { + BookChoice::None => return, + BookChoice::Same => (self.db.clone(), true), + BookChoice::Database(p) => { + let Some(d) = self.dbs.iter().find(|d| d.path == *p) else { + return; + }; + match &d.db { + Some(db) => (db.clone(), false), + None => { + if d.failed.is_none() && self.book_asked.as_ref() != Some(p) { + self.book_asked = Some(p.clone()); + actions.push(PrepAction::LoadDb(p.clone())); + } + return; + } + } + } + }; + let fp = prep::fingerprint(&book_db); + if report.book.as_ref().is_some_and(|b| b.fingerprint == fp) + || self.book_failed.as_ref().is_some_and(|(f, _)| *f == fp) + { + return; + } + let mut clone = report.clone(); + let options = BookOptions { + threshold: prep::DEFAULT_BOOK_THRESHOLD, + same_database: same, + }; + let now = ctx.input(|i| i.time); + self.book_job = Background::spawn(ctx, now, move |progress, cancel| { + clone.find_book_exits(&book_db, &options, progress, cancel)?; + let exits = clone.games.iter().map(|g| g.book).collect(); + let left = clone.book.as_ref().map_or(0, |b| b.left); + Some((exits, left, std::mem::take(&mut clone.book_counts))) + }) + .map(|j| (fp, j)); + } + + /// The book's count in a position, when the book step looked at it. + fn book_count(&self, key: u64) -> Option { + let report = self.report.as_ref()?; + report.book.as_ref()?; + report.book_counts.get(&key).copied() + } + + // ----- the engine ---------------------------------------------------------------- + + /// Positions the next run has to evaluate, and how long it takes. + fn estimate(&self, settings: &Settings) -> (usize, f64) { + let Some(report) = &self.report else { + return (0, 0.0); + }; + let nodes = settings.prep.nodes(); + let missing = report.missing_for(nodes, self.color.side()); + let per_thread = self.nps_per_thread.unwrap_or(review::DEFAULT_NPS); + (missing, review::estimate_secs(missing, nodes, per_thread, settings.review.threads)) + } + + /// The button: the dialog the first time, at once with the options chosen before. + fn engine_asked(&mut self, settings: &Settings, ctx: &egui::Context, actions: &mut Vec) { + if !crate::engine_offer::EngineOffer::engine_ready(settings) { + actions.push(PrepAction::NeedEngine); + return; + } + if settings.prep.chosen { + self.start_engine(settings, ctx, actions); + } else { + self.dialog_open = true; + } + } + + fn start_engine(&mut self, settings: &Settings, ctx: &egui::Context, actions: &mut Vec) { + self.error = None; + let Some(engine) = settings.active_engine().cloned() else { + self.dialog_open = true; + return; + }; + let Some(path) = engine.executable() else { + actions.push(PrepAction::NeedEngine); + return; + }; + let Some(report) = self.report.as_mut() else { return }; + let nodes = settings.prep.nodes(); + if report.take_cached(&self.cache, nodes) > 0 { + self.dirty = true; + } + let targets = report.targets_for(nodes, self.color.side()); + if targets.is_empty() { + actions.push(PrepAction::Toast(tr("Every position is already evaluated").to_owned())); + self.tab = Tab::Errors; + return; + } + let (tx, rx) = channel(); + let cancel = Arc::new(AtomicBool::new(false)); + let total = targets.len(); + let job_settings = JobSettings { + threads: settings.review.threads.max(1), + hash_mb: settings.review.hash_mb, + nodes, + eval_file: None, + }; + let threads = job_settings.threads; + let (cancel_w, ctx_w) = (cancel.clone(), ctx.clone()); + let spawned = std::thread::Builder::new() + .name("prep-engine".into()) + .spawn(move || { + let result = game_review::run( + uci::EngineConfig::new(&path), + &job_settings, + targets, + &cancel_w, + &mut |e| { + let _ = tx.send(JobMsg::Event(e)); + ctx_w.request_repaint(); + }, + ); + let msg = match result { + Ok(()) => JobMsg::Done, + Err(JobFailure::Start(e) | JobFailure::Engine(e)) => JobMsg::Failed(e), + Err(JobFailure::Terminated(reason)) => { + JobMsg::Failed(crate::analysis::termination_message(&reason)) + } + }; + let _ = tx.send(msg); + ctx_w.request_repaint(); + }); + if let Err(e) = spawned { + self.error = Some(e.to_string()); + return; + } + self.job = Some(EngineJob { + rx, + cancel, + total, + done: 0, + threads, + nodes, + unsaved: 0, + }); + self.tab = Tab::Errors; + actions.push(PrepAction::EngineStarted); + } + + fn poll_engine(&mut self, ctx: &egui::Context, actions: &mut Vec) { + let Some(job) = self.job.as_mut() else { return }; + let Some(report) = self.report.as_mut() else { return }; + let mut ended = false; + let mut got = false; + while let Ok(msg) = job.rx.try_recv() { + match msg { + JobMsg::Event(e) => { + if let JobEvent::Eval { nps, .. } = &e { + job.done += 1; + if *nps > 0 { + self.nps_per_thread = Some(*nps as f64 / f64::from(job.threads)); + } + } + if let Some((k, eval)) = report.apply(&e, job.nodes) { + self.cache.insert(k, eval); + job.unsaved += 1; + got = true; + } + } + JobMsg::Done => ended = true, + JobMsg::Failed(e) => { + self.error = Some(e); + ended = true; + } + } + } + if got { + self.pending_refresh = true; + self.dirty = true; + } + if job.unsaved >= 200 + && let Some(dir) = cache_dir() + { + let _ = self.cache.save(&dir); + job.unsaved = 0; + } + let now = ctx.input(|i| i.time); + if self.pending_refresh && (ended || now - self.last_refresh > 1.0) { + report.refresh(); + self.pending_refresh = false; + self.last_refresh = now; + self.rebuild_marks(); + } + if ended { + self.job = None; + self.save(); + actions.push(PrepAction::EngineEnded); + } + } + + /// «Stop»: what was evaluated stays. + fn stop_engine(&mut self, actions: &mut Vec) { + if self.job.take().is_some() { + if let Some(r) = self.report.as_mut() { + r.refresh(); + } + self.rebuild_marks(); + self.pending_refresh = false; + self.save(); + actions.push(PrepAction::EngineEnded); + } + } + + /// Writes the report and the evaluations to the cache. + pub fn save(&mut self) { + let Some(dir) = cache_dir() else { return }; + if let Err(e) = self.cache.save(&dir) { + eprintln!("prep cache: {}: {e}", dir.display()); + } + if self.dirty + && let Some(r) = &self.report + { + match r.save(&dir) { + Ok(()) => self.dirty = false, + Err(e) => eprintln!("prep report: {}: {e}", dir.display()), + } + } + } + + /// The launch dialog (§4.2). + fn engine_dialog(&mut self, ctx: &egui::Context, settings: &mut Settings, actions: &mut Vec) { + if !self.dialog_open { + return; + } + let mut action = None; + let moves = self.plies.div_ceil(2); + let (white_n, black_n) = self + .report + .as_ref() + .map_or((0, 0), |r| (r.white.games.len(), r.black.games.len())); + let modal = egui::Modal::new(egui::Id::new("prep_engine_dialog")).show(ctx, |ui| { + let screen = ctx.content_rect(); + ui.set_width((screen.width() - 40.0).min(460.0)); + ui.heading(tr("Opening errors")); + ui.label( + RichText::new(trf( + "The engine evaluates the first {n} moves of every game of the opponent. The games are not changed.", + &[("n", &moves)], + )) + .weak(), + ); + ui.add_space(8.0); + egui::ScrollArea::vertical() + .max_height((screen.height() - 160.0).max(100.0)) + .auto_shrink([false, true]) + .show(ui, |ui| { + if let Some(a) = review::engine_picker(ui, settings, "prep_engine") { + action = Some(a); + } + ui.add_space(4.0); + ui.horizontal_wrapped(|ui| { + ui.label(tr("Colour")); + for (choice, n) in [ + (ColorChoice::White, white_n), + (ColorChoice::Black, black_n), + (ColorChoice::Both, white_n + black_n), + ] { + let label = format!("{} — {}", choice.label(), crate::i18n::games(n)); + ui.radio_value(&mut self.color, choice, label); + } + }); + ui.add_space(4.0); + let mut quality = settings.prep.quality; + let (mut threads, mut hash) = (settings.review.threads, settings.review.hash_mb); + review::options_grid( + ui, + "prep_grid", + &mut quality, + &mut threads, + &mut hash, + Some(tr( + "For opening errors “Fast” is usually enough. “Normal” is for adult databases and takes 4 times longer.", + )), + ); + settings.prep.quality = quality; + settings.review.threads = threads; + settings.review.hash_mb = hash; + ui.add_space(6.0); + let (missing, secs) = self.estimate(settings); + let all = self + .report + .as_ref() + .map_or(0, |r| r.distinct_positions_for(self.color.side())); + ui.label(trf( + "{n} positions, about {time}", + &[("n", &missing), ("time", &review::format_duration(secs))], + )); + let cached = all.saturating_sub(missing); + let note = if cached > 0 { + trf( + "identical positions are counted once; {n} already evaluated earlier", + &[("n", &cached)], + ) + } else { + tr("identical positions are counted once").to_owned() + }; + ui.label(RichText::new(note).weak().small()); + }); + ui.add_space(10.0); + ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { + let ready = settings.active_engine().is_some(); + if ui + .add_enabled( + ready, + egui::Button::new(RichText::new(tr("Find errors")).strong().size(16.0)), + ) + .clicked() + { + action = Some(DialogAction::Start); + } + if ui.button(tr("Cancel")).clicked() { + self.dialog_open = false; + } + if !ready { + ui.label(RichText::new(tr("Add an engine first")).color(ui.visuals().warn_fg_color)); + } + }); + }); + if modal.should_close() { + self.dialog_open = false; + } + if action.is_none() + && settings.active_engine().is_some() + && ctx.input_mut(|i| i.consume_key(Modifiers::NONE, Key::Enter)) + { + action = Some(DialogAction::Start); + } + match action { + Some(DialogAction::Start) => { + self.dialog_open = false; + settings.prep.chosen = true; + actions.push(PrepAction::SettingsChanged); + self.start_engine(settings, ctx, actions); + } + Some(DialogAction::EngineSwitch) => actions.push(PrepAction::EngineSwitch), + Some(DialogAction::OpenEngines) => { + self.dialog_open = false; + actions.push(PrepAction::OpenEngines); + } + None => {} + } + } + + // ----- the selection and the board --------------------------------------------- + + fn select(&mut self, sel: Selection) { + if self.selection == sel { + return; + } + self.selection = sel; + self.games_cursor = None; + self.shown_pos = self.shown_for(&self.selection); + self.board_state.clear(); + } + + /// The position of a selection and the way to it. + fn shown_for(&self, sel: &Selection) -> Option { + let report = self.report.as_ref()?; + let from_game = |g: &GameInfo, ply: usize, white: bool| -> Shown { + let ucis: Vec = g.ucis[..ply.min(g.ucis.len())].to_vec(); + let sans: Vec = g.sans[..ucis.len()].to_vec(); + let positions = replay(&ucis); + Shown { + ply: positions.len() - 1, + sans, + ucis, + positions, + arrows: Vec::new(), + note: None, + opening: None, + white, + } + }; + match sel { + Selection::None => None, + Selection::Node { white, node } => { + let cr = report.color(*white); + let n = cr.tree.nodes.get(*node as usize)?; + let g = &report.games[*n.games.first()? as usize]; + let mut s = from_game(g, usize::from(n.ply), *white); + s.opening = n.opening; + Some(s) + } + Selection::Opening { + white, + family, + variation, + } => { + let cr = report.color(*white); + let fam = cr.families.get(*family)?; + let var = match variation { + Some(v) => fam.variations.get(*v)?, + None => fam.variations.first()?, + }; + // The named position: a game of the variation at its named ply; the + // family's: the shallowest of its variations' names. + let (g, ply) = match variation { + Some(_) => { + let g = var + .games + .iter() + .map(|&g| &report.games[g as usize]) + .find(|g| g.opening == var.opening)?; + (g, g.named.unwrap_or(0) as usize) + } + None if fam.name.is_empty() => { + // No name: the start position. + let g = var.games.first().map(|&g| &report.games[g as usize])?; + (g, 0) + } + None => { + // The family's own position: where its name first appears in + // a line (the shallowest among the games). + let mut best: Option<(&GameInfo, usize)> = None; + for v in &fam.variations { + for &gi in &v.games { + let g = &report.games[gi as usize]; + if g.opening.is_none() { + continue; + } + let ply = family_ply(g, &fam.name).unwrap_or(g.named.unwrap_or(0) as usize); + if best.is_none_or(|(_, p)| ply < p) { + best = Some((g, ply)); + } + } + } + best? + } + }; + let mut s = from_game(g, ply, *white); + s.opening = var.opening; + Some(s) + } + Selection::Repeated { white, index } => { + let cr = report.color(*white); + let r = cr.repeated.get(*index)?; + let g = &report.games[*r.games.first()? as usize]; + let mut s = from_game(g, r.ply as usize, *white); + s.arrows = error_arrows(&s.positions[s.ply], &r.uci, cr.errors.iter().find(|e| e.key == r.key && e.uci == r.uci).map(|e| e.best_uci.as_str()), r.judgement); + s.note = cr + .errors + .iter() + .find(|e| e.key == r.key && e.uci == r.uci) + .map(error_note); + s.opening = r.opening; + Some(s) + } + Selection::Error { white, index } => { + let cr = report.color(*white); + let e = cr.errors.get(*index)?; + let g = &report.games[e.game as usize]; + let mut s = from_game(g, e.ply as usize, *white); + s.arrows = error_arrows(&s.positions[s.ply], &e.uci, Some(&e.best_uci), e.judgement); + s.note = Some(error_note(e)); + s.opening = e.opening; + Some(s) + } + } + } + + /// The games of the selection (indices into the report), newest first. + fn games_of(&self) -> Vec { + let Some(report) = &self.report else { + return Vec::new(); + }; + let mut list: Vec = match &self.selection { + Selection::None => self + .color + .colours() + .iter() + .flat_map(|&w| report.color(w).games.iter().copied()) + .collect(), + Selection::Node { white, node } => report + .color(*white) + .tree + .nodes + .get(*node as usize) + .map(|n| n.games.clone()) + .unwrap_or_default(), + Selection::Opening { + white, + family, + variation, + } => report + .color(*white) + .families + .get(*family) + .map(|f| match variation { + Some(v) => f.variations.get(*v).map(|v| v.games.clone()).unwrap_or_default(), + None => f.variations.iter().flat_map(|v| v.games.iter().copied()).collect(), + }) + .unwrap_or_default(), + Selection::Repeated { white, index } => report + .color(*white) + .repeated + .get(*index) + .map(|r| r.games.clone()) + .unwrap_or_default(), + Selection::Error { white, index } => report + .color(*white) + .errors + .get(*index) + .map(|e| vec![e.game]) + .unwrap_or_default(), + }; + if self.newest_first { + list.sort_by_key(|&g| std::cmp::Reverse(report.games[g as usize].date_number())); + } + list + } + + /// The move of the selection to open a game at. + fn selection_ply(&self) -> usize { + self.shown_pos.as_ref().map_or(0, |s| s.ucis.len()) + } + + /// The player's colour the board is seen from. + fn board_white(&self) -> bool { + let base = self + .shown_pos + .as_ref() + .map_or(self.color != ColorChoice::Black, |s| s.white); + match self.flipped { + Some(f) => f == base, + None => base, + } + } + + // ----- the frame ----------------------------------------------------------------- + + /// Draws the screen; what the application has to do. + pub fn show(&mut self, ui: &mut Ui, settings: &mut Settings) -> Vec { + let mut actions = Vec::new(); + let ctx = ui.ctx().clone(); + self.poll(&ctx, settings, &mut actions); + self.hover_arrow = None; + let typing = ctx.egui_wants_keyboard_input(); + let overlay = crate::app::overlay_open(&ctx) || self.dialog_open; + + egui::Panel::top("prep_header").show(ui, |ui| { + ui.add_space(4.0); + self.header(ui, &mut actions); + ui.add_space(4.0); + }); + let content = ctx.content_rect(); + let (w, h) = (content.width(), content.height() - 44.0); + let stacked = w < BOARD_MIN + 24.0 + RIGHT_MIN || h < 600.0; + let low = stacked && h < 720.0; + egui::Panel::top("prep_controls").show(ui, |ui| { + ui.add_space(4.0); + self.controls(ui, settings, low, &mut actions); + ui.add_space(2.0); + self.summary(ui, stacked); + ui.add_space(4.0); + }); + if self.report.is_none() { + egui::CentralPanel::default().show(ui, |ui| self.building(ui, &mut actions)); + } else if stacked { + if !low { + egui::Panel::top("prep_board_stack").show(ui, |ui| { + ui.add_space(4.0); + ui.horizontal(|ui| { + ui.allocate_ui(vec2(240.0, 240.0), |ui| self.board(ui, settings, 240.0)); + ui.vertical(|ui| self.board_info(ui, &mut actions)); + }); + ui.add_space(4.0); + }); + } + egui::CentralPanel::default().show(ui, |ui| self.right_column(ui, settings, &mut actions)); + if low && self.board_popup { + self.board_overlay(&ctx, settings, &mut actions); + } + } else { + let board_side = (h - 120.0).min(420.0).min(w - BOARD_MIN - 24.0 - RIGHT_MIN + BOARD_MIN).max(BOARD_MIN).floor(); + egui::Panel::left("prep_board") + .exact_size(board_side + 24.0) + .resizable(false) + .show(ui, |ui| { + ui.add_space(6.0); + ui.vertical(|ui| { + self.board_caption(ui); + self.board(ui, settings, board_side); + self.board_info(ui, &mut actions); + }); + }); + egui::CentralPanel::default().show(ui, |ui| self.right_column(ui, settings, &mut actions)); + } + self.engine_dialog(&ctx, settings, &mut actions); + if !typing && !overlay { + self.keyboard(&ctx, settings, &mut actions); + } + actions + } + + fn header(&mut self, ui: &mut Ui, actions: &mut Vec) { + let gap = ui.spacing().item_spacing.x; + let button_w = |ui: &Ui, text: &str| { + text_width(ui, text, egui::TextStyle::Button) + 2.0 * ui.spacing().button_padding.x + gap + }; + let row = ui.available_width(); + let compact = row < 700.0; + let left = button_w(ui, if compact { "⬅" } else { tr("⬅ Library") }) + 2.0 * gap; + let right = button_w(ui, if compact { "⚙" } else { tr("⚙ Settings") }); + let title_room = (row - left - right).max(80.0); + ui.horizontal(|ui| { + if ui + .button(if compact { "⬅" } else { tr("⬅ Library") }) + .on_hover_text(tr("Back to the game list (Esc, Ctrl+W)")) + .clicked() + { + actions.push(PrepAction::Back); + } + ui.separator(); + let name = self.names.first().cloned().unwrap_or_default(); + let more = self.names.len().saturating_sub(1); + let mut parts = Vec::new(); + if let Some(r) = &self.report { + parts.push(crate::i18n::games(r.games.len())); + let p = period(&r.games); + if !p.is_empty() { + parts.push(p); + } + } + parts.push(self.db_name.clone()); + let title = if compact { + name.clone() + } else { + trf("Preparing against {name}", &[("name", &name)]) + }; + ui.allocate_ui(vec2(title_room, 24.0), |ui| { + ui.horizontal(|ui| { + ui.set_max_width(title_room); + ui.add(egui::Label::new(RichText::new(title).strong().size(15.0)).truncate()); + if more > 0 { + ui.label(RichText::new(trf("+{n} spelling", &[("n", &more)])).weak()) + .on_hover_text(self.names.join("\n")); + } + let skipped = self.report.as_ref().map_or(0, |r| r.skipped); + let r = ui.add( + egui::Label::new(RichText::new(format!("· {}", parts.join(" · "))).weak()).truncate(), + ); + if skipped > 0 { + r.on_hover_text(trf("not counted: from a set position — {n}", &[("n", &skipped)])); + } + }); + }); + ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { + if ui + .button(if compact { "⚙" } else { tr("⚙ Settings") }) + .on_hover_text(tr("Settings (Ctrl+,)")) + .clicked() + { + actions.push(PrepAction::OpenSettings); + } + }); + }); + } + + /// The colour switch, the book, the depth and the engine button or its progress. + fn controls(&mut self, ui: &mut Ui, settings: &mut Settings, low: bool, actions: &mut Vec) { + let width = ui.available_width(); + ui.horizontal(|ui| { + for choice in [ColorChoice::White, ColorChoice::Black, ColorChoice::Both] { + if ui.selectable_value(&mut self.color, choice, choice.label()).clicked() { + // A selection of a colour no longer shown is dropped. + let keep = match &self.selection { + Selection::None => true, + Selection::Node { white, .. } + | Selection::Opening { white, .. } + | Selection::Repeated { white, .. } + | Selection::Error { white, .. } => self.color.colours().contains(white), + }; + if !keep { + self.select(Selection::None); + } + } + } + ui.separator(); + let book_w = if width < 900.0 { 150.0 } else { 240.0 }; + if width >= 640.0 { + ui.label(tr("Book")); + } + let own_name = self.db_name.clone(); + if let Some(b) = book_picker(ui, "prep_book", &self.book, &self.path, &own_name, &self.dbs, book_w) { + self.book = b; + self.book_failed = None; + self.book_asked = None; + settings.prep.book = Some(self.book.setting(&self.path)); + actions.push(PrepAction::SettingsChanged); + } + if let Some((_, why)) = &self.book_failed { + ui.label(RichText::new(trf("Book: could not open — {reason}", &[("reason", why)])).color(ui.visuals().warn_fg_color)); + } + ui.separator(); + let moves = self.plies.div_ceil(2); + let depth_label = if width < 760.0 { + format!("{moves}") + } else { + trf("Opening: {n} moves", &[("n", &moves)]) + }; + let mut new_plies = None; + egui::ComboBox::from_id_salt("prep_plies") + .selected_text(depth_label) + .show_ui(ui, |ui| { + for m in [6usize, 10, 15] { + if ui + .selectable_label(self.plies == m * 2, trf("Opening: {n} moves", &[("n", &m)])) + .clicked() + { + new_plies = Some(m * 2); + } + } + }) + .response + .on_hover_text(tr("How deep the tree and the engine look")); + if let Some(p) = new_plies.filter(|p| *p != self.plies) { + self.plies = p; + settings.prep.plies = p; + actions.push(PrepAction::SettingsChanged); + self.save(); + self.report = None; + let dir = cache_dir(); + let options = Options { + plies: p, + side: Side::Any, + }; + let cached = dir + .as_deref() + .and_then(|d| PrepReport::load(d, &self.db, &self.player, &options)); + match cached { + Some(r) => self.take_report(r, settings), + None => self.rebuild(ui.ctx()), + } + self.selection = Selection::None; + self.shown_pos = None; + } + if low { + ui.separator(); + if ui + .selectable_label(self.board_popup, if width < 760.0 { "♙" } else { tr("♙ Board") }) + .on_hover_text(tr("The board of the chosen position")) + .clicked() + { + self.board_popup = !self.board_popup; + } + } + ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { + self.engine_control(ui, settings, width, actions); + }); + }); + } + + /// The engine button, the progress while it runs, the state after. + fn engine_control(&mut self, ui: &mut Ui, settings: &Settings, width: f32, actions: &mut Vec) { + if let Some(job) = &self.job { + let (done, total) = (job.done, job.total); + if ui.button(tr("Stop")).on_hover_text("Shift+A").clicked() { + self.stop_engine(actions); + return; + } + let left = total.saturating_sub(done); + let per_thread = self.nps_per_thread.unwrap_or(review::DEFAULT_NPS); + let secs = review::estimate_secs(left, job.nodes, per_thread, job.threads); + let text = if width < 760.0 { + format!("{done}/{total}") + } else { + trf( + "Finding errors: {done} of {total} positions · ≈ {time}", + &[("done", &done), ("total", &total), ("time", &review::format_duration(secs))], + ) + }; + ui.add( + egui::ProgressBar::new(done as f32 / total.max(1) as f32) + .desired_width((width * 0.35).clamp(90.0, 360.0)) + .text(text), + ); + return; + } + let Some(report) = &self.report else { return }; + let (missing, secs) = self.estimate(settings); + let time = review::format_duration(secs); + let done_before = report.engine.is_some(); + let label = if missing == 0 && done_before { + tr("Errors found").to_owned() + } else if width < 700.0 { + format!("▶ ≈ {time}") + } else if width < 900.0 { + trf("▶ Errors ≈ {time}", &[("time", &time)]) + } else if done_before { + trf("Analyse {n} more positions ≈ {time}", &[("n", &missing), ("time", &time)]) + } else { + trf("▶ Find opening errors ≈ {time}", &[("time", &time)]) + }; + let hint = match &report.engine { + Some(e) => { + let quality = REVIEW_QUALITY + .iter() + .find(|q| q.1 == e.nodes) + .map_or_else(|| review::format_count(e.nodes), |q| tr(q.0).to_owned()); + trf( + "Errors found · {engine} · {quality} · {n} positions", + &[("engine", &e.name), ("quality", &quality), ("n", &report.evals.len())], + ) + } + None => tr("The engine finds the opening errors in his games (Shift+A)").to_owned(), + }; + if missing == 0 && done_before { + ui.label(RichText::new(label).weak()).on_hover_text(hint); + } else if crate::widgets::primary(ui, &label).on_hover_text(hint).clicked() { + self.engine_asked(settings, ui.ctx(), actions); + } + if ui + .button("▾") + .on_hover_text(tr("Options…")) + .clicked() + { + self.dialog_open = true; + } + if let Some(e) = &self.error { + ui.label(RichText::new("⚠").color(ui.visuals().error_fg_color)) + .on_hover_text(e); + } + } + + /// A line per colour: games, score, opponents, the last game, the book. + fn summary(&self, ui: &mut Ui, stacked: bool) { + let Some(report) = &self.report else { return }; + let colours = if stacked { self.color.colours() } else { vec![true, false] }; + for white in colours { + let cr = report.color(white); + let tally = &cr.tree.nodes[0].tally; + let weak = !self.color.colours().contains(&white); + let title = if white { tr("As White") } else { tr("As Black") }; + ui.horizontal_wrapped(|ui| { + let text = |ui: &mut Ui, s: String| { + let rt = RichText::new(s); + ui.label(if weak { rt.weak() } else { rt }); + }; + text(ui, format!("{title} {}", tally.games)); + if tally.games == 0 { + return; + } + text(ui, format!("· {} ({})", score_text(tally), tally_hint(tally))); + if !stacked { + if let Some(elo) = cr.tree.nodes[0].average_elo() { + text(ui, format!("· {}", trf("opponents ≈ {elo}", &[("elo", &elo)]))); + } + let last = crate::library::display_date(&cr.tree.nodes[0].last_date); + if !last.is_empty() { + text(ui, format!("· {}", trf("last {date}", &[("date", &last)]))); + } + } + if report.book.is_some() { + let mut plies: Vec = cr + .games + .iter() + .filter_map(|&g| report.games[g as usize].book.map(|b| b.ply)) + .collect(); + if !plies.is_empty() { + plies.sort_unstable(); + let median = plies[plies.len() / 2]; + let (own, other) = cr.book_exits(&report.games); + let p = 100 * own / (own + other).max(1); + text( + ui, + format!( + "· {}", + trf( + "leaves the book at move {n}, first in {p} % of games", + &[("n", &median.div_ceil(2).max(1)), ("p", &p)] + ) + ), + ); + } + } else if self.book_job.is_some() { + text(ui, format!("· {}", tr("book…"))); + } + if !stacked && report.engine.is_some() && cr.counts.total() > 0 { + let games_with: HashSet = cr.errors.iter().map(|e| e.game).collect(); + let n = games_with.len(); + let p = 100 * n / cr.games.len().max(1); + let c = &cr.counts; + ui.label(RichText::new("·").weak()); + let line = trf( + "Opening errors: {i} inaccuracies · {m} mistakes · {b} blunders — in {g} games ({p} %)", + &[ + ("i", &c.inaccuracies), + ("m", &c.mistakes), + ("b", &c.blunders), + ("g", &n), + ("p", &p), + ], + ); + let rt = RichText::new(line); + ui.label(if weak { rt.weak() } else { rt }); + } + }); + } + let shown: usize = self + .color + .colours() + .iter() + .map(|&w| report.color(w).games.len()) + .sum(); + if shown > 0 && shown < 10 { + ui.label( + RichText::new(trf( + "Few games ({n}): percentages and scores are unreliable", + &[("n", &shown)], + )) + .color(ui.visuals().warn_fg_color), + ); + } + } + + /// The report is being built: its progress. + fn building(&mut self, ui: &mut Ui, actions: &mut Vec) { + ui.add_space(40.0); + ui.vertical_centered(|ui| { + if let Some(e) = &self.error { + ui.label(RichText::new(e).color(ui.visuals().error_fg_color)); + if ui.button(tr("Try again")).clicked() { + self.error = None; + self.rebuild(ui.ctx()); + } + return; + } + let Some(job) = &self.build else { return }; + let done = job.progress(); + let total = self.build_total.max(done).max(1); + ui.add(egui::Spinner::new().size(18.0)); + let p = 100 * done / total; + ui.label(trf("Collecting games… {p} %", &[("p", &p.min(99))])); + if ui.button(tr("Cancel")).clicked() { + actions.push(PrepAction::Back); + } + }); + } + + // ----- the board ----------------------------------------------------------------- + + /// «Black to move · after 3.Bb5» over the board. + fn board_caption(&self, ui: &mut Ui) { + let text = match &self.shown_pos { + Some(s) => { + let pos = &s.positions[s.ply]; + let side = if pos.turn() == Color::White { + tr("White to move") + } else { + tr("Black to move") + }; + match s.ply.checked_sub(1).and_then(|p| s.sans.get(p).map(|san| short_label(p, san))) { + Some(m) => format!("{side} · {}", trf("after {move}", &[("move", &m)])), + None => side.to_owned(), + } + } + None => tr("Start position").to_owned(), + }; + ui.label(RichText::new(text).weak()); + } + + fn board(&mut self, ui: &mut Ui, settings: &Settings, side: f32) { + let start = Chess::default(); + let (pos, last_move, arrows): (&Chess, Option<(Square, Square)>, Vec) = match &self.shown_pos { + Some(s) => { + let pos = &s.positions[s.ply]; + let last = s + .ply + .checked_sub(1) + .and_then(|p| s.ucis.get(p)) + .and_then(|u| u.parse::().ok()) + .and_then(|u| u.to_move(&s.positions[s.ply - 1]).ok()) + .and_then(|m| Some((m.from()?, crate::board::ui_target(&m)))); + let mut arrows = if s.ply + 1 == s.positions.len() { s.arrows.clone() } else { Vec::new() }; + if let Some((from, to)) = self.hover_arrow { + arrows.push(Arrow { + from, + to, + color: PREVIEW_ARROW, + weight: 1.0, + }); + } + (pos, last, arrows) + } + None => { + let mut arrows = Vec::new(); + if let Some((from, to)) = self.hover_arrow { + arrows.push(Arrow { + from, + to, + color: PREVIEW_ARROW, + weight: 1.0, + }); + } + (&start, None, arrows) + } + }; + let view = BoardView { + pos, + orientation: if self.board_white() { Color::White } else { Color::Black }, + last_move, + arrows: &arrows, + circles: &[], + badge: None, + interactive: false, + show_coords: settings.show_coords, + theme: settings.board_theme.theme(), + pieces: settings.piece_set, + animation: settings.animation.seconds(), + premove: None, + auto_queen: settings.auto_queen, + alert: None, + }; + ui.allocate_ui(vec2(side, side), |ui| { + view.show(ui, &mut self.board_state); + }); + } + + /// Under the board: the line (a click takes the board along it), the opening, the + /// note of an error, «Open as a game» and the menu. + fn board_info(&mut self, ui: &mut Ui, actions: &mut Vec) { + ui.add_space(4.0); + let Some(report) = &self.report else { return }; + let Some(s) = &self.shown_pos else { + ui.label(RichText::new(tr("Choose a move in the tree, an opening or an error: its position is shown here")).weak()); + return; + }; + let mut goto = None; + ui.horizontal_wrapped(|ui| { + ui.spacing_mut().item_spacing.x = 4.0; + if s.sans.is_empty() { + ui.label(RichText::new(tr("Start position")).weak()); + } + for (i, san) in s.sans.iter().enumerate() { + let label = short_label(i, san); + let current = i + 1 == s.ply; + let text = if current { + RichText::new(label).strong() + } else { + RichText::new(label) + }; + if ui.add(egui::Label::new(text).sense(Sense::click())).clicked() { + goto = Some(i + 1); + } + } + }); + if let Some(o) = s.opening.and_then(|o| report.openings.get(o)) { + ui.label(RichText::new(format!("{} · {}", o.name, o.eco)).weak().small()); + } + if let Some(note) = &s.note { + ui.label(RichText::new(note).small()); + } + let (sans, ucis, pos, white, ply) = (s.sans.clone(), s.ucis.clone(), s.positions[s.ply].clone(), s.white, s.ply); + ui.horizontal(|ui| { + if ui + .button(tr("Open as a game")) + .on_hover_text(tr("The line as a new game, to add moves and comments")) + .clicked() + { + actions.push(PrepAction::OpenPgn(self.line_pgn(&sans[..ply], white))); + } + ui.menu_button("⋯", |ui| { + if ui.button(tr("Play on from here…")).clicked() { + let moves: Vec = { + let mut p = Chess::default(); + ucis[..ply] + .iter() + .filter_map(|u| { + let m = u.parse::().ok()?.to_move(&p).ok()?; + p.play_unchecked(m); + Some(m) + }) + .collect() + }; + let last = moves.last().and_then(|m| Some((m.from()?, crate::board::ui_target(m)))); + let after = ply.checked_sub(1).map(|p| prep::move_label(p, &sans[p])); + actions.push(PrepAction::PlayFrom(Box::new(crate::play::StartFrom { + start_fen: None, + moves, + position: pos.clone(), + last, + after: after.clone(), + after_shown: after.map(|a| crate::san::show(&a).into_owned()), + game: Some(self.title()), + null_dropped: false, + }))); + ui.close(); + } + if ui.button(tr("Find this position in a database (Ctrl+Shift+F)")).clicked() { + let mut p = Chess::default(); + let moves: Vec = ucis[..ply] + .iter() + .filter_map(|u| { + let m = u.parse::().ok()?.to_move(&p).ok()?; + p.play_unchecked(m); + Some(m) + }) + .collect(); + actions.push(PrepAction::FindPosition(self.path.clone(), Chess::default(), moves, !self.board_white())); + ui.close(); + } + if ui.button(tr("Copy FEN")).clicked() { + let fen = shakmaty::fen::Fen::from_position(&pos, shakmaty::EnPassantMode::Legal).to_string(); + actions.push(PrepAction::CopyText(fen, tr("FEN copied"))); + ui.close(); + } + if ui.button(tr("Copy moves (PGN)")).clicked() { + actions.push(PrepAction::CopyText(self.line_pgn(&sans[..ply], white), tr("PGN copied"))); + ui.close(); + } + }); + }); + if let Some(p) = goto + && let Some(s) = self.shown_pos.as_mut() + { + s.ply = p; + self.board_state.clear(); + } + } + + /// The line as a PGN game: the player on his side, the opponent unnamed. + fn line_pgn(&self, sans: &[String], white: bool) -> String { + let name = self.names.first().cloned().unwrap_or_default(); + let (w, b) = if white { (name, "?".to_owned()) } else { ("?".to_owned(), name) }; + let mut moves = String::new(); + for (i, san) in sans.iter().enumerate() { + if i.is_multiple_of(2) { + moves.push_str(&format!("{}. ", i / 2 + 1)); + } + moves.push_str(san); + moves.push(' '); + } + format!("[Event \"{}\"]\n[White \"{w}\"]\n[Black \"{b}\"]\n[Result \"*\"]\n\n{moves}*\n", self.title()) + } + + /// In a low window: the board over the right bottom of the screen. + fn board_overlay(&mut self, ctx: &egui::Context, settings: &Settings, actions: &mut Vec) { + let screen = ctx.content_rect(); + let size = vec2(264.0, 300.0); + let rect = egui::Rect::from_min_size(screen.right_bottom() - size, size); + let area = egui::Area::new(egui::Id::new("prep_board_overlay")) + .order(egui::Order::Middle) + .fixed_pos(rect.min) + .show(ctx, |ui| { + let frame = egui::Frame::side_top_panel(ui.style()) + .stroke(ui.visuals().window_stroke) + .shadow(egui::Shadow { + offset: [-6, -6], + blur: 16, + spread: 0, + color: Color32::from_black_alpha(110), + }); + frame.show(ui, |ui| { + ui.set_min_size(size - vec2(16.0, 16.0)); + ui.set_max_size(size - vec2(16.0, 16.0)); + self.board_caption(ui); + self.board(ui, settings, 240.0); + ui.horizontal(|ui| { + if ui.button(tr("Open as a game")).clicked() + && let Some(s) = &self.shown_pos + { + actions.push(PrepAction::OpenPgn(self.line_pgn(&s.sans[..s.ply], s.white))); + } + }); + }); + }); + if area.response.clicked_elsewhere() { + self.board_popup = false; + } + } + + // ----- the right column --------------------------------------------------------- + + /// The tabs over the games list, the border between them draggable. (A nested + /// bottom panel would not do: in a top-down `Ui` egui's available rect ignores + /// the cursor's bottom, so the content above overlaps it.) + fn right_column(&mut self, ui: &mut Ui, settings: &mut Settings, actions: &mut Vec) { + let height = ui.available_height(); + let width = ui.available_width(); + let least = 4.0 * ROW_H + 60.0; + let most = (height - 160.0).max(least); + let games_h = self + .games_height + .unwrap_or(height * 0.35) + .clamp(least, most) + .floor(); + let tabs_h = (height - games_h - 10.0).max(0.0); + ui.allocate_ui_with_layout(vec2(width, tabs_h), egui::Layout::top_down(egui::Align::Min), |ui| { + ui.set_min_height(tabs_h); + ui.set_max_height(tabs_h); + self.tabs(ui, settings, actions); + }); + // The border: dragged, it gives the games list more or less. + let (rect, resp) = ui.allocate_exact_size(vec2(width, 10.0), Sense::drag()); + if resp.hovered() || resp.dragged() { + ui.ctx().set_cursor_icon(egui::CursorIcon::ResizeVertical); + } + if resp.dragged() { + self.games_height = Some((games_h - resp.drag_delta().y).clamp(least, most)); + } + let stroke = if resp.hovered() || resp.dragged() { + ui.visuals().widgets.hovered.fg_stroke + } else { + ui.visuals().widgets.noninteractive.bg_stroke + }; + ui.painter().hline(rect.x_range(), rect.center().y, stroke); + ui.allocate_ui_with_layout(vec2(width, games_h), egui::Layout::top_down(egui::Align::Min), |ui| { + ui.set_min_height(games_h); + ui.set_max_height(games_h); + self.games_list(ui, actions); + }); + } + + fn tabs(&mut self, ui: &mut Ui, settings: &mut Settings, actions: &mut Vec) { + { + ui.horizontal(|ui| { + for (tab, label, key) in [ + (Tab::Repertoire, tr("Repertoire"), "Ctrl+1"), + (Tab::Openings, tr("Openings"), "Ctrl+2"), + (Tab::Errors, tr("Errors"), "Ctrl+3"), + ] { + ui.selectable_value(&mut self.tab, tab, label).on_hover_text(key); + } + if self.tab == Tab::Repertoire { + ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { + if ui.small_button(tr("Collapse")).clicked() { + self.collapse_selected(); + } + if ui.small_button(tr("Expand all")).clicked() { + self.expand_selected(); + } + let mut n = self.branches_from; + egui::ComboBox::from_id_salt("prep_branches") + .selected_text(trf("Branches from {n} games", &[("n", &n)])) + .show_ui(ui, |ui| { + for k in [2u32, 3, 5] { + ui.selectable_value(&mut n, k, trf("Branches from {n} games", &[("n", &k)])); + } + }) + .response + .on_hover_text(tr("Moves with fewer games fold into «other moves»")); + if n != self.branches_from { + self.branches_from = n; + settings.prep.branches_from = n; + actions.push(PrepAction::SettingsChanged); + } + }); + } + }); + ui.add_space(2.0); + match self.tab { + Tab::Repertoire => self.tree_table(ui), + Tab::Openings => self.openings_table(ui), + Tab::Errors => self.errors_tab(ui, settings, actions), + } + } + } + + fn expand_selected(&mut self) { + let Some(report) = &self.report else { return }; + let roots: Vec<(bool, u32)> = match &self.selection { + Selection::Node { white, node } => vec![(*white, *node)], + _ => self.color.colours().iter().map(|&w| (w, 0)).collect(), + }; + for (white, root) in roots { + let tree = &report.color(white).tree; + let mut stack = vec![root]; + while let Some(n) = stack.pop() { + self.expanded.insert((white, n)); + self.others_open.insert((white, n)); + stack.extend(tree.nodes[n as usize].children.iter().copied()); + } + } + } + + fn collapse_selected(&mut self) { + let Some(report) = &self.report else { return }; + match &self.selection { + Selection::Node { white, node } => { + let tree = &report.color(*white).tree; + let mut stack = vec![*node]; + while let Some(n) = stack.pop() { + self.expanded.remove(&(*white, n)); + self.others_open.remove(&(*white, n)); + stack.extend(tree.nodes[n as usize].children.iter().copied()); + } + } + _ => { + self.expanded.retain(|(_, n)| *n == 0); + self.others_open.clear(); + } + } + } + + /// The rows of the tree as laid out for the colour switch and the expansion. + fn tree_rows(&self) -> Vec { + let Some(report) = &self.report else { + return Vec::new(); + }; + let mut rows = Vec::new(); + for white in self.color.colours() { + let tree = &report.color(white).tree; + if tree.nodes.is_empty() { + continue; + } + // (node, depth, after the main children: the others) + let mut stack: Vec = vec![TreeRow::Node { + white, + node: 0, + depth: 0, + }]; + while let Some(row) = stack.pop() { + rows.push(row); + let (node, depth, listed) = match row { + TreeRow::Node { node, depth, .. } => { + if !self.expanded.contains(&(white, node)) { + continue; + } + (node, depth, false) + } + TreeRow::Others { parent, depth, .. } => { + if !self.others_open.contains(&(white, parent)) { + continue; + } + // The folded moves go under the «other moves» row. + (parent, depth, true) + } + }; + let n = &tree.nodes[node as usize]; + let (main, rest): (Vec, Vec) = n + .children + .iter() + .copied() + .partition(|&c| tree.nodes[c as usize].tally.games >= self.branches_from); + // Pushed in reverse: the stack pops the first child first. + if listed { + for &c in rest.iter().rev() { + stack.push(TreeRow::Node { + white, + node: c, + depth: depth + 1, + }); + } + } else { + if !rest.is_empty() { + stack.push(TreeRow::Others { + white, + parent: node, + depth: depth + 1, + count: rest.len(), + }); + } + for &c in main.iter().rev() { + stack.push(TreeRow::Node { + white, + node: c, + depth: depth + 1, + }); + } + } + } + } + rows + } + + fn tree_table(&mut self, ui: &mut Ui) { + let rows = self.tree_rows(); + if rows.len() <= 1 { + self.no_games_note(ui); + } + let Some(report) = self.report.as_ref() else { return }; + let width = ui.available_width(); + let gap = ui.spacing().item_spacing.x; + let has_book = report.book.is_some() || self.book_job.is_some(); + let mut used = 180.0 + 56.0 + 40.0 + 50.0 + 4.0 * gap; + let mut fits = |w: f32, wanted: bool| { + let ok = wanted && used + w + gap <= width; + if ok { + used += w + gap; + } + ok + }; + let show_opening = fits(160.0, true); + let show_bar = fits(64.0, true); + let show_last = fits(84.0, true); + let show_book = fits(80.0, has_book); + let book_title = if self.book == BookChoice::Same { tr("In database") } else { tr("Book") }; + ui.style_mut().interaction.selectable_labels = false; + let mut table = TableBuilder::new(ui) + .id_salt("prep_tree") + .striped(true) + .sense(Sense::click()) + .auto_shrink([false, false]) + .cell_layout(egui::Layout::left_to_right(egui::Align::Center)) + .column(Column::remainder().at_least(180.0).clip(true)); + if show_opening { + table = table.column(Column::remainder().at_least(160.0).clip(true)); + } + table = table.column(Column::exact(56.0)).column(Column::exact(40.0)); + table = table.column(Column::exact(if show_bar { 110.0 } else { 50.0 })); + if show_last { + table = table.column(Column::exact(84.0)); + } + if show_book { + table = table.column(Column::exact(80.0)); + } + let selected_row = rows.iter().position(|r| match (r, &self.selection) { + (TreeRow::Node { white, node, .. }, Selection::Node { white: sw, node: sn }) => white == sw && node == sn, + _ => false, + }); + if self.scroll_to_selected + && let Some(i) = selected_row + { + table = table.scroll_to_row(i, None); + } + self.scroll_to_selected = false; + let mut clicked: Option = None; + let mut toggled: Option = None; + let mut hovered: Option<(bool, u32)> = None; + let threshold = report.book.as_ref().map_or(prep::DEFAULT_BOOK_THRESHOLD, |b| b.threshold); + table + .header(ROW_H, |mut h| { + head_col(&mut h, tr("Move"), tr("His moves plain, the opponents' weak; ⇄ — the position is reached by another move order too")); + if show_opening { + head_col(&mut h, tr("Opening"), ""); + } + head_col(&mut h, tr("Games"), ""); + head_col(&mut h, "%", tr("Share of the games of the move above")); + head_col(&mut h, tr("Score"), tr("The opponent's points in these games")); + if show_last { + head_col(&mut h, tr("Last"), ""); + } + if show_book { + head_col(&mut h, book_title, tr("Games of the book in this position; the first number under the threshold is where he leaves the book")); + } + }) + .body(|body| { + body.rows(ROW_H, rows.len(), |mut row| { + let r = rows[row.index()]; + row.set_selected(Some(row.index()) == selected_row); + match r { + TreeRow::Others { white, parent, depth, count } => { + let open = self.others_open.contains(&(white, parent)); + row.col(|ui| { + ui.add_space(depth as f32 * 14.0); + let glyph = if open { "▾" } else { "▸" }; + if ui.add(egui::Label::new(RichText::new(glyph).weak()).sense(Sense::click())).clicked() { + toggled = Some(r); + } + ui.label(RichText::new(trf("other moves ({n})", &[("n", &count)])).weak()); + }); + let rest = 2 + usize::from(show_opening) + 1 + usize::from(show_last) + usize::from(show_book); + for _ in 0..rest { + row.col(|_| {}); + } + } + TreeRow::Node { white, node, depth } => { + let cr = report.color(white); + let n = &cr.tree.nodes[node as usize]; + let parent = n.parent.map(|p| &cr.tree.nodes[p as usize]); + let has_children = !n.children.is_empty(); + let open = self.expanded.contains(&(white, node)); + let few = n.tally.games < FEW_GAMES; + row.col(|ui| { + ui.add_space(depth as f32 * 14.0); + let glyph = if !has_children { " " } else if open { "▾" } else { "▸" }; + let g = ui.add(egui::Label::new(RichText::new(glyph).weak()).sense(Sense::click())); + if g.clicked() && has_children { + toggled = Some(r); + } + if n.parent.is_none() { + let title = if white { tr("As White") } else { tr("As Black") }; + ui.label(RichText::new(format!("{title} · {}", n.tally.games)).strong()); + return; + } + let ply = usize::from(n.ply) - 1; + let players = ply.is_multiple_of(2) == white; + let label = short_label(ply, &n.san); + let text = if players { RichText::new(label) } else { RichText::new(label).weak() }; + let l = ui.add(egui::Label::new(text).truncate()); + if !show_opening && let Some(o) = n.opening.filter(|_| n.named).and_then(|o| report.openings.get(o)) { + l.on_hover_text(format!("{} · {}", o.name, o.eco)); + } + if n.transposition { + let others: Vec = cr + .tree + .nodes + .iter() + .enumerate() + .filter(|(i, m)| m.key == n.key && *i != node as usize) + .map(|(i, _)| line_text(&cr.tree.path(i).iter().map(|s| (*s).to_owned()).collect::>())) + .collect(); + ui.label(RichText::new("⇄").weak()).on_hover_text(trf( + "Reached by another move order too: {orders}", + &[("orders", &others.join("; "))], + )); + } + if let Some(p) = parent + && let Some(m) = self.mark_of(white, p.key, &n.uci) + { + let best = crate::san::show(&m.best_san).into_owned(); + pill(ui, m.judgement).on_hover_text(format!( + "{}: {}", + review::judgement_name(m.judgement), + trf( + "Mistake: better {best} ({before} → {after}) · in {n} games", + &[("best", &best), ("before", &m.before.format()), ("after", &m.after.format()), ("n", &m.games)], + ) + .trim_start_matches(&format!("{}: ", tr("Mistake"))) + )); + if m.games > 1 { + ui.label(RichText::new(format!("×{}", m.games)).weak().small()); + } + } + }); + if show_opening { + row.col(|ui| { + // The name where it first appears (the table names + // 2.Nf3 «Sicilian Defense» again: not repeated). + let new_name = n.named + && parent.is_none_or(|p| { + p.opening.map(|o| report.openings[o].name.as_str()) + != n.opening.map(|o| report.openings[o].name.as_str()) + }); + if new_name && let Some(o) = n.opening.and_then(|o| report.openings.get(o)) { + ui.add(egui::Label::new(RichText::new(&o.name).weak()).truncate()) + .on_hover_text(format!("{} · {}", o.name, o.eco)); + ui.label(RichText::new(&o.eco).weak().small()); + } + }); + } + row.col(|ui| { + ui.label(n.tally.games.to_string()); + }); + row.col(|ui| { + if let Some(p) = parent { + let pct = 100 * n.tally.games / p.tally.games.max(1); + let t = RichText::new(format!("{pct}")); + let l = ui.label(if few { t.weak() } else { t }); + if few { + l.on_hover_text(tr("Few games: percentages are unreliable")); + } + } + }); + row.col(|ui| { + let t = RichText::new(score_text(&n.tally)); + let l = ui.label(if few { t.weak() } else { t }); + l.on_hover_text(tally_hint(&n.tally)); + if show_bar { + let (rect, _) = ui.allocate_exact_size(vec2(56.0, 14.0), Sense::hover()); + let painter_alpha = if few { 0.5 } else { 1.0 }; + let _ = painter_alpha; + board_search::results_bar(ui, rect, &bar_tally(&n.tally, white), ui.visuals().text_color()); + } + }); + if show_last { + row.col(|ui| { + let d = crate::library::display_date(&n.last_date); + ui.label(RichText::new(if d.is_empty() { "—".to_owned() } else { d }).weak()); + }); + } + if show_book { + row.col(|ui| { + match self.book_count(n.key) { + Some(c) if c < threshold => { + let parent_in = parent.and_then(|p| self.book_count(p.key)).is_none_or(|pc| pc >= threshold); + let t = RichText::new(crate::large_db::grouped(c as usize)); + let l = ui.label(if parent_in { t.color(ui.visuals().warn_fg_color) } else { t.weak() }); + if parent_in { + let book = match &self.book { + BookChoice::Database(p) => base_name(p), + _ => self.db_name.clone(), + }; + l.on_hover_text(trf( + "Here he leaves the book: in “{book}” this position occurs {n} times", + &[("book", &book), ("n", &c)], + )); + } + } + Some(c) => { + ui.label(RichText::new(crate::large_db::grouped(c as usize)).weak()); + } + None if self.book_job.is_some() => { + ui.label(RichText::new("…").weak()); + } + None => {} + } + }); + } + let resp = row.response(); + if resp.hovered() { + hovered = Some((white, node)); + } + if resp.double_clicked() && has_children { + toggled = Some(r); + } else if resp.clicked() { + clicked = Some(r); + } + } + } + }); + }); + // A child of the chosen node under the pointer: its move as an arrow. + if let (Some((white, node)), Selection::Node { white: sw, node: sn }) = (hovered, &self.selection) + && white == *sw + { + let cr = report.color(white); + let n = &cr.tree.nodes[node as usize]; + if n.parent == Some(*sn) + && let Some(s) = &self.shown_pos + && s.ply + 1 == s.positions.len() + && let Some(m) = n.uci.parse::().ok().and_then(|u| u.to_move(&s.positions[s.ply]).ok()) + { + self.hover_arrow = m.from().map(|f| (f, crate::board::ui_target(&m))); + } + } + if let Some(t) = toggled { + match t { + TreeRow::Node { white, node, .. } => { + if !self.expanded.remove(&(white, node)) { + self.expanded.insert((white, node)); + } + } + TreeRow::Others { white, parent, .. } => { + if !self.others_open.remove(&(white, parent)) { + self.others_open.insert((white, parent)); + } + } + } + } else if let Some(TreeRow::Node { white, node, .. }) = clicked { + self.focus_games = false; + self.select(Selection::Node { white, node }); + } else if let Some(TreeRow::Others { white, parent, .. }) = clicked + && !self.others_open.remove(&(white, parent)) + { + self.others_open.insert((white, parent)); + } + } + + /// «No games as Black. As White — 138 · Show White» when the colour has none. + fn no_games_note(&mut self, ui: &mut Ui) { + let Some(report) = &self.report else { return }; + let (shown, other) = match self.color { + ColorChoice::White => (true, false), + ColorChoice::Black => (false, true), + ColorChoice::Both => return, + }; + if !report.color(shown).games.is_empty() { + return; + } + let other_n = report.color(other).games.len(); + let (colour, other_name) = if shown { (tr("White"), tr("Black")) } else { (tr("Black"), tr("White")) }; + ui.add_space(12.0); + ui.horizontal_wrapped(|ui| { + ui.label(trf("No games as {colour}. As {other} — {n}", &[("colour", &colour), ("other", &other_name), ("n", &other_n)])); + if other_n > 0 && ui.link(trf("Show {other}", &[("other", &other_name)])).clicked() { + self.color = ColorChoice::from_side(if other { Side::White } else { Side::Black }); + } + }); + } + + // ----- the openings -------------------------------------------------------------- + + fn openings_table(&mut self, ui: &mut Ui) { + let Some(report) = self.report.as_ref() else { return }; + // (white, family, variation): the rows as laid out. + let mut rows: Vec<(bool, usize, Option)> = Vec::new(); + for white in self.color.colours() { + let cr = report.color(white); + for (f, fam) in cr.families.iter().enumerate() { + rows.push((white, f, None)); + if self.open_families.contains(&(white, f)) { + for v in 0..fam.variations.len() { + rows.push((white, f, Some(v))); + } + } + } + } + if rows.is_empty() { + self.no_games_note(ui); + return; + } + let both = self.color == ColorChoice::Both; + let width = ui.available_width(); + let gap = ui.spacing().item_spacing.x; + let mut used = 200.0 + 56.0 + 40.0 + 50.0 + 4.0 * gap + if both { 90.0 + gap } else { 0.0 }; + let mut fits = |w: f32, wanted: bool| { + let ok = wanted && used + w + gap <= width; + if ok { + used += w + gap; + } + ok + }; + // The errors stay as long as possible; the first moves give way first. + let show_errors = fits(90.0, report.engine.is_some()); + let show_bar = fits(64.0, true); + let show_eco = fits(64.0, true); + let show_last = fits(84.0, true); + let show_moves = fits(160.0, true); + ui.style_mut().interaction.selectable_labels = false; + let mut table = TableBuilder::new(ui) + .id_salt("prep_openings") + .striped(true) + .sense(Sense::click()) + .auto_shrink([false, false]) + .cell_layout(egui::Layout::left_to_right(egui::Align::Center)); + if both { + table = table.column(Column::exact(90.0)); + } + table = table.column(Column::remainder().at_least(200.0).clip(true)); + if show_eco { + table = table.column(Column::exact(64.0)); + } + if show_moves { + table = table.column(Column::remainder().at_least(160.0).clip(true)); + } + table = table.column(Column::exact(56.0)).column(Column::exact(40.0)); + table = table.column(Column::exact(if show_bar { 110.0 } else { 50.0 })); + if show_last { + table = table.column(Column::exact(84.0)); + } + if show_errors { + table = table.column(Column::exact(90.0)); + } + let selected_row = rows.iter().position(|&(w, f, v)| { + self.selection == Selection::Opening { white: w, family: f, variation: v } + }); + if self.scroll_to_selected + && let Some(i) = selected_row + { + table = table.scroll_to_row(i, None); + } + self.scroll_to_selected = false; + let mut clicked = None; + let mut toggled = None; + table + .header(ROW_H, |mut h| { + if both { + head_col(&mut h, tr("Colour"), ""); + } + head_col(&mut h, tr("Opening"), ""); + if show_eco { + head_col(&mut h, "ECO", ""); + } + if show_moves { + head_col(&mut h, tr("First moves"), ""); + } + head_col(&mut h, tr("Games"), ""); + head_col(&mut h, "%", ""); + head_col(&mut h, tr("Score"), tr("The opponent's points in these games")); + if show_last { + head_col(&mut h, tr("Last"), ""); + } + if show_errors { + head_col(&mut h, tr("Errors"), ""); + } + }) + .body(|body| { + body.rows(ROW_H, rows.len(), |mut row| { + let (white, f, v) = rows[row.index()]; + row.set_selected(Some(row.index()) == selected_row); + let cr = report.color(white); + let fam = &cr.families[f]; + let colour_games = cr.games.len() as u32; + let (tally, errors, games): (&Tally, &ErrorCounts, Vec) = match v { + Some(v) => { + let var = &fam.variations[v]; + (&var.tally, &var.errors, var.games.clone()) + } + None => (&fam.tally, &fam.errors, fam.variations.iter().flat_map(|v| v.games.iter().copied()).collect()), + }; + let few = tally.games < FEW_GAMES; + if both { + row.col(|ui| { + if v.is_none() { + ui.label(RichText::new(if white { tr("♙ White") } else { tr("♟ Black") }).weak()); + } + }); + } + row.col(|ui| match v { + None => { + let open = self.open_families.contains(&(white, f)); + let glyph = if open { "▾" } else { "▸" }; + if ui.add(egui::Label::new(RichText::new(glyph).weak()).sense(Sense::click())).clicked() { + toggled = Some((white, f)); + } + let name = if fam.name.is_empty() { tr("no name").to_owned() } else { fam.name.clone() }; + ui.add(egui::Label::new(RichText::new(name).strong()).truncate()); + } + Some(v) => { + ui.add_space(18.0); + let name = fam.variations[v] + .opening + .and_then(|o| report.openings.get(o)) + .map(|o| o.variation().map_or_else(|| o.name.clone(), str::to_owned)); + match name { + Some(n) => { + ui.add(egui::Label::new(n).truncate()); + } + None => { + ui.label(RichText::new(tr("no deeper name")).weak()); + } + } + } + }); + if show_eco { + row.col(|ui| { + let eco = match v { + Some(v) => fam.variations[v].opening.and_then(|o| report.openings.get(o)).map(|o| o.eco.clone()), + None => { + let mut ecos: Vec<&str> = fam + .variations + .iter() + .filter_map(|v| v.opening.and_then(|o| report.openings.get(o))) + .map(|o| o.eco.as_str()) + .collect(); + ecos.sort_unstable(); + ecos.dedup(); + match (ecos.first(), ecos.last()) { + (Some(a), Some(b)) if a != b => Some(format!("{a}–{b}")), + (Some(a), _) => Some((*a).to_owned()), + _ => None, + } + } + }; + if let Some(e) = eco { + ui.label(RichText::new(e).weak()); + } + }); + } + if show_moves { + row.col(|ui| { + let line = match v { + Some(v) => fam.variations[v].opening.and_then(|o| report.openings.get(o)).map(|o| o.line.clone()), + None => family_line(report, fam), + }; + if let Some(l) = line { + let shown = crate::san::show_line(&shorten_middle(&l, 40)); + ui.add(egui::Label::new(RichText::new(shown).weak()).truncate()) + .on_hover_text(crate::san::show_line(&l)); + } + }); + } + row.col(|ui| { + ui.label(tally.games.to_string()); + }); + row.col(|ui| { + let of = match v { + Some(_) => fam.tally.games, + None => colour_games, + }; + let pct = 100 * tally.games / of.max(1); + let t = RichText::new(format!("{pct}")); + ui.label(if few { t.weak() } else { t }); + }); + row.col(|ui| { + let t = RichText::new(score_text(tally)); + ui.label(if few { t.weak() } else { t }).on_hover_text(tally_hint(tally)); + if show_bar { + let (rect, _) = ui.allocate_exact_size(vec2(56.0, 14.0), Sense::hover()); + board_search::results_bar(ui, rect, &bar_tally(tally, white), ui.visuals().text_color()); + } + }); + if show_last { + row.col(|ui| { + let last = games + .iter() + .map(|&g| &report.games[g as usize]) + .max_by_key(|g| g.date_number()) + .map(|g| crate::library::display_date(&g.date)) + .unwrap_or_default(); + ui.label(RichText::new(if last.is_empty() { "—".to_owned() } else { last }).weak()); + }); + } + if show_errors { + row.col(|ui| { + ui.spacing_mut().item_spacing.x = 4.0; + counts_text(ui, errors); + }); + } + let resp = row.response(); + if resp.double_clicked() && v.is_none() { + toggled = Some((white, f)); + } else if resp.clicked() { + clicked = Some((white, f, v)); + } + }); + }); + if let Some(key) = toggled { + if !self.open_families.remove(&key) { + self.open_families.insert(key); + } + } else if let Some((white, family, variation)) = clicked { + self.focus_games = false; + self.select(Selection::Opening { white, family, variation }); + } + } + + // ----- the errors ---------------------------------------------------------------- + + fn errors_tab(&mut self, ui: &mut Ui, settings: &Settings, actions: &mut Vec) { + let Some(report) = self.report.as_ref() else { return }; + let moves = self.plies.div_ceil(2); + if report.engine.is_none() && self.job.is_none() { + // The invitation (§5). + let (positions, secs) = self.estimate(settings); + let games: usize = self.color.colours().iter().map(|&w| report.color(w).games.len()).sum(); + let colour = match self.color { + ColorChoice::White => tr("as White"), + ColorChoice::Black => tr("as Black"), + ColorChoice::Both => tr("in both colours"), + }; + ui.add_space(40.0); + ui.vertical_centered(|ui| { + ui.set_max_width(520.0); + ui.label(trf( + "The engine has not searched for errors yet. It will check the first {n} moves of {games} games {colour} — {positions} positions, about {time}.", + &[ + ("n", &moves), + ("games", &games), + ("colour", &colour), + ("positions", &positions), + ("time", &review::format_duration(secs)), + ], + )); + ui.add_space(12.0); + if crate::widgets::primary(ui, tr("▶ Find opening errors")).clicked() { + self.engine_asked(settings, ui.ctx(), actions); + } + }); + return; + } + let dark = ui.visuals().dark_mode; + let (mut ask_engine, mut open_dialog) = (false, false); + // The state line and the summary per colour. + ui.horizontal_wrapped(|ui| { + match (&self.job, &report.engine) { + (Some(job), _) => { + let left = job.total.saturating_sub(job.done); + let per_thread = self.nps_per_thread.unwrap_or(review::DEFAULT_NPS); + let secs = review::estimate_secs(left, job.nodes, per_thread, job.threads); + ui.label( + RichText::new(trf( + "Checked {done} of {total} positions", + &[("done", &job.done), ("total", &job.total)], + )) + .weak(), + ); + ui.label(RichText::new(format!("· ≈ {}", review::format_duration(secs))).weak()); + } + (None, Some(e)) => { + let quality = REVIEW_QUALITY + .iter() + .find(|q| q.1 == e.nodes) + .map_or_else(|| review::format_count(e.nodes), |q| tr(q.0).to_owned()); + ui.label( + RichText::new(trf( + "Errors found · {engine} · {quality} · {n} positions", + &[("engine", &e.name), ("quality", &quality), ("n", &report.evals.len())], + )) + .weak(), + ); + let (missing, secs) = self.estimate(settings); + if missing > 0 { + ui.label(RichText::new("·").weak()); + if ui + .link(trf("Analyse {n} more positions ≈ {time}", &[("n", &missing), ("time", &review::format_duration(secs))])) + .clicked() + { + ask_engine = true; + } + } + if settings.prep.quality == 0 { + ui.label(RichText::new("·").weak()); + if ui.link(tr("More precisely…")).on_hover_text(tr("The same positions at «Normal» quality")).clicked() { + open_dialog = true; + } + } + } + (None, None) => {} + } + }); + if ask_engine { + self.engine_asked(settings, ui.ctx(), actions); + return; + } + if open_dialog { + self.dialog_open = true; + } + let Some(report) = self.report.as_ref() else { return }; + for white in self.color.colours() { + let cr = report.color(white); + let games_with: HashSet = cr.errors.iter().map(|e| e.game).collect(); + let c = &cr.counts; + let title = if white { tr("As White") } else { tr("As Black") }; + let p = 100 * games_with.len() / cr.games.len().max(1); + ui.horizontal_wrapped(|ui| { + ui.label(RichText::new(format!("{title}:")).strong()); + let text = trf( + "{i} inaccuracies · {m} mistakes · {b} blunders — in {g} games of {t} ({p} %)", + &[ + ("i", &c.inaccuracies), + ("m", &c.mistakes), + ("b", &c.blunders), + ("g", &games_with.len()), + ("t", &cr.games.len()), + ("p", &p), + ], + ); + let l = ui.label(text); + if self.job.is_some() { + l.on_hover_text(tr("of the checked positions")); + } + }); + } + let total_errors: u32 = self.color.colours().iter().map(|&w| report.color(w).counts.total()).sum(); + let serious: u32 = self + .color + .colours() + .iter() + .map(|&w| { + let c = &report.color(w).counts; + c.mistakes + c.blunders + }) + .sum(); + if self.job.is_none() && serious == 0 { + ui.add_space(8.0); + ui.horizontal_wrapped(|ui| { + ui.label(trf("No errors in the first {n} moves ({i} inaccuracies).", &[("n", &moves), ("i", &(total_errors - serious))])); + if self.plies < 30 && ui.link(trf("Deeper: {n} moves", &[("n", &15)])).clicked() { + // The depth picker's choice, as if chosen there. + self.plies = 30; + self.report = None; + self.rebuild(ui.ctx()); + actions.push(PrepAction::SettingsChanged); + } + }); + if total_errors == 0 { + return; + } + } + ui.add_space(6.0); + let both = self.color == ColorChoice::Both; + egui::ScrollArea::vertical() + .id_salt("prep_errors") + .auto_shrink([false, false]) + .show(ui, |ui| { + ui.style_mut().interaction.selectable_labels = false; + self.repeated_list(ui, both, dark, actions); + ui.add_space(10.0); + self.by_opening_list(ui, both, dark, actions); + }); + } + + /// «Repeated errors — the same position, the same move». + fn repeated_list(&mut self, ui: &mut Ui, both: bool, dark: bool, actions: &mut Vec) { + let Some(report) = self.report.as_ref() else { return }; + let mut list: Vec<(bool, usize)> = Vec::new(); + for white in self.color.colours() { + for i in 0..report.color(white).repeated.len() { + list.push((white, i)); + } + } + if both { + list.sort_by(|a, b| { + let ra = &report.color(a.0).repeated[a.1]; + let rb = &report.color(b.0).repeated[b.1]; + rb.games.len().cmp(&ra.games.len()).then(judgement_weight(rb.judgement).cmp(&judgement_weight(ra.judgement))) + }); + } + ui.label(RichText::new(tr("Repeated errors — the same position, the same move")).strong()); + if list.is_empty() { + ui.label(RichText::new(tr("None so far")).weak()); + return; + } + let width = ui.available_width(); + let show_opening = width > 700.0; + let show_score = width > 560.0; + let mut clicked = None; + let mut opened = None; + let mut toggled = None; + egui::Grid::new("prep_repeated") + .num_columns(5 + usize::from(show_score) + usize::from(show_opening) + usize::from(both)) + .striped(true) + .spacing(vec2(10.0, 4.0)) + .show(ui, |ui| { + let head = |ui: &mut Ui, t: &str| { + ui.label(RichText::new(t).strong()); + }; + head(ui, ""); + if both { + head(ui, tr("Colour")); + } + head(ui, tr("Position")); + head(ui, tr("Played")); + head(ui, tr("Better")); + head(ui, "×"); + if show_score { + head(ui, tr("Score")); + } + if show_opening { + head(ui, tr("Opening")); + } + ui.end_row(); + for &(white, i) in &list { + let cr = report.color(white); + let r = &cr.repeated[i]; + let selected = self.selection == Selection::Repeated { white, index: i }; + let open = self.open_repeated.contains(&(white, i)); + let g = &report.games[r.games[0] as usize]; + let glyph = if open { "▾" } else { "▸" }; + if ui.add(egui::Label::new(RichText::new(glyph).weak()).sense(Sense::click())).clicked() { + toggled = Some((white, i)); + } + if both { + ui.label(RichText::new(if white { tr("♙ White") } else { tr("♟ Black") }).weak()); + } + let before = (r.ply as usize) + .checked_sub(1) + .map(|p| short_label(p, &g.sans[p])) + .map_or_else(|| tr("start").to_owned(), |m| trf("after {move}", &[("move", &m)])); + let side = if r.ply.is_multiple_of(2) { tr("White to move") } else { tr("Black to move") }; + let pos_text = format!("{before} · {side}"); + let t = RichText::new(pos_text); + let resp = ui.add(egui::Label::new(if selected { t.strong() } else { t }).sense(Sense::click())); + if resp.clicked() { + clicked = Some((white, i)); + } + if resp.double_clicked() { + opened = Some((r.games[0], r.ply as usize)); + } + ui.horizontal(|ui| { + ui.spacing_mut().item_spacing.x = 4.0; + ui.label(short_label(r.ply as usize, &r.san)); + pill(ui, r.judgement).on_hover_text(review::judgement_name(r.judgement)); + }); + ui.label(short_label(r.ply as usize, &r.best_san)); + ui.label(r.times().to_string()); + if show_score { + ui.label(RichText::new(tally_hint(&r.tally)).weak()); + } + if show_opening { + let name = r.opening.and_then(|o| report.openings.get(o)).map(|o| format!("{} · {}", o.name, o.eco)).unwrap_or_default(); + ui.label(RichText::new(name).weak()); + } + ui.end_row(); + if open { + for &gi in &r.games { + let g = &report.games[gi as usize]; + let row = &self.rows[gi as usize]; + ui.label(""); + if both { + ui.label(""); + } + let text = format!("{} — {}", row.white, row.black); + let resp = ui.add(egui::Label::new(RichText::new(text).weak()).sense(Sense::click()).truncate()); + if resp.double_clicked() { + opened = Some((gi, r.ply as usize)); + } + ui.label(RichText::new(result_text(row.result)).weak()); + ui.label(RichText::new(crate::library::display_date(&g.date)).weak()); + ui.end_row(); + } + } + } + }); + let _ = dark; + let opened = opened.map(|(gi, ply)| (report.games[gi as usize].index as usize, ply)); + if let Some(k) = toggled + && !self.open_repeated.remove(&k) + { + self.open_repeated.insert(k); + } + if let Some((white, index)) = clicked { + self.focus_games = false; + self.select(Selection::Repeated { white, index }); + } + if let Some((index, ply)) = opened { + actions.push(PrepAction::OpenGame { + path: self.path.clone(), + index, + ply, + }); + } + } + + /// «By opening»: the variations with errors, the worst first, their errors by game. + fn by_opening_list(&mut self, ui: &mut Ui, both: bool, dark: bool, actions: &mut Vec) { + let Some(report) = self.report.as_ref() else { return }; + ui.label(RichText::new(tr("By opening")).strong()); + // (white, family, variation, weight) + let mut vars: Vec<(bool, usize, usize, u32)> = Vec::new(); + for white in self.color.colours() { + let cr = report.color(white); + for (f, fam) in cr.families.iter().enumerate() { + for (v, var) in fam.variations.iter().enumerate() { + if var.errors.total() == 0 { + continue; + } + let weight = var.error_list.iter().map(|&e| judgement_weight(cr.errors[e as usize].judgement)).sum(); + vars.push((white, f, v, weight)); + } + } + } + vars.sort_by_key(|v| std::cmp::Reverse(v.3)); + if vars.is_empty() { + ui.label(RichText::new(tr("None so far")).weak()); + return; + } + let mut clicked = None; + let mut opened = None; + let mut toggled = None; + for (white, f, v, _) in vars { + let cr = report.color(white); + let var = &cr.families[f].variations[v]; + let name = var + .opening + .and_then(|o| report.openings.get(o)) + .map_or_else(|| tr("no name").to_owned(), |o| format!("{} · {}", o.name, o.eco)); + let open = self.open_families.contains(&(white, f * 1000 + v + 100_000)); + ui.horizontal(|ui| { + let glyph = if open { "▾" } else { "▸" }; + if ui.add(egui::Label::new(RichText::new(glyph).weak()).sense(Sense::click())).clicked() { + toggled = Some((white, f * 1000 + v + 100_000)); + } + if both { + ui.label(RichText::new(if white { "♙" } else { "♟" }).weak()); + } + let selected = self.selection == Selection::Opening { white, family: f, variation: Some(v) }; + let t = RichText::new(name); + let resp = ui.add(egui::Label::new(if selected { t.strong() } else { t }).sense(Sense::click()).truncate()); + if resp.clicked() { + clicked = Some(Selection::Opening { white, family: f, variation: Some(v) }); + } + if resp.double_clicked() { + toggled = Some((white, f * 1000 + v + 100_000)); + } + ui.label(RichText::new(format!("· {}", crate::i18n::games(var.games.len()))).weak()); + ui.label(RichText::new("·").weak()); + ui.spacing_mut().item_spacing.x = 4.0; + counts_text(ui, &var.errors); + }); + if open { + for &ei in &var.error_list { + let e = &cr.errors[ei as usize]; + let g = &report.games[e.game as usize]; + let row = &self.rows[e.game as usize]; + let selected = self.selection == Selection::Error { white, index: ei as usize }; + ui.horizontal(|ui| { + ui.add_space(24.0); + ui.spacing_mut().item_spacing.x = 4.0; + let t = RichText::new(short_label(e.ply as usize, &e.san)); + let resp = ui.add(egui::Label::new(if selected { t.strong() } else { t }).sense(Sense::click())); + pill(ui, e.judgement).on_hover_text(format!( + "{} · {} → {}", + review::judgement_name(e.judgement), + e.before.format(), + e.after.format() + )); + ui.add_space(6.0); + ui.label(RichText::new(trf("better {best}", &[("best", &crate::san::show(&e.best_san))])).weak()); + ui.add_space(8.0); + let names = format!("{} — {}", row.white, row.black); + let r2 = ui.add(egui::Label::new(RichText::new(names).weak()).sense(Sense::click()).truncate()); + ui.label(RichText::new(result_text(row.result)).weak()); + ui.label(RichText::new(crate::library::display_date(&g.date)).weak()); + if resp.clicked() || r2.clicked() { + clicked = Some(Selection::Error { white, index: ei as usize }); + } + if resp.double_clicked() || r2.double_clicked() { + opened = Some((e.game, e.ply as usize)); + } + }); + } + } + } + let _ = dark; + let opened = opened.map(|(gi, ply)| (report.games[gi as usize].index as usize, ply)); + if let Some(k) = toggled + && !self.open_families.remove(&k) + { + self.open_families.insert(k); + } + if let Some(sel) = clicked { + self.focus_games = false; + self.select(sel); + } + if let Some((index, ply)) = opened { + actions.push(PrepAction::OpenGame { + path: self.path.clone(), + index, + ply, + }); + } + } + + // ----- the games list ------------------------------------------------------------ + + fn games_list(&mut self, ui: &mut Ui, actions: &mut Vec) { + let Some(report) = self.report.as_ref() else { return }; + let list = self.games_of(); + let title = match &self.selection { + Selection::None => trf("Games · {n}", &[("n", &list.len())]), + Selection::Node { white, node } => { + let n = &report.color(*white).tree.nodes[*node as usize]; + match n.ply { + 0 => trf("Games · {n}", &[("n", &list.len())]), + p => trf("Games · after {move} · {n}", &[("move", &short_label(usize::from(p) - 1, &n.san)), ("n", &list.len())]), + } + } + Selection::Opening { white, family, variation } => { + let fam = &report.color(*white).families[*family]; + let name = match variation { + Some(v) => fam.variations[*v].opening.and_then(|o| report.openings.get(o)).map(|o| o.name.clone()).unwrap_or_else(|| fam.name.clone()), + None => fam.name.clone(), + }; + trf("Games · {opening} · {n}", &[("opening", &name), ("n", &list.len())]) + } + Selection::Repeated { white, index } => { + let r = &report.color(*white).repeated[*index]; + trf("Games · {move} · {n}", &[("move", &format!("{} {}", short_label(r.ply as usize, &r.san), review::judgement_symbol(r.judgement))), ("n", &list.len())]) + } + Selection::Error { white, index } => { + let e = &report.color(*white).errors[*index]; + trf("Games · {move} · {n}", &[("move", &format!("{} {}", short_label(e.ply as usize, &e.san), review::judgement_symbol(e.judgement))), ("n", &list.len())]) + } + }; + let mut clear = false; + ui.horizontal(|ui| { + ui.label(RichText::new(title).strong()); + if self.selection != Selection::None + && ui.small_button("🗙").on_hover_text(tr("All games")).clicked() + { + clear = true; + } + }); + if clear { + self.select(Selection::None); + return; + } + if list.is_empty() { + return; + } + let ply = self.selection_ply(); + let width = ui.available_width(); + let show_event = width > 820.0; + let show_then = width > 600.0; + let show_date = width > 480.0; + let show_elo = width > 400.0; + let show_errors = report.engine.is_some() && width > 540.0; + let columns = 3 + 2 * usize::from(show_elo) + usize::from(show_date) + usize::from(show_then) + usize::from(show_event) + usize::from(show_errors); + let fixed = 44.0 + + if show_elo { 88.0 } else { 0.0 } + + if show_date { 84.0 } else { 0.0 } + + if show_errors { 80.0 } else { 0.0 } + + match (show_then, show_event) { + (true, true) => 150.0, + (true, false) => 100.0, + _ => 0.0, + } + + if show_event { 100.0 } else { 0.0 } + + ui.spacing().item_spacing.x * columns as f32; + let player_w = ((width - fixed) / 2.0).clamp(60.0, 170.0); + ui.style_mut().interaction.selectable_labels = false; + let mut table = TableBuilder::new(ui) + .id_salt("prep_games_table") + .striped(true) + .sense(Sense::click()) + .auto_shrink([false, false]) + .cell_layout(egui::Layout::left_to_right(egui::Align::Center)) + .column(Column::exact(player_w).clip(true)); + if show_elo { + table = table.column(Column::exact(44.0)); + } + table = table.column(Column::exact(player_w).clip(true)); + if show_elo { + table = table.column(Column::exact(44.0)); + } + table = table.column(Column::exact(44.0)); + if show_date { + table = table.column(Column::exact(84.0)); + } + if show_then && show_event { + table = table.column(Column::exact(150.0).clip(true)); + } else if show_then { + table = table.column(Column::remainder().at_least(100.0).clip(true)); + } + if show_event { + table = table.column(Column::remainder().at_least(100.0).clip(true)); + } + if show_errors { + table = table.column(Column::exact(80.0).clip(true)); + } + if self.scroll_to_selected + && let Some(c) = self.games_cursor + { + table = table.scroll_to_row(c, None); + self.scroll_to_selected = false; + } + let mut hovered = None; + let mut clicked = None; + let mut opened = None; + let mut sort_click = false; + let newest = self.newest_first; + let player_names: HashSet<&str> = self.names.iter().map(String::as_str).collect(); + table + .header(ROW_H, |mut h| { + head_col(&mut h, tr("White"), ""); + if show_elo { + head_col(&mut h, "Elo", ""); + } + head_col(&mut h, tr("Black"), ""); + if show_elo { + head_col(&mut h, "Elo", ""); + } + head_col(&mut h, tr("Res."), ""); + if show_date { + h.col(|ui| { + let arrow = if newest { " ⏷" } else { " ⏶" }; + if ui + .add(egui::Button::new(RichText::new(format!("{}{arrow}", tr("Date"))).strong()).frame(false)) + .on_hover_text(tr("Newest first")) + .clicked() + { + sort_click = true; + } + }); + } + if show_then { + h.col(|ui| { + ui.label(RichText::new(tr("Then")).strong()) + .on_hover_text(tr("How the game went on from this position")); + }); + } + if show_event { + head_col(&mut h, tr("Event"), ""); + } + if show_errors { + head_col(&mut h, tr("Errors"), tr("His marked moves in the opening of this game")); + } + }) + .body(|body| { + body.rows(ROW_H, list.len(), |mut row| { + let gi = list[row.index()]; + let g = &report.games[gi as usize]; + let r = &self.rows[gi as usize]; + row.set_selected(self.games_cursor == Some(row.index())); + let name = |ui: &mut Ui, n: &str| { + let t = RichText::new(n); + ui.add(egui::Label::new(if player_names.contains(n) { t.strong() } else { t }).truncate()); + }; + let elo = |e: u16| if e > 0 { e.to_string() } else { String::new() }; + row.col(|ui| name(ui, &r.white)); + if show_elo { + row.col(|ui| { + ui.label(RichText::new(elo(r.white_elo)).weak()); + }); + } + row.col(|ui| name(ui, &r.black)); + if show_elo { + row.col(|ui| { + ui.label(RichText::new(elo(r.black_elo)).weak()); + }); + } + row.col(|ui| { + ui.label(result_text(r.result)); + }); + if show_date { + row.col(|ui| { + ui.label(RichText::new(crate::library::display_date(&g.date)).weak()); + }); + } + if show_then { + row.col(|ui| { + let then: Vec = g.sans.iter().skip(ply).take(3).cloned().collect(); + let mut text = String::new(); + for (k, san) in then.iter().enumerate() { + let p = ply + k; + if k == 0 || p.is_multiple_of(2) { + text.push_str(&short_label(p, san)); + } else { + text.push_str(san); + } + text.push(' '); + } + ui.add(egui::Label::new(crate::san::show_line(text.trim_end())).truncate()); + }); + } + if show_event { + row.col(|ui| { + ui.add(egui::Label::new(RichText::new(&r.event).italics().weak()).truncate()); + }); + } + if show_errors { + row.col(|ui| { + ui.spacing_mut().item_spacing.x = 3.0; + let cr = report.color(g.white); + for e in cr.errors.iter().filter(|e| e.game == gi) { + let number = e.ply as usize / 2 + 1; + ui.label(RichText::new(format!("{number}.")).small()); + pill(ui, e.judgement).on_hover_text(format!( + "{} {} — {}", + short_label(e.ply as usize, &e.san), + review::judgement_name(e.judgement), + trf("better {best}", &[("best", &crate::san::show(&e.best_san))]) + )); + } + }); + } + let resp = row.response().on_hover_text(tr("Double click: open this game at this position")); + if resp.hovered() { + hovered = Some(gi); + } + if resp.double_clicked() { + opened = Some(gi); + } else if resp.clicked() { + clicked = Some(row.index()); + } + }); + }); + if sort_click { + self.newest_first = !self.newest_first; + } + // The game's move from the shown position, as an arrow. + if let Some(gi) = hovered + && let Some(s) = &self.shown_pos + && s.ply + 1 == s.positions.len() + { + let g = &report.games[gi as usize]; + if let Some(m) = g.ucis.get(ply).and_then(|u| u.parse::().ok()).and_then(|u| u.to_move(&s.positions[s.ply]).ok()) { + self.hover_arrow = m.from().map(|f| (f, crate::board::ui_target(&m))); + } + } + if let Some(i) = clicked { + self.games_cursor = Some(i); + self.focus_games = true; + } + if let Some(gi) = opened { + actions.push(PrepAction::OpenGame { + path: self.path.clone(), + index: report.games[gi as usize].index as usize, + ply, + }); + } + } + + // ----- the keyboard -------------------------------------------------------------- + + fn keyboard(&mut self, ctx: &egui::Context, settings: &Settings, actions: &mut Vec) { + let ctrl = |k| KeyboardShortcut::new(Modifiers::COMMAND, k); + let alt = |k| KeyboardShortcut::new(Modifiers::ALT, k); + if ctx.input_mut(|i| i.consume_shortcut(&ctrl(Key::Num1))) { + self.tab = Tab::Repertoire; + } + if ctx.input_mut(|i| i.consume_shortcut(&ctrl(Key::Num2))) { + self.tab = Tab::Openings; + } + if ctx.input_mut(|i| i.consume_shortcut(&ctrl(Key::Num3))) { + self.tab = Tab::Errors; + } + if ctx.input_mut(|i| i.consume_shortcut(&alt(Key::Num1))) { + self.color = ColorChoice::White; + } + if ctx.input_mut(|i| i.consume_shortcut(&alt(Key::Num2))) { + self.color = ColorChoice::Black; + } + if ctx.input_mut(|i| i.consume_shortcut(&alt(Key::Num3))) { + self.color = ColorChoice::Both; + } + if ctx.input_mut(|i| i.consume_shortcut(&ctrl(Key::W))) { + actions.push(PrepAction::Back); + } + if ctx.input_mut(|i| i.consume_key(Modifiers::NONE, Key::F)) { + let base = self.shown_pos.as_ref().map_or(self.color != ColorChoice::Black, |s| s.white); + self.flipped = Some(!self.board_white() == base); + } + if ctx.input_mut(|i| i.consume_key(Modifiers::SHIFT, Key::A)) { + if self.job.is_some() { + self.stop_engine(actions); + } else if self.report.is_some() { + self.engine_asked(settings, ctx, actions); + } + } + if ctx.input_mut(|i| i.consume_shortcut(&KeyboardShortcut::new(Modifiers::COMMAND | Modifiers::SHIFT, Key::F))) + && let Some(s) = &self.shown_pos + { + let mut p = Chess::default(); + let moves: Vec = s.ucis[..s.ply] + .iter() + .filter_map(|u| { + let m = u.parse::().ok()?.to_move(&p).ok()?; + p.play_unchecked(m); + Some(m) + }) + .collect(); + actions.push(PrepAction::FindPosition(self.path.clone(), Chess::default(), moves, !self.board_white())); + } + if ctx.input_mut(|i| i.consume_key(Modifiers::NONE, Key::Escape)) { + if self.board_popup { + self.board_popup = false; + } else if self.selection != Selection::None { + self.select(Selection::None); + } else { + actions.push(PrepAction::Back); + } + } + if ctx.input_mut(|i| i.consume_key(Modifiers::NONE, Key::Tab)) { + self.focus_games = !self.focus_games; + if self.focus_games && self.games_cursor.is_none() { + self.games_cursor = Some(0); + } + } + let (up, down, left, right, enter, space, home, end) = ctx.input_mut(|i| { + ( + i.consume_key(Modifiers::NONE, Key::ArrowUp), + i.consume_key(Modifiers::NONE, Key::ArrowDown), + i.consume_key(Modifiers::NONE, Key::ArrowLeft), + i.consume_key(Modifiers::NONE, Key::ArrowRight), + i.consume_key(Modifiers::NONE, Key::Enter), + i.consume_key(Modifiers::NONE, Key::Space), + i.consume_key(Modifiers::NONE, Key::Home), + i.consume_key(Modifiers::NONE, Key::End), + ) + }); + if !(up || down || left || right || enter || space || home || end) { + return; + } + if self.focus_games { + let list = self.games_of(); + if list.is_empty() { + return; + } + let cur = self.games_cursor.unwrap_or(0); + let next = if up { + cur.saturating_sub(1) + } else if down { + (cur + 1).min(list.len() - 1) + } else if home { + 0 + } else if end { + list.len() - 1 + } else { + cur + }; + if next != cur || self.games_cursor.is_none() { + self.games_cursor = Some(next); + self.scroll_to_selected = true; + } + if enter + && let Some(r) = &self.report + { + actions.push(PrepAction::OpenGame { + path: self.path.clone(), + index: r.games[list[next] as usize].index as usize, + ply: self.selection_ply(), + }); + } + return; + } + match self.tab { + Tab::Repertoire => self.tree_keys(up, down, left, right, enter, space, home, end), + Tab::Openings => self.openings_keys(up, down, left, right, enter, space, home, end), + Tab::Errors => { + if enter && let Some(r) = &self.report { + let open = match &self.selection { + Selection::Repeated { white, index } => { + let rep = &r.color(*white).repeated[*index]; + Some((rep.games[0], rep.ply as usize)) + } + Selection::Error { white, index } => { + let e = &r.color(*white).errors[*index]; + Some((e.game, e.ply as usize)) + } + _ => None, + }; + if let Some((gi, ply)) = open { + actions.push(PrepAction::OpenGame { + path: self.path.clone(), + index: r.games[gi as usize].index as usize, + ply, + }); + } + } + } + } + } + + #[allow(clippy::too_many_arguments)] + fn tree_keys(&mut self, up: bool, down: bool, left: bool, right: bool, enter: bool, space: bool, home: bool, end: bool) { + let rows = self.tree_rows(); + if rows.is_empty() { + return; + } + let at = rows.iter().position(|r| match (r, &self.selection) { + (TreeRow::Node { white, node, .. }, Selection::Node { white: sw, node: sn }) => white == sw && node == sn, + _ => false, + }); + let go = |screen: &mut Self, i: usize| { + if let Some(TreeRow::Node { white, node, .. }) = rows.get(i).copied() { + screen.select(Selection::Node { white, node }); + screen.scroll_to_selected = true; + } + }; + let Some(at) = at else { + if up || down || home || end || right { + go(self, 0); + } + return; + }; + let Some(TreeRow::Node { white, node, .. }) = rows.get(at).copied() else { + return; + }; + let has_children = self + .report + .as_ref() + .is_some_and(|r| !r.color(white).tree.nodes[node as usize].children.is_empty()); + let open = self.expanded.contains(&(white, node)); + if down { + let mut next = at + 1; + while next < rows.len() && matches!(rows[next], TreeRow::Others { .. }) { + next += 1; + } + if next < rows.len() { + go(self, next); + } + } else if up { + let mut prev = at; + while prev > 0 { + prev -= 1; + if matches!(rows[prev], TreeRow::Node { .. }) { + go(self, prev); + break; + } + } + } else if home { + go(self, 0); + } else if end { + let last = rows.iter().rposition(|r| matches!(r, TreeRow::Node { .. })).unwrap_or(0); + go(self, last); + } else if right { + if has_children && !open { + self.expanded.insert((white, node)); + } else if has_children { + go(self, at + 1); + } + } else if left { + if open { + self.expanded.remove(&(white, node)); + } else if let Some(p) = self.report.as_ref().and_then(|r| r.color(white).tree.nodes[node as usize].parent) { + self.select(Selection::Node { white, node: p }); + self.scroll_to_selected = true; + } + } else if space { + if has_children && !self.expanded.remove(&(white, node)) { + self.expanded.insert((white, node)); + } + } else if enter { + self.focus_games = true; + self.games_cursor = Some(0); + } + } + + #[allow(clippy::too_many_arguments)] + fn openings_keys(&mut self, up: bool, down: bool, left: bool, right: bool, enter: bool, space: bool, home: bool, end: bool) { + let Some(report) = &self.report else { return }; + let mut rows: Vec<(bool, usize, Option)> = Vec::new(); + for white in self.color.colours() { + let cr = report.color(white); + for (f, fam) in cr.families.iter().enumerate() { + rows.push((white, f, None)); + if self.open_families.contains(&(white, f)) { + for v in 0..fam.variations.len() { + rows.push((white, f, Some(v))); + } + } + } + } + if rows.is_empty() { + return; + } + let at = rows.iter().position(|&(w, f, v)| self.selection == Selection::Opening { white: w, family: f, variation: v }); + let go = |screen: &mut Self, i: usize| { + if let Some(&(white, family, variation)) = rows.get(i) { + screen.select(Selection::Opening { white, family, variation }); + screen.scroll_to_selected = true; + } + }; + let Some(at) = at else { + if up || down || home || end || right { + go(self, 0); + } + return; + }; + let (white, f, v) = rows[at]; + if down { + go(self, (at + 1).min(rows.len() - 1)); + } else if up { + go(self, at.saturating_sub(1)); + } else if home { + go(self, 0); + } else if end { + go(self, rows.len() - 1); + } else if right || space { + if v.is_none() && !self.open_families.remove(&(white, f)) { + self.open_families.insert((white, f)); + } + } else if left { + if v.is_some() { + go(self, rows.iter().position(|&(w, ff, vv)| w == white && ff == f && vv.is_none()).unwrap_or(at)); + } else { + self.open_families.remove(&(white, f)); + } + } else if enter { + self.focus_games = true; + self.games_cursor = Some(0); + } + } +} + +/// The arrows of an error: the move played in the colour of its sign, the better move +/// in green. +fn error_arrows(pos: &Chess, played: &str, best: Option<&str>, j: Judgement) -> Vec { + let mut out = Vec::new(); + let to_arrow = |u: &str, color: Color32| -> Option { + let m = u.parse::().ok()?.to_move(pos).ok()?; + Some(Arrow { + from: m.from()?, + to: crate::board::ui_target(&m), + color, + weight: 1.0, + }) + }; + if let Some(a) = to_arrow(played, review::judgement_color(j).gamma_multiply(0.85)) { + out.push(a); + } + if let Some(a) = best.and_then(|b| to_arrow(b, crate::board::shape_preview_color(chess_core::ShapeColor::Green))) { + out.push(a); + } + out +} + +/// «6…Nb6 ? — better 6…e6 · 0.0 → −1.2». +fn error_note(e: &prep::OpeningError) -> String { + let played = format!("{} {}", short_label(e.ply as usize, &e.san), review::judgement_symbol(e.judgement)); + trf( + "{played} — better {best} · {before} → {after}", + &[ + ("played", &played), + ("best", &short_label(e.ply as usize, &e.best_san)), + ("before", &e.before.format()), + ("after", &e.after.format()), + ], + ) +} + +/// The table's line to the family's own position: the shallowest position of the +/// family's games whose name is of the family ("1. e4 c5" for the Sicilian, whatever +/// the variations); the shortest variation's line when there is none. +fn family_line(report: &PrepReport, fam: &prep::Family) -> Option { + let mut best: Option<&'static prep::Opening> = None; + for v in &fam.variations { + for &gi in &v.games { + let g = &report.games[gi as usize]; + for &k in &g.keys { + let Some(o) = prep::openings::by_position(k).map(prep::openings::get) else { + continue; + }; + if o.family() == fam.name && best.is_none_or(|b| o.plies < b.plies) { + best = Some(o); + } + } + } + } + best.map(|o| o.line.clone()).or_else(|| { + fam.variations + .iter() + .filter_map(|v| v.opening.and_then(|o| report.openings.get(o))) + .min_by_key(|o| o.plies) + .map(|o| o.line.clone()) + }) +} + +/// The ply of the first position of a game's line named with `family`. +fn family_ply(g: &GameInfo, family: &str) -> Option { + (0..g.keys.len()).find(|&i| { + prep::openings::by_position(g.keys[i]) + .map(prep::openings::get) + .is_some_and(|o| o.family() == family) + }) +} + +/// A header cell: the title in bold, a tooltip when there is one. +fn head_col(h: &mut egui_extras::TableRow<'_, '_>, text: &str, hint: &str) { + h.col(|ui| { + let l = ui.label(RichText::new(text).strong()); + if !hint.is_empty() { + l.on_hover_text(hint); + } + }); +} + +fn result_text(r: &str) -> &str { + if r == "1/2-1/2" { "½-½" } else { r } +} + +fn text_width(ui: &Ui, text: &str, style: egui::TextStyle) -> f32 { + let font = style.resolve(ui.style()); + ui.painter() + .layout_no_wrap(text.to_owned(), font, Color32::WHITE) + .size() + .x +} + +#[cfg(test)] +mod tests { + use super::*; + + fn c(id: u32, name: &str) -> Candidate { + Candidate { + id, + name: name.to_owned(), + games: 1, + } + } + + #[test] + fn candidates_split_into_whole_words_and_similar_names() { + let list = vec![ + c(1, "Вафин Радель"), + c(2, "Vafin, Radel"), + c(3, "Вафина Раяна"), + c(4, "Вафин Р."), + ]; + let (exact, similar) = split_candidates("Вафин", list.clone()); + assert_eq!(exact.iter().map(|c| c.id).collect::>(), vec![1, 4]); + assert_eq!(similar.iter().map(|c| c.id).collect::>(), vec![2, 3]); + // An initial matches the beginning of a word; the full stop is ignored. + let (exact, _) = split_candidates("Вафин Р.", list.clone()); + assert_eq!(exact.iter().map(|c| c.id).collect::>(), vec![1, 4]); + let (exact, similar) = split_candidates("вафин радель", list.clone()); + assert_eq!(exact.iter().map(|c| c.id).collect::>(), vec![1]); + assert_eq!(similar.len(), 3); + // Commas and case do not matter. + let (exact, _) = split_candidates("radel vafin", list); + assert_eq!(exact.iter().map(|c| c.id).collect::>(), vec![2]); + } + + #[test] + fn labels_and_lines() { + assert_eq!(short_label(0, "e4"), "1.e4"); + assert_eq!(short_label(1, "c5"), "1…c5"); + assert_eq!(short_label(4, "Bb5"), "3.Bb5"); + let sans: Vec = ["e4", "c5", "Nf3"].iter().map(|s| (*s).to_owned()).collect(); + assert_eq!(line_text(&sans), "1.e4 c5 2.Nf3"); + assert_eq!(shorten_middle("1. e4 c5 2. Nf3", 100), "1. e4 c5 2. Nf3"); + assert_eq!(shorten_middle("abcdefghij", 7), "abc…hij"); + let ucis: Vec = ["e2e4", "c7c5", "g1f3"].iter().map(|s| (*s).to_owned()).collect(); + assert_eq!(replay(&ucis).len(), 4); + assert_eq!(replay(&["zz".to_owned()]).len(), 1); + } + + #[test] + fn the_period_of_the_games() { + use prep::Outcome; + let game = |date: &str| GameInfo { + index: 0, + white: true, + opponent: String::new(), + opponent_elo: 0, + date: date.to_owned(), + outcome: Outcome::Unknown, + ucis: Vec::new(), + sans: Vec::new(), + keys: Vec::new(), + opening: None, + named: None, + book: None, + }; + assert_eq!(period(&[game("2026.10.18"), game("2026.01.03"), game("")]), "01.2026 – 10.2026"); + assert_eq!(period(&[game("2026.10.18")]), "10.2026"); + assert_eq!(period(&[game("")]), ""); + } + + #[test] + fn book_choice_from_the_setting() { + let own = Path::new("/a/own.pgn"); + let dbs = vec![ + RefDb { + path: PathBuf::from("/a/own.pgn"), + name: "own".into(), + db: None, + failed: None, + bytes: 500, + }, + RefDb { + path: PathBuf::from("/a/mega.cbh"), + name: "mega".into(), + db: None, + failed: None, + bytes: 5000, + }, + RefDb { + path: PathBuf::from("/a/small.pgn"), + name: "small".into(), + db: None, + failed: None, + bytes: 10, + }, + ]; + assert_eq!(BookChoice::from_setting(None, own, &dbs), BookChoice::Database(PathBuf::from("/a/mega.cbh"))); + assert_eq!(BookChoice::from_setting(Some(Path::new("")), own, &dbs), BookChoice::None); + assert_eq!(BookChoice::from_setting(Some(own), own, &dbs), BookChoice::Same); + assert_eq!( + BookChoice::from_setting(Some(Path::new("/a/small.pgn")), own, &dbs), + BookChoice::Database(PathBuf::from("/a/small.pgn")) + ); + // A database no longer on the shelf: the default again. + assert_eq!(BookChoice::from_setting(Some(Path::new("/gone.pgn")), own, &dbs), BookChoice::Database(PathBuf::from("/a/mega.cbh"))); + assert_eq!(BookChoice::Same.setting(own), own); + assert_eq!(BookChoice::None.setting(own), PathBuf::new()); + } +} diff --git a/apps/desktop/src/review.rs b/apps/desktop/src/review.rs index 7927bf7..61c3246 100644 --- a/apps/desktop/src/review.rs +++ b/apps/desktop/src/review.rs @@ -719,79 +719,26 @@ impl Review { .weak(), ); ui.add_space(8.0); - ui.horizontal(|ui| { - ui.label(tr("Engine")); - let current = settings - .active_engine() - .map(|e| e.name.clone()) - .unwrap_or_else(|| tr("not selected").into()); - egui::ComboBox::from_id_salt("review_engine") - .selected_text(current) - .width(ui.available_width() - 8.0) - .show_ui(ui, |ui| { - for i in 0..settings.engines.len() { - let selected = settings.active_engine == Some(i); - if ui - .selectable_label(selected, &settings.engines[i].name) - .clicked() - && !selected - { - settings.active_engine = Some(i); - action = Some(DialogAction::EngineSwitch); - } - } - ui.separator(); - if ui.button(tr("Add or edit engines…")).clicked() { - action = Some(DialogAction::OpenEngines); - } - }); - }); + if let Some(a) = engine_picker(ui, settings, "review_engine") { + action = Some(a); + } ui.add_space(4.0); let rs = &mut settings.review; - let cores = std::thread::available_parallelism() - .map(|n| n.get() as u32) - .unwrap_or(1); - let hash_steps = crate::game_view::hash_steps(); - ui.spacing_mut().slider_width = 200.0; - egui::Grid::new("review_grid") - .num_columns(3) - .spacing(vec2(12.0, 8.0)) - .show(ui, |ui| { - ui.label(tr("Quality")); - let mut q = rs.quality.min(REVIEW_QUALITY.len() - 1); - crate::game_view::index_slider(ui, &mut q, REVIEW_QUALITY.len()); - rs.quality = q; - ui.label(trf( - "{quality} · {nodes} nodes", - &[ - ("quality", &tr(REVIEW_QUALITY[q].0)), - ("nodes", &format_count(REVIEW_QUALITY[q].1)), - ], - )); - ui.end_row(); - - ui.label(tr("Threads")); - let mut th = rs.threads.clamp(1, cores) as usize - 1; - crate::game_view::index_slider(ui, &mut th, cores as usize); - rs.threads = th as u32 + 1; - ui.label(format!("{} / {cores}", rs.threads)); - ui.end_row(); - - ui.label(tr("Memory")); - let mut h = hash_steps - .iter() - .position(|m| *m >= rs.hash_mb) - .unwrap_or(hash_steps.len() - 1); - crate::game_view::index_slider(ui, &mut h, hash_steps.len()); - rs.hash_mb = hash_steps[h]; - ui.label(crate::game_view::format_mb(rs.hash_mb)); - ui.end_row(); - }); + let mut quality = rs.quality; + options_grid( + ui, + "review_grid", + &mut quality, + &mut rs.threads, + &mut rs.hash_mb, + None, + ); + rs.quality = quality; ui.add_space(6.0); let positions = self.analysis.positions(); - let per_thread = self.nps_per_thread.unwrap_or(700_000.0); + let per_thread = self.nps_per_thread.unwrap_or(DEFAULT_NPS); let searches = self.analysis.searches(); - let secs = searches as f64 * rs.nodes() as f64 / (per_thread * f64::from(rs.threads)); + let secs = estimate_secs(searches, rs.nodes(), per_thread, rs.threads); ui.label(trf( "{n} positions, about {time}", &[("n", &positions), ("time", &format_duration(secs))], @@ -841,6 +788,102 @@ impl Drop for Review { } } +/// Nodes per second and thread assumed until an engine was measured. +pub const DEFAULT_NPS: f64 = 700_000.0; + +/// Seconds `searches` of `nodes` take at `per_thread` nodes per second on `threads`. +pub fn estimate_secs(searches: usize, nodes: u64, per_thread: f64, threads: u32) -> f64 { + searches as f64 * nodes as f64 / (per_thread * f64::from(threads.max(1))) +} + +/// The «Engine» row of a launch dialog: the active engine, the others to switch to, +/// «Add or edit engines…». +pub fn engine_picker(ui: &mut Ui, settings: &mut Settings, id: &str) -> Option { + let mut action = None; + ui.horizontal(|ui| { + ui.label(tr("Engine")); + let current = settings + .active_engine() + .map(|e| e.name.clone()) + .unwrap_or_else(|| tr("not selected").into()); + egui::ComboBox::from_id_salt(id) + .selected_text(current) + .width(ui.available_width() - 8.0) + .show_ui(ui, |ui| { + for i in 0..settings.engines.len() { + let selected = settings.active_engine == Some(i); + if ui + .selectable_label(selected, &settings.engines[i].name) + .clicked() + && !selected + { + settings.active_engine = Some(i); + action = Some(DialogAction::EngineSwitch); + } + } + ui.separator(); + if ui.button(tr("Add or edit engines…")).clicked() { + action = Some(DialogAction::OpenEngines); + } + }); + }); + action +} + +/// The «Quality · Threads · Memory» grid of a launch dialog; `quality` indexes +/// [`REVIEW_QUALITY`]. `quality_hint`: a tooltip on the quality slider. +pub fn options_grid( + ui: &mut Ui, + id: &str, + quality: &mut usize, + threads: &mut u32, + hash_mb: &mut u32, + quality_hint: Option<&str>, +) { + let cores = std::thread::available_parallelism() + .map(|n| n.get() as u32) + .unwrap_or(1); + let hash_steps = crate::game_view::hash_steps(); + ui.spacing_mut().slider_width = 200.0; + egui::Grid::new(id) + .num_columns(3) + .spacing(vec2(12.0, 8.0)) + .show(ui, |ui| { + ui.label(tr("Quality")); + let mut q = (*quality).min(REVIEW_QUALITY.len() - 1); + crate::game_view::index_slider(ui, &mut q, REVIEW_QUALITY.len()); + *quality = q; + let label = ui.label(trf( + "{quality} · {nodes} nodes", + &[ + ("quality", &tr(REVIEW_QUALITY[q].0)), + ("nodes", &format_count(REVIEW_QUALITY[q].1)), + ], + )); + if let Some(hint) = quality_hint { + label.on_hover_text(hint); + } + ui.end_row(); + + ui.label(tr("Threads")); + let mut th = (*threads).clamp(1, cores) as usize - 1; + crate::game_view::index_slider(ui, &mut th, cores as usize); + *threads = th as u32 + 1; + ui.label(format!("{} / {cores}", *threads)); + ui.end_row(); + + ui.label(tr("Memory")); + let mut h = hash_steps + .iter() + .position(|m| *m >= *hash_mb) + .unwrap_or(hash_steps.len() - 1); + crate::game_view::index_slider(ui, &mut h, hash_steps.len()); + *hash_mb = hash_steps[h]; + ui.label(crate::game_view::format_mb(*hash_mb)); + ui.end_row(); + }); +} + /// Removes `[%eval …]` commands from a comment. fn strip_eval(c: &str) -> String { let mut out = String::new(); @@ -929,7 +972,7 @@ fn percent(a: f64) -> String { } /// 250 000 → "250k", 1 000 000 → "1M". -fn format_count(n: u64) -> String { +pub fn format_count(n: u64) -> String { if n >= 1_000_000 && n.is_multiple_of(100_000) { let m = n as f64 / 1e6; if n.is_multiple_of(1_000_000) { @@ -944,7 +987,7 @@ fn format_count(n: u64) -> String { } } -fn format_duration(secs: f64) -> String { +pub fn format_duration(secs: f64) -> String { let s = secs.ceil().max(1.0) as u64; if s < 60 { trf("{n} s", &[("n", &s)]) diff --git a/apps/desktop/src/settings.rs b/apps/desktop/src/settings.rs index 40493b3..b57d7df 100644 --- a/apps/desktop/src/settings.rs +++ b/apps/desktop/src/settings.rs @@ -149,6 +149,42 @@ pub struct Settings { pub record_games: bool, /// Who played on this computer, the last first (`player_games.rs`). pub players: Vec, + /// Preparing against an opponent (docs/design/opponent-prep.md). + pub prep: PrepSettings, +} + +/// Options of the opponent preparation; threads and memory are the game analysis's. +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(default)] +pub struct PrepSettings { + /// Index into [`REVIEW_QUALITY`]; «Fast» is enough for opening errors. + pub quality: usize, + /// The book (`None`: the largest database on the shelf; `Some("")`: no book). + pub book: Option, + /// Plies of the opening the report looks at. + pub plies: usize, + /// Moves with fewer games fold into «other moves». + pub branches_from: u32, + /// The engine was started from the dialog once: the button starts it at once. + pub chosen: bool, +} + +impl Default for PrepSettings { + fn default() -> Self { + Self { + quality: 0, + book: None, + plies: 20, + branches_from: 3, + chosen: false, + } + } +} + +impl PrepSettings { + pub fn nodes(&self) -> u64 { + REVIEW_QUALITY[self.quality.min(REVIEW_QUALITY.len() - 1)].1 + } } /// Options of the whole-game analysis (the engine is the active one). @@ -233,6 +269,7 @@ impl Default for Settings { players: Vec::new(), rating: None, play: Default::default(), + prep: PrepSettings::default(), } } } diff --git a/crates/prep/src/book.rs b/crates/prep/src/book.rs index f2283a4..1b64a33 100644 --- a/crates/prep/src/book.rs +++ b/crates/prep/src/book.rs @@ -38,15 +38,16 @@ impl Default for BookOptions { } /// Fills in [`GameInfo::book`] of every game; `progress` counts the games done. -/// Returns how many games left the book within their line. `None` when cancelled -/// (or when the book cannot be searched: a PGN book without memory for its table). +/// Returns how many games left the book within their line, and the book's count of +/// every position looked at (by key). `None` when cancelled (or when the book cannot +/// be searched: a PGN book without memory for its table). pub(crate) fn find_exits( games: &mut [GameInfo], book: &Database, options: &BookOptions, progress: &AtomicUsize, cancel: &AtomicBool, -) -> Option { +) -> Option<(u32, HashMap)> { let exclude: HashSet = if options.same_database { games.iter().map(|g| g.index).collect() } else { @@ -98,5 +99,5 @@ pub(crate) fn find_exits( } }); } - Some(left) + Some((left, counts)) } diff --git a/crates/prep/src/lib.rs b/crates/prep/src/lib.rs index 22e278e..99a1869 100644 --- a/crates/prep/src/lib.rs +++ b/crates/prep/src/lib.rs @@ -138,7 +138,7 @@ pub struct BookInfo { pub left: u32, } -const REPORT_VERSION: u32 = 1; +const REPORT_VERSION: u32 = 2; /// Everything the preparation knows about the player. #[derive(Clone, Debug, Serialize, Deserialize)] @@ -160,6 +160,10 @@ pub struct PrepReport { pub white: ColorReport, pub black: ColorReport, pub book: Option, + /// The book's number of games in every position the book step looked at (by + /// key): the first plies of every line, then the positions around each exit. + #[serde(default)] + pub book_counts: HashMap, pub engine: Option, /// Engine evaluations by position key. pub evals: HashMap, @@ -263,6 +267,7 @@ pub fn build( white, black, book: None, + book_counts: HashMap::new(), engine: None, evals, }; @@ -356,13 +361,14 @@ impl PrepReport { cancel: &AtomicBool, ) -> Option<()> { let mut games = self.games.clone(); - let left = book::find_exits(&mut games, book, options, progress, cancel)?; + let (left, counts) = book::find_exits(&mut games, book, options, progress, cancel)?; self.games = games; self.book = Some(BookInfo { fingerprint: fingerprint(book), threshold: options.threshold, left, }); + self.book_counts = counts; Some(()) } @@ -371,9 +377,17 @@ impl PrepReport { /// Every distinct position of the lines (the one after the last move included), /// first met first; those without legal moves left out. fn positions(&self) -> Vec<(u64, &GameInfo, usize)> { + self.positions_for(Side::Any) + } + + /// [`PrepReport::positions`] of the games the player had `side` in. + fn positions_for(&self, side: Side) -> Vec<(u64, &GameInfo, usize)> { let mut seen = std::collections::HashSet::new(); let mut out = Vec::new(); for g in &self.games { + if (side == Side::White && !g.white) || (side == Side::Black && g.white) { + continue; + } for (i, &k) in g.keys.iter().enumerate() { if self.evals.get(&k).is_some_and(|e| e.nodes == EXACT) { continue; @@ -391,9 +405,19 @@ impl PrepReport { self.positions().len() } + /// Distinct positions of the games the player had `side` in. + pub fn distinct_positions_for(&self, side: Side) -> usize { + self.positions_for(side).len() + } + /// Positions without an evaluation of at least `nodes`. pub fn missing(&self, nodes: u64) -> usize { - self.positions() + self.missing_for(nodes, Side::Any) + } + + /// [`PrepReport::missing`] among the games the player had `side` in. + pub fn missing_for(&self, nodes: u64, side: Side) -> usize { + self.positions_for(side) .iter() .filter(|(k, _, _)| !self.evals.get(k).is_some_and(|e| e.nodes >= nodes)) .count() @@ -423,7 +447,13 @@ impl PrepReport { /// search each, no second search for !! and !). Their keys are the position keys /// in hexadecimal, as [`PrepReport::apply`] reads them. pub fn targets(&self, nodes: u64) -> Vec { - self.positions() + self.targets_for(nodes, Side::Any) + } + + /// [`PrepReport::targets`] of the games the player had `side` in (the dialog's + /// «Black — 133 games» halves the work). + pub fn targets_for(&self, nodes: u64, side: Side) -> Vec { + self.positions_for(side) .into_iter() .filter(|(k, _, _)| !self.evals.get(k).is_some_and(|e| e.nodes >= nodes)) .map(|(k, g, i)| Target { @@ -794,6 +824,12 @@ mod tests { assert_eq!(exits[3].map(|b| (b.ply, b.by_player)), Some((1, true)), "1.d4 is his own"); assert_eq!(report.book.as_ref().map(|b| (b.threshold, b.left)), Some((2, 4))); assert_eq!(report.white.book_exits(&report.games), (1, 2)); + // The counts of the positions looked at: the start (4 games), 1.e4 c5 2.Nf3 + // (3), the rare 3...g6 (1). + let g = &report.games[0]; + assert_eq!(report.book_counts.get(&g.keys[0]), Some(&4)); + assert_eq!(report.book_counts.get(&g.keys[3]), Some(&3)); + assert_eq!(report.book_counts.get(&g.keys[6]), Some(&1)); // The player's own games excluded: everything is out of the book at once. let own = BookOptions { threshold: 1, @@ -820,6 +856,12 @@ mod tests { assert_eq!(total, 27 - 10); let targets = report.targets(1000); assert_eq!(targets.len(), total); + // One colour: the positions of its games only (the start position is in both). + let black = report.targets_for(1000, Side::Black); + assert_eq!(black.len(), report.games[1].keys.len()); + assert_eq!(report.distinct_positions_for(Side::Black), black.len()); + assert!(report.distinct_positions_for(Side::White) < total); + assert_eq!(report.missing_for(1000, Side::Black), black.len()); assert_eq!(targets[0].key, format!("{:016x}", report.games[0].keys[0])); assert!(targets[0].pos.moves.is_empty()); assert_eq!(targets[3].pos.moves, vec!["e2e4", "c7c5", "g1f3"]); diff --git a/docs/dev/desktop.md b/docs/dev/desktop.md index e693cbb..a93057c 100644 --- a/docs/dev/desktop.md +++ b/docs/dev/desktop.md @@ -51,7 +51,7 @@ XDG_CONFIG_HOME=/tmp/cfg CP_OPEN=11 CP_PLY=3 CP_ANALYZE=1 ./target/debug/chesspe ``` `CP_OPEN` — индекс партии (с 0) в первой базе списка, `CP_PLY` — шагов по основной линии, -`CP_ONLINE=<ник>` (или `<ник Lichess>,<ник Chess.com>`) — открыть окно онлайн-партий и найти ник (`CP_ONLINE_DOWNLOAD=1` — сразу скачать). `CP_UPDATE_CHECK=<адрес>` — спрашивать о выпуске этот сайт вместо chess.vrubel.xyz/api/update (локальный, чтобы проверить счёт установок). `CP_UPDATE_SOURCE=<папка>` — брать «последний выпуск» из `latest.json` и файлов этой папки вместо GitHub, `CP_UPDATE_KIND=deb|rpm|arch|aur|flatpak|appimage|tarball|windows|mac` — считать установку такой, `CP_UPDATE_OPEN=1` — открыть окно обновления (`=start` — сразу начать), `CP_TAB=reference` — открыть у партии вкладку «Справочник», `CP_ANALYZE` — запустить активный движок, `CP_SETTINGS` — открыть настройки (`=board`, `=about`, `=translation` — сразу эту вкладку), `CP_TRANSLATE_SETUP=1` — окно «Как переводить?» (`=key` — с выбранным ключом API), `CP_ENGINE_PANEL` — раскрыть панель настроек движка, `CP_VAR` — перейти в первый вариант после `CP_PLY`, `CP_REVIEW=1` — запустить анализ партии (`=dialog` — только открыть окно, `=ask` — как кнопка «Анализировать»: окно или, если параметры уже выбирали, сразу анализ), `CP_REPORT=1` — открыть вкладку «Отчёт» (нужен готовый анализ), `CP_BEST=k` — показать на доске k-й ход лучшей линии у первой отметки движка (нужен готовый анализ), `CP_ENGINE_OFFER=1` — окно предложения скачать Stockfish (`=download` — сразу начать загрузку), `CP_BOARD="e4 c5 Nf3"` — доска поиска базы с этими ходами (SAN), `CP_SORT=date` — база по дате (новые сверху), `CP_PANE=hidden` — база без правой панели (`=drawer` — фильтры поверх таблицы в узком окне), `CP_FILTER="player=carlsen;years=2015-2026;elo=2600"` — несколько фильтров базы, `CP_FILTER_PLAYER=имя` — фильтр «Игрок» базы при запуске, `CP_SEARCH="текст"` — быстрый поиск базы при запуске, `CP_KEYS="ArrowDown Shift+ArrowUp Ctrl+Z Escape"` — нажать эти клавиши (имена egui, по одной раз в полсекунды со второй секунды; модификаторы `Shift+`, `Ctrl+`), `CP_OWN=new|chooser|data|save|delete|newin` (`newin` — «+ Партия» первой базы) — открыть диалог своих баз через 1,5 с: новая база, «Добавить в базу» (для открытой партии, иначе для записи `CP_OPEN` первой базы), данные партии, Ctrl+S, удаление записи `CP_OPEN` первой базы; `CP_PASTE="<текст PGN>"` — перед `CP_OWN` открыть эту партию как вставленную (без базы), `CP_COMMENT=текст` — комментарий к ходу после `CP_PLY` (партия считается изменённой), `CP_COMMENT_EDIT=1` — открыть редактор комментария на текущем ходе, `CP_SHAPE=Ge2e4,Rd5` — нарисовать стрелки/круги на доске у текущего хода (как правой кнопкой), `CP_TYPE=текст` — напечатать текст в поле с фокусом через 2,5 с (после `CP_KEYS`, которые начинаются со 2-й секунды, если их мало), `CP_SETTINGS=interface` — вкладка «Интерфейс», `CP_PLAY=white|black[,5+3|none][,1500]` — сразу начать партию с Maia (`CP_PLAY=dialog` — открыть диалог «Игра с компьютером»), `CP_MAIA=путь/maia3-5m.pt` — веса Maia из этого файла вместо скачанных, `CP_RIVAL=rodent[:стиль]` — соперник партии, начатой хуком `CP_PLAY`/`CP_PLAY_FROM` (стиль — `id` из `STYLES` в `play.rs`: у Rodent V имя файла личности, `tal_hybrid`, `ampere`…; у Rodent IV `iv_` и имя, `iv_petrosian`, `iv_amanda`…), `CP_RODENT4=папка` — Rodent IV из этой папки (`rodent_iv`, `personalities/`, `books/`) вместо скачанного, `CP_RODENT=папка` — Rodent V из этой папки (`rodent_v` и `personalities/`, `nets/`, `books/`) вместо скачанного; пустая папка — «не скачан», загрузка пойдёт в неё, `CP_PLAY_AUTO=1` — за пользователя тоже ходит Maia, быстро (партия до конца без мыши), `CP_PREMOVE=e7e5` — в начале партии поставить этот предход (виден подсветкой, играется сразу после ответа Maia, если легален), `CP_PASTE_LINE="<текст>"` — после `CP_OPEN`/`CP_PLY` вставить текст как вариант, как Ctrl+V (`docs/design/paste-variation.md`), `CP_PLAY_FROM=dialog|white|black[,сила]` — «Играть отсюда…» с хода `CP_PLY`: диалог или сразу партия, `CP_TRAIN=1` — «Учить дебют до этого хода» с хода `CP_PLY`, `CP_TRAIN_MOVES="e2e4 e7e5"` — ходы тренировки как с доски (UCI; неверный — ошибка), `CP_TRAIN_KEEP=1` — последний неверный ход хука остаётся показанным, `CP_TRAINING_FILE=путь` — статистика тренировок в этом файле вместо `training.json`, `CP_LOG_FRAMES=1` — писать в `chesspenguin.log` отладочные сообщения egui_wgpu о каждом кадре (пропущенный как «occluded» кадр виден только там); предупреждения библиотек (wgpu, winit) пишутся туда всегда, одинаковые — раз в минуту со счётчиком, `CP_SCREENSHOT=file.png` (+ `CP_SCREENSHOT_DELAY=сек`) — полноэкранный снимок окна и выход; так сделаны `docs/screenshots/`. Ключ `--bench <база> [отчёт.txt]` печатает замеры базы вместо окна (`docs/dev/import.md`, «Замер на другой машине»). `CP_PANEL_CHECK=1` — сообщать в stderr о боковой панели, чьё содержимое шире её места (egui тогда задвигает панель под соседнюю); в отладочной сборке egui ещё и подсвечивает красным, что расширяет родителя (`docs/design/narrow-windows.md`). `CP_MEMORY_LIMIT=<МБ>` — считать доступной памятью не больше этого (пути без дебютного индекса и без таблицы позиций PGN). +`CP_ONLINE=<ник>` (или `<ник Lichess>,<ник Chess.com>`) — открыть окно онлайн-партий и найти ник (`CP_ONLINE_DOWNLOAD=1` — сразу скачать). `CP_UPDATE_CHECK=<адрес>` — спрашивать о выпуске этот сайт вместо chess.vrubel.xyz/api/update (локальный, чтобы проверить счёт установок). `CP_UPDATE_SOURCE=<папка>` — брать «последний выпуск» из `latest.json` и файлов этой папки вместо GitHub, `CP_UPDATE_KIND=deb|rpm|arch|aur|flatpak|appimage|tarball|windows|mac` — считать установку такой, `CP_UPDATE_OPEN=1` — открыть окно обновления (`=start` — сразу начать), `CP_TAB=reference` — открыть у партии вкладку «Справочник», `CP_ANALYZE` — запустить активный движок, `CP_SETTINGS` — открыть настройки (`=board`, `=about`, `=translation` — сразу эту вкладку), `CP_TRANSLATE_SETUP=1` — окно «Как переводить?» (`=key` — с выбранным ключом API), `CP_ENGINE_PANEL` — раскрыть панель настроек движка, `CP_VAR` — перейти в первый вариант после `CP_PLY`, `CP_REVIEW=1` — запустить анализ партии (`=dialog` — только открыть окно, `=ask` — как кнопка «Анализировать»: окно или, если параметры уже выбирали, сразу анализ), `CP_REPORT=1` — открыть вкладку «Отчёт» (нужен готовый анализ), `CP_BEST=k` — показать на доске k-й ход лучшей линии у первой отметки движка (нужен готовый анализ), `CP_ENGINE_OFFER=1` — окно предложения скачать Stockfish (`=download` — сразу начать загрузку), `CP_BOARD="e4 c5 Nf3"` — доска поиска базы с этими ходами (SAN), `CP_SORT=date` — база по дате (новые сверху), `CP_PANE=hidden` — база без правой панели (`=drawer` — фильтры поверх таблицы в узком окне), `CP_FILTER="player=carlsen;years=2015-2026;elo=2600"` — несколько фильтров базы, `CP_FILTER_PLAYER=имя` — фильтр «Игрок» базы при запуске, `CP_SEARCH="текст"` — быстрый поиск базы при запуске, `CP_KEYS="ArrowDown Shift+ArrowUp Ctrl+Z Escape"` — нажать эти клавиши (имена egui, по одной раз в полсекунды со второй секунды; модификаторы `Shift+`, `Ctrl+`), `CP_OWN=new|chooser|data|save|delete|newin` (`newin` — «+ Партия» первой базы) — открыть диалог своих баз через 1,5 с: новая база, «Добавить в базу» (для открытой партии, иначе для записи `CP_OPEN` первой базы), данные партии, Ctrl+S, удаление записи `CP_OPEN` первой базы; `CP_PASTE="<текст PGN>"` — перед `CP_OWN` открыть эту партию как вставленную (без базы), `CP_COMMENT=текст` — комментарий к ходу после `CP_PLY` (партия считается изменённой), `CP_COMMENT_EDIT=1` — открыть редактор комментария на текущем ходе, `CP_SHAPE=Ge2e4,Rd5` — нарисовать стрелки/круги на доске у текущего хода (как правой кнопкой), `CP_TYPE=текст` — напечатать текст в поле с фокусом через 2,5 с (после `CP_KEYS`, которые начинаются со 2-й секунды, если их мало), `CP_SETTINGS=interface` — вкладка «Интерфейс», `CP_PLAY=white|black[,5+3|none][,1500]` — сразу начать партию с Maia (`CP_PLAY=dialog` — открыть диалог «Игра с компьютером»), `CP_MAIA=путь/maia3-5m.pt` — веса Maia из этого файла вместо скачанных, `CP_RIVAL=rodent[:стиль]` — соперник партии, начатой хуком `CP_PLAY`/`CP_PLAY_FROM` (стиль — `id` из `STYLES` в `play.rs`: у Rodent V имя файла личности, `tal_hybrid`, `ampere`…; у Rodent IV `iv_` и имя, `iv_petrosian`, `iv_amanda`…), `CP_RODENT4=папка` — Rodent IV из этой папки (`rodent_iv`, `personalities/`, `books/`) вместо скачанного, `CP_RODENT=папка` — Rodent V из этой папки (`rodent_v` и `personalities/`, `nets/`, `books/`) вместо скачанного; пустая папка — «не скачан», загрузка пойдёт в неё, `CP_PLAY_AUTO=1` — за пользователя тоже ходит Maia, быстро (партия до конца без мыши), `CP_PREMOVE=e7e5` — в начале партии поставить этот предход (виден подсветкой, играется сразу после ответа Maia, если легален), `CP_PASTE_LINE="<текст>"` — после `CP_OPEN`/`CP_PLY` вставить текст как вариант, как Ctrl+V (`docs/design/paste-variation.md`), `CP_PLAY_FROM=dialog|white|black[,сила]` — «Играть отсюда…» с хода `CP_PLY`: диалог или сразу партия, `CP_TRAIN=1` — «Учить дебют до этого хода» с хода `CP_PLY`, `CP_TRAIN_MOVES="e2e4 e7e5"` — ходы тренировки как с доски (UCI; неверный — ошибка), `CP_TRAIN_KEEP=1` — последний неверный ход хука остаётся показанным, `CP_TRAINING_FILE=путь` — статистика тренировок в этом файле вместо `training.json`, `CP_LOG_FRAMES=1` — писать в `chesspenguin.log` отладочные сообщения egui_wgpu о каждом кадре (пропущенный как «occluded» кадр виден только там); предупреждения библиотек (wgpu, winit) пишутся туда всегда, одинаковые — раз в минуту со счётчиком, `CP_SCREENSHOT=file.png` (+ `CP_SCREENSHOT_DELAY=сек`) — полноэкранный снимок окна и выход; так сделаны `docs/screenshots/`. Ключ `--bench <база> [отчёт.txt]` печатает замеры базы вместо окна (`docs/dev/import.md`, «Замер на другой машине»). `CP_PANEL_CHECK=1` — сообщать в stderr о боковой панели, чьё содержимое шире её места (egui тогда задвигает панель под соседнюю); в отладочной сборке egui ещё и подсвечивает красным, что расширяет родителя (`docs/design/narrow-windows.md`). `CP_MEMORY_LIMIT=<МБ>` — считать доступной памятью не больше этого (пути без дебютного индекса и без таблицы позиций PGN). `CP_PREP=<имя>` — открыть диалог «Подготовиться к сопернику» для этого имени в первой базе (`CP_PREP_OPEN=1` — сразу нажать «Открыть отчёт», `CP_PREP_TAB=openings|errors` — вкладка отчёта, `CP_PREP_COLOR=white|black` — цвет, `CP_PREP_ENGINE=1` — сразу запустить поиск ошибок с текущими параметрами). ## Языки From 5cfadcc7f62f0910907e3390e4b38ba8297951bd Mon Sep 17 00:00:00 2001 From: vrubelroman Date: Wed, 28 Oct 2026 15:43:21 +0300 Subject: [PATCH 6/9] Cargo.lock: the desktop app depends on prep Co-Authored-By: Claude Fable 5.1 --- Cargo.lock | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.lock b/Cargo.lock index babd0ad..05a4567 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -811,6 +811,7 @@ dependencies = [ "maia", "online-games", "play", + "prep", "releases", "rfd", "rodio", From d654223665989e57071145a19770b6c4a41b6c8d Mon Sep 17 00:00:00 2001 From: vrubelroman Date: Wed, 28 Oct 2026 16:21:16 +0300 Subject: [PATCH 7/9] Opponent prep: the tester's and designer's review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Core: the most precise opening name stays down a line (a deeper position the table names more generally, «Sicilian Defense» after 3.d4, does not take it back), in the games' names and in the tree; one name per position across move orders; the games and the last date of a position over all its move orders; `evaluated()` (evaluations from the cache count). Report version 3. Screen: errors judged from cached evaluations show without a run; «Checked N of M positions · Continue» after «Stop» or a new depth; the report shows the book only when it was computed with the chosen one; the dialog keeps the remembered book and the same player reopens with the dialog's colour and book; «Deeper» and the depth list share one path (setting kept, report from the cache); a chosen error survives re-judging during the run; quitting during the run asks first; Ctrl+W returns from a game opened from the report; a game opened at an error opens after the move, a repeated error at its newest game. Design (§12): the summary as a grid whose columns give way, counts in the colours of the signs; result bars without numbers, faint over few games; move lines numbered at White's moves; whole-move first-move lines; colour icons in the openings table; ECO kept beside the name; the errors tab as one table with row selection and keys (↑/↓/→/←/Enter); colour lines there only in the stack; «Inaccuracies» switch (kept in settings) for the tab, the summary, the tree and the games; «▾» at the right end; one colour order; the depth caption by the room left; names first in narrow game lists; two-row games minimum in a low window; the caption beside the stacked board; «others (N)» when narrow. Designer's review recorded in docs/design/opponent-prep.md §12. Co-Authored-By: Claude Opus 5.5 --- apps/desktop/src/app.rs | 88 +- apps/desktop/src/game_view.rs | 20 +- apps/desktop/src/i18n.rs | 308 ++++-- apps/desktop/src/prep_ui.rs | 1891 ++++++++++++++++++++++----------- apps/desktop/src/settings.rs | 3 + crates/prep/src/lib.rs | 11 +- crates/prep/src/openings.rs | 44 +- crates/prep/src/tree.rs | 54 +- docs/design/opponent-prep.md | 49 + 9 files changed, 1720 insertions(+), 748 deletions(-) diff --git a/apps/desktop/src/app.rs b/apps/desktop/src/app.rs index 6a315d7..62a0569 100644 --- a/apps/desktop/src/app.rs +++ b/apps/desktop/src/app.rs @@ -249,6 +249,9 @@ pub struct App { /// between the library and the game (opponent-prep.md §3.1). prep_dialog: Option, prep: Option, + /// Quitting while the opening errors are searched: asked first; «Quit» answered. + prep_quit_ask: bool, + prep_quit_ok: bool, allow_quit: bool, applied_dark: Option, debug: DebugStartup, @@ -421,6 +424,8 @@ impl App { reference: Default::default(), prep_dialog: None, prep: None, + prep_quit_ask: false, + prep_quit_ok: false, engine_offer: crate::engine_offer::EngineOffer::new(), offer_hook_done: false, online_probe: crate::online::Probe::start(ctx), @@ -668,7 +673,7 @@ impl App { exact: None, side, }; - self.prep_dialog = Some(PrepDialog::new(path, entry, &self.settings)); + self.prep_dialog = Some(PrepDialog::new(path, entry)); } let Some(index) = self.debug.open else { return }; let Some(path) = self.settings.databases.first().cloned() else { @@ -793,7 +798,8 @@ impl App { if let Some(p) = self.prep.as_mut() && p.matches(&start.path, &start.player) { - p.shown = true; + // The report as it was, with the colour and the book of the dialog. + p.reopen(start.side, start.book); return; } if let Some(mut old) = self.prep.take() { @@ -802,6 +808,44 @@ impl App { self.prep = Some(PrepScreen::new(start, db, &self.settings, ctx)); } + /// «Opening errors are being searched. Quit and stop?» + fn prep_quit_question(&mut self, ctx: &egui::Context) { + if !self.prep_quit_ask { + return; + } + let mut choice = None; + egui::Modal::new(egui::Id::new("prep_quit")).show(ctx, |ui| { + ui.set_width(400.0); + ui.label(tr("Opening errors are being searched. Quit and stop?")); + ui.label(RichText::new(tr("What was found is kept.")).weak()); + ui.add_space(8.0); + ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { + if ui.button(tr("Cancel")).clicked() { + choice = Some(false); + } + if crate::widgets::primary(ui, tr("Quit")).clicked() { + choice = Some(true); + } + }); + }); + if choice.is_none() && ctx.input_mut(|i| i.consume_key(Modifiers::NONE, Key::Escape)) { + choice = Some(false); + } + match choice { + Some(true) => { + self.prep_quit_ask = false; + self.prep_quit_ok = true; + if let Some(p) = self.prep.as_mut() { + p.stop(); + } + // The usual way out from here (unsaved games are asked about). + ctx.send_viewport_cmd(egui::ViewportCommand::Close); + } + Some(false) => self.prep_quit_ask = false, + None => {} + } + } + /// The preparation's dialog, when it is open. fn prep_dialog(&mut self, ctx: &egui::Context) { if self.prep_dialog.is_none() { @@ -2808,9 +2852,21 @@ impl eframe::App for App { }); self.applied_dark = Some(self.settings.dark_mode); } + // Quitting while the opening errors are searched: asked first (what was found + // is kept either way). + if ctx.input(|i| i.viewport().close_requested()) + && !self.allow_quit + && !self.prep_quit_ok + && self.prep.as_ref().is_some_and(|p| p.running()) + { + ctx.send_viewport_cmd(egui::ViewportCommand::CancelClose); + self.prep_quit_ask = true; + } + let quitting = !self.prep_quit_ask; // Quitting: a comment being written goes into the game first, so the question // about unsaved changes counts it. - if ctx.input(|i| i.viewport().close_requested()) + if quitting + && ctx.input(|i| i.viewport().close_requested()) && !self.allow_quit && let Some(g) = self.game.as_mut() { @@ -2829,7 +2885,8 @@ impl eframe::App for App { } // Quitting with a modified game left for another (reference tab): show that one, // so the question "save?" is about the game that has the changes. - if ctx.input(|i| i.viewport().close_requested()) + if quitting + && ctx.input(|i| i.viewport().close_requested()) && !self.allow_quit && !self.game.as_ref().is_some_and(|g| g.game.is_modified()) && let Some(k) = self @@ -2841,7 +2898,8 @@ impl eframe::App for App { self.game = self.previous_games.pop(); } // (A game against Maia in progress has asked «The game is on» instead.) - if ctx.input(|i| i.viewport().close_requested()) + if quitting + && ctx.input(|i| i.viewport().close_requested()) && !self.allow_quit && self .game @@ -2920,6 +2978,7 @@ impl eframe::App for App { // The analysis options (its dialog) are kept. self.settings_dirty |= self.settings.review != review; self.reference_tab = game.reference_tab(); + let game_back_previous = game.previous_prep && game.previous.is_some(); // Before the actions: leaving may take the game away. if let Some(res) = game.record_news.take() { let name = game.player_name(); @@ -2928,6 +2987,16 @@ impl eframe::App for App { for a in actions { match a { GameAction::Back => self.request_close(&ctx, CloseIntent::BackToLibrary), + GameAction::BackKey => { + // Ctrl+W: back where the game was opened from (the report, a + // game), else to the library. + let intent = if game_back_previous { + CloseIntent::ReturnToPrevious + } else { + CloseIntent::BackToLibrary + }; + self.request_close(&ctx, intent); + } // The game's database in the library, the game's row shown (its row is // revealed as the game closes). GameAction::OpenDatabase(path) => { @@ -3114,11 +3183,7 @@ impl eframe::App for App { }) && self.prep_dialog.is_none() && let Some((path, entry)) = self.library.prep_entry() { - self.prep_dialog = Some(PrepDialog::new( - path, - entry.unwrap_or_default(), - &self.settings, - )); + self.prep_dialog = Some(PrepDialog::new(path, entry.unwrap_or_default())); } self.online_probe.poll(); self.library.online = self.online_probe.any(); @@ -3188,7 +3253,7 @@ impl eframe::App for App { self.edit_game_data(); } LibraryAction::PrepareAgainst { path, entry } => { - self.prep_dialog = Some(PrepDialog::new(path, entry, &self.settings)); + self.prep_dialog = Some(PrepDialog::new(path, entry)); } } } @@ -3331,6 +3396,7 @@ impl eframe::App for App { self.confirm_dialog(&ctx); self.own_dialogs(&ctx); self.prep_dialog(&ctx); + self.prep_quit_question(&ctx); // Whether the database the dialog names is there, as last found. if let Some(d) = self.play_dialog.as_mut() { d.target_there = d diff --git a/apps/desktop/src/game_view.rs b/apps/desktop/src/game_view.rs index e652813..79b4fa7 100644 --- a/apps/desktop/src/game_view.rs +++ b/apps/desktop/src/game_view.rs @@ -120,6 +120,8 @@ enum SideTab { pub enum GameAction { Back, + /// Ctrl+W: back to what the game was opened from, else to the library. + BackKey, /// Back to the library with this database chosen (the game's own). OpenDatabase(PathBuf), /// «Play on from here»: the play dialog for this position. @@ -1016,7 +1018,9 @@ impl GameView { ui.horizontal(|ui| { if ui .button(if compact { "⬅" } else { tr("⬅ Library") }) - .on_hover_text(if self.previous.is_some() { + .on_hover_text(if self.previous_prep { + tr("Back to the game list") + } else if self.previous.is_some() { tr("Back to the game list (Ctrl+W)") } else { tr("Back to the game list (Esc, Ctrl+W)") @@ -1028,13 +1032,13 @@ impl GameView { if let Some(b) = &back_to && ui .button(if compact { "⬅" } else { b.as_str() }) - .on_hover_text(if compact { - format!( - "{b}\n{}", + .on_hover_text({ + let hint = if self.previous_prep { + tr("The preparation this game was opened from, as you left it (Esc, Ctrl+W)") + } else { tr("The game this one was opened from, as you left it (Esc)") - ) - } else { - tr("The game this one was opened from, as you left it (Esc)").to_owned() + }; + if compact { format!("{b}\n{hint}") } else { hint.to_owned() } }) .clicked() { @@ -4826,7 +4830,7 @@ impl GameView { } "add_to_db" => actions.push(GameAction::AddToDatabase), "game_data" => actions.push(GameAction::EditGameData), - "back" => actions.push(GameAction::Back), + "back" => actions.push(GameAction::BackKey), "find" if self.search_line().is_some() => { actions.push(GameAction::FindPosition(None)) } diff --git a/apps/desktop/src/i18n.rs b/apps/desktop/src/i18n.rs index 798d1df..8303654 100644 --- a/apps/desktop/src/i18n.rs +++ b/apps/desktop/src/i18n.rs @@ -14060,17 +14060,6 @@ const ROWS: &[[&str; 9]] = &[ "Daraxt va dvijok qanchalik chuqur qaraydi", "Ағаш пен қозғалтқыш қаншалықты терең қарайды", ], - [ - "♙ Board", - "♙ Доска", - "♙ Échiquier", - "♙ Brett", - "♙ Tablero", - "♙ Scacchiera", - "♙ Tabuleiro", - "♙ Taxta", - "♙ Тақта", - ], [ "The board of the chosen position", "Доска выбранной позиции", @@ -14346,28 +14335,6 @@ const ROWS: &[[&str; 9]] = &[ "Birinchi yurishlar", "Алғашқы жүрістер", ], - [ - "♙ White", - "♙ Белыми", - "♙ Blancs", - "♙ Weiß", - "♙ Blancas", - "♙ Bianco", - "♙ Brancas", - "♙ Oq", - "♙ Ақ", - ], - [ - "♟ Black", - "♟ Чёрными", - "♟ Noirs", - "♟ Schwarz", - "♟ Negras", - "♟ Nero", - "♟ Pretas", - "♟ Qora", - "♟ Қара", - ], [ "no name", "без названия", @@ -14434,17 +14401,6 @@ const ROWS: &[[&str; 9]] = &[ "O‘sha pozitsiyalar «Oddiy» sifatda", "Сол позициялар «Қалыпты» сапада", ], - [ - "of the checked positions", - "из проверенных позиций", - "sur les positions vérifiées", - "von den geprüften Stellungen", - "de las posiciones comprobadas", - "delle posizioni verificate", - "das posições verificadas", - "tekshirilgan pozitsiyalardan", - "тексерілген позициялардан", - ], [ "Repeated errors — the same position, the same move", "Повторяющиеся ошибки — одна и та же позиция, тот же ход", @@ -14456,28 +14412,6 @@ const ROWS: &[[&str; 9]] = &[ "Takrorlanuvchi xatolar — o‘sha pozitsiya, o‘sha yurish", "Қайталанатын қателер — сол позиция, сол жүріс", ], - [ - "None so far", - "Пока нет", - "Aucune pour l'instant", - "Bisher keine", - "Ninguno por ahora", - "Nessuno finora", - "Nenhum até agora", - "Hozircha yo‘q", - "Әзірге жоқ", - ], - [ - "Position", - "Позиция", - "Position", - "Stellung", - "Posición", - "Posizione", - "Posição", - "Pozitsiya", - "Позиция", - ], [ "Played", "Сыграл", @@ -14687,17 +14621,6 @@ const ROWS: &[[&str; 9]] = &[ "▶ Xatolar ≈ {time}", "▶ Қателер ≈ {time}", ], - [ - "Analyse {n} more positions ≈ {time}", - "Доразобрать {n} позиций ≈ {time}", - "Analyser {n} positions de plus ≈ {time}", - "{n} weitere Stellungen analysieren ≈ {time}", - "Analizar {n} posiciones más ≈ {time}", - "Analizza altre {n} posizioni ≈ {time}", - "Analisar mais {n} posições ≈ {time}", - "Yana {n} pozitsiyani tahlil qilish ≈ {time}", - "Тағы {n} позицияны талдау ≈ {time}", - ], [ "▶ Find opening errors ≈ {time}", "▶ Найти ошибки в дебютах ≈ {time}", @@ -14753,17 +14676,6 @@ const ROWS: &[[&str; 9]] = &[ "kitobdan {n}-yurishda chiqadi, partiyalarning {p} % ida birinchi bo‘lib", "кітаптан {n}-жүрісте шығады, партиялардың {p} % інде бірінші болып", ], - [ - "Opening errors: {i} inaccuracies · {m} mistakes · {b} blunders — in {g} games ({p} %)", - "Ошибок в дебюте: неточностей {i} · ошибок {m} · зевков {b} — в {g} партиях ({p} %)", - "Erreurs d'ouverture : {i} imprécisions · {m} erreurs · {b} gaffes — dans {g} parties ({p} %)", - "Eröffnungsfehler: {i} Ungenauigkeiten · {m} Fehler · {b} grobe Fehler — in {g} Partien ({p} %)", - "Errores de apertura: {i} imprecisiones · {m} errores · {b} errores graves — en {g} partidas ({p} %)", - "Errori di apertura: {i} imprecisioni · {m} errori · {b} svarioni — in {g} partite ({p} %)", - "Erros de abertura: {i} imprecisões · {m} erros · {b} erros graves — em {g} partidas ({p} %)", - "Debyut xatolari: {i} noaniqlik · {m} xato · {b} qo‘pol xato — {g} partiyada ({p} %)", - "Дебют қателері: {i} дәлсіздік · {m} қате · {b} өрескел қате — {g} партияда ({p} %)", - ], [ "Few games ({n}): percentages and scores are unreliable", "Партий мало ({n}) — проценты и счёт ненадёжны", @@ -14819,17 +14731,6 @@ const ROWS: &[[&str; 9]] = &[ "Boshqa tartibda ham kelingan: {orders}", "Басқа жүріс ретімен де келген: {orders}", ], - [ - "Mistake: better {best} ({before} → {after}) · in {n} games", - "Ошибка: лучше {best} (оценка {before} → {after}) · в {n} партиях", - "Erreur : mieux {best} ({before} → {after}) · dans {n} parties", - "Fehler: besser {best} ({before} → {after}) · in {n} Partien", - "Error: mejor {best} ({before} → {after}) · en {n} partidas", - "Errore: meglio {best} ({before} → {after}) · in {n} partite", - "Erro: melhor {best} ({before} → {after}) · em {n} partidas", - "Xato: yaxshisi {best} ({before} → {after}) · {n} partiyada", - "Қате: жақсысы {best} ({before} → {after}) · {n} партияда", - ], [ "Here he leaves the book: in “{book}” this position occurs {n} times", "Здесь он выходит из книги: в «{book}» такая позиция встречается {n} раз", @@ -14885,17 +14786,6 @@ const ROWS: &[[&str; 9]] = &[ "{total} dan {done} pozitsiya tekshirildi", "{total} ішінен {done} позиция тексерілді", ], - [ - "{i} inaccuracies · {m} mistakes · {b} blunders — in {g} games of {t} ({p} %)", - "неточностей {i} · ошибок {m} · зевков {b} — в {g} партиях из {t} ({p} %)", - "{i} imprécisions · {m} erreurs · {b} gaffes — dans {g} parties sur {t} ({p} %)", - "{i} Ungenauigkeiten · {m} Fehler · {b} grobe Fehler — in {g} von {t} Partien ({p} %)", - "{i} imprecisiones · {m} errores · {b} errores graves — en {g} partidas de {t} ({p} %)", - "{i} imprecisioni · {m} errori · {b} svarioni — in {g} partite su {t} ({p} %)", - "{i} imprecisões · {m} erros · {b} erros graves — em {g} partidas de {t} ({p} %)", - "{i} noaniqlik · {m} xato · {b} qo‘pol xato — {t} tadan {g} partiyada ({p} %)", - "{i} дәлсіздік · {m} қате · {b} өрескел қате — {t} ішінен {g} партияда ({p} %)", - ], [ "No errors in the first {n} moves ({i} inaccuracies).", "В первых {n} ходах ошибок не нашлось (неточностей {i}).", @@ -14984,6 +14874,204 @@ const ROWS: &[[&str; 9]] = &[ "{played} — yaxshisi {best} · {before} → {after}", "{played} — жақсысы {best} · {before} → {after}", ], + [ + "Opening errors are being searched. Quit and stop?", + "Идёт поиск ошибок в дебютах. Выйти и остановить?", + "La recherche d'erreurs d'ouverture est en cours. Quitter et l'arrêter ?", + "Die Suche nach Eröffnungsfehlern läuft. Beenden und stoppen?", + "Se están buscando errores de apertura. ¿Salir y detenerla?", + "È in corso la ricerca degli errori di apertura. Uscire e fermarla?", + "A busca de erros de abertura está em andamento. Sair e parar?", + "Debyut xatolari qidirilmoqda. Chiqib, to‘xtatilsinmi?", + "Дебют қателері ізделуде. Шығып, тоқтату керек пе?", + ], + [ + "What was found is kept.", + "Найденное сохранится.", + "Ce qui a été trouvé est conservé.", + "Was gefunden wurde, bleibt erhalten.", + "Lo encontrado se conserva.", + "Quanto trovato viene conservato.", + "O que foi encontrado é mantido.", + "Topilganlar saqlanadi.", + "Табылғаны сақталады.", + ], + [ + "Quit", + "Выйти", + "Quitter", + "Beenden", + "Salir", + "Esci", + "Sair", + "Chiqish", + "Шығу", + ], + [ + "Back to the game list", + "Назад к списку партий", + "Retour à la liste des parties", + "Zurück zur Partienliste", + "Volver a la lista de partidas", + "Torna all'elenco delle partite", + "Voltar à lista de partidas", + "Partiyalar ro‘yxatiga qaytish", + "Партиялар тізіміне оралу", + ], + [ + "The preparation this game was opened from, as you left it (Esc, Ctrl+W)", + "Подготовка, из которой открыта партия, — такой, как вы её оставили (Esc, Ctrl+W)", + "La préparation d'où cette partie a été ouverte, telle que vous l'avez laissée (Échap, Ctrl+W)", + "Die Vorbereitung, aus der diese Partie geöffnet wurde, so wie Sie sie verlassen haben (Esc, Strg+W)", + "La preparación desde la que se abrió esta partida, tal como la dejó (Esc, Ctrl+W)", + "La preparazione da cui è stata aperta questa partita, come l'hai lasciata (Esc, Ctrl+W)", + "A preparação de onde esta partida foi aberta, como você a deixou (Esc, Ctrl+W)", + "Bu partiya ochilgan tayyorgarlik — siz qoldirgan holatda (Esc, Ctrl+W)", + "Осы партия ашылған дайындық — сіз қалдырған күйінде (Esc, Ctrl+W)", + ], + [ + "no errors", + "ошибок нет", + "aucune erreur", + "keine Fehler", + "sin errores", + "nessun errore", + "sem erros", + "xatolar yo‘q", + "қателер жоқ", + ], + [ + "Share of the colour's games; a variation's — of its family's", + "Доля от партий цветом; у варианта — от семейства", + "Part des parties de cette couleur ; pour une variante — de sa famille", + "Anteil an den Partien dieser Farbe; bei einer Variante — an ihrer Familie", + "Parte de las partidas de ese color; de una variante — de su familia", + "Quota delle partite di quel colore; di una variante — della sua famiglia", + "Parte das partidas dessa cor; de uma variante — da sua família", + "Shu rangdagi partiyalardan ulush; variantda — oilasidan", + "Осы түстегі партиялардан үлес; нұсқада — тобынан", + ], + [ + "The counts are of the checked positions", + "Числа — по проверенным позициям", + "Les nombres portent sur les positions vérifiées", + "Die Zahlen gelten für die geprüften Stellungen", + "Las cifras son de las posiciones comprobadas", + "I numeri riguardano le posizioni verificate", + "Os números são das posições verificadas", + "Sonlar tekshirilgan pozitsiyalar bo‘yicha", + "Сандар тексерілген позициялар бойынша", + ], + [ + "Show the inaccuracies (?!) with the mistakes and blunders", + "Показывать неточности (?!) вместе с ошибками и зевками", + "Afficher les imprécisions (?!) avec les erreurs et les gaffes", + "Ungenauigkeiten (?!) mit Fehlern und groben Fehlern zeigen", + "Mostrar las imprecisiones (?!) con los errores y errores graves", + "Mostra le imprecisioni (?!) con errori e svarioni", + "Mostrar as imprecisões (?!) com os erros e erros graves", + "Noaniqliklarni (?!) xato va qo‘pol xatolar bilan ko‘rsatish", + "Дәлсіздіктерді (?!) қателер мен өрескел қателермен бірге көрсету", + ], + [ + "Book: {name}", + "Книга: {name}", + "Livre : {name}", + "Buch: {name}", + "Libro: {name}", + "Libro: {name}", + "Livro: {name}", + "Kitob: {name}", + "Кітап: {name}", + ], + [ + "White wins {w} % · draws {d} % · Black wins {b} %", + "Победы белых {w} % · ничьи {d} % · победы чёрных {b} %", + "Victoires des Blancs {w} % · nulles {d} % · victoires des Noirs {b} %", + "Weißsiege {w} % · Remis {d} % · Schwarzsiege {b} %", + "Victorias blancas {w} % · tablas {d} % · victorias negras {b} %", + "Vittorie del Bianco {w} % · patte {d} % · vittorie del Nero {b} %", + "Vitórias das brancas {w} % · empates {d} % · vitórias das pretas {b} %", + "Oq g‘alabalari {w} % · durang {d} % · qora g‘alabalari {b} %", + "Ақ жеңістері {w} % · тең {d} % · қара жеңістері {b} %", + ], + [ + "{n} moves", + "{n} ходов", + "{n} coups", + "{n} Züge", + "{n} jugadas", + "{n} mosse", + "{n} lances", + "{n} yurish", + "{n} жүріс", + ], + [ + "{n} m.", + "{n} х.", + "{n} c.", + "{n} Z.", + "{n} j.", + "{n} m.", + "{n} l.", + "{n} yur.", + "{n} ж.", + ], + [ + "Continue ≈ {time}", + "Продолжить ≈ {time}", + "Continuer ≈ {time}", + "Fortsetzen ≈ {time}", + "Continuar ≈ {time}", + "Continua ≈ {time}", + "Continuar ≈ {time}", + "Davom ettirish ≈ {time}", + "Жалғастыру ≈ {time}", + ], + [ + "Errors found · {quality} · {n} positions", + "Ошибки найдены · {quality} · {n} позиций", + "Erreurs trouvées · {quality} · {n} positions", + "Fehler gefunden · {quality} · {n} Stellungen", + "Errores encontrados · {quality} · {n} posiciones", + "Errori trovati · {quality} · {n} posizioni", + "Erros encontrados · {quality} · {n} posições", + "Xatolar topildi · {quality} · {n} pozitsiya", + "Қателер табылды · {quality} · {n} позиция", + ], + [ + "in {p} % of games", + "в {p} % партий", + "dans {p} % des parties", + "in {p} % der Partien", + "en el {p} % de las partidas", + "nel {p} % delle partite", + "em {p} % das partidas", + "partiyalarning {p} % ida", + "партиялардың {p} % інде", + ], + [ + "others ({n})", + "другие ({n})", + "autres ({n})", + "andere ({n})", + "otras ({n})", + "altre ({n})", + "outros ({n})", + "boshqalar ({n})", + "басқалары ({n})", + ], + [ + "{judgement}: better {best} ({before} → {after}) · in {n} games", + "{judgement}: лучше {best} (оценка {before} → {after}) · в {n} партиях", + "{judgement} : mieux {best} ({before} → {after}) · dans {n} parties", + "{judgement}: besser {best} ({before} → {after}) · in {n} Partien", + "{judgement}: mejor {best} ({before} → {after}) · en {n} partidas", + "{judgement}: meglio {best} ({before} → {after}) · in {n} partite", + "{judgement}: melhor {best} ({before} → {after}) · em {n} partidas", + "{judgement}: yaxshisi {best} ({before} → {after}) · {n} partiyada", + "{judgement}: жақсысы {best} ({before} → {after}) · {n} партияда", + ], ]; #[cfg(test)] diff --git a/apps/desktop/src/prep_ui.rs b/apps/desktop/src/prep_ui.rs index 9ada6d6..34649fd 100644 --- a/apps/desktop/src/prep_ui.rs +++ b/apps/desktop/src/prep_ui.rs @@ -24,8 +24,9 @@ use shakmaty::uci::UciMove; use shakmaty::{Chess, Color, Move, Position, Square}; use crate::board::{Arrow, BoardState, BoardView}; -use crate::board_search::{self, Background, PREVIEW_ARROW}; +use crate::board_search::{Background, PREVIEW_ARROW}; use crate::i18n::{tr, trf}; +use crate::large_db::grouped; use crate::reference::RefDb; use crate::review::{self, DialogAction}; use crate::settings::{REVIEW_QUALITY, Settings}; @@ -142,13 +143,22 @@ fn book_picker( id: &str, current: &BookChoice, own: &Path, - own_name: &str, dbs: &[RefDb], width: f32, + with_caption: bool, ) -> Option { let mut picked = None; + let own_name = base_name(own); + let own_name = own_name.as_str(); + let label = current.label(own_name, dbs); + // Without its caption beside it, «None» alone would say nothing. + let shown = if with_caption { + trf("Book: {name}", &[("name", &label)]) + } else { + label + }; egui::ComboBox::from_id_salt(id) - .selected_text(current.label(own_name, dbs)) + .selected_text(shown) .width(width) .truncate() .show_ui(ui, |ui| { @@ -260,7 +270,8 @@ pub struct PrepDialog { /// The name the dialog was opened with (ticked by itself when found). wanted: Option, side: ColorChoice, - book: BookChoice, + /// The book; `None` until the shelf is known (the setting names a database of it). + book: Option, /// Games of the ticked names by colour, and the job counting them. counts: Option<(Vec, (u32, u32))>, count_job: Option<(Vec, CountJob)>, @@ -271,9 +282,9 @@ pub struct PrepDialog { } impl PrepDialog { - pub fn new(path: PathBuf, entry: PrepEntry, settings: &Settings) -> Self { + pub fn new(path: PathBuf, entry: PrepEntry) -> Self { PrepDialog { - book: BookChoice::from_setting(settings.prep.book.as_deref(), &path, &[]), + book: None, path, dbs: Vec::new(), query: entry.query, @@ -386,10 +397,12 @@ impl PrepDialog { self.poll(ctx, db); } let own_name = base_name(&self.path); - if self.book == BookChoice::None && settings.prep.book.is_none() && !self.dbs.is_empty() { - // The default book: the largest database on the shelf (once the shelf is known). - self.book = BookChoice::from_setting(None, &self.path, &self.dbs); + if self.book.is_none() && !self.dbs.is_empty() { + // The book chosen last time, else the largest database on the shelf: once + // the shelf is known. + self.book = Some(BookChoice::from_setting(settings.prep.book.as_deref(), &self.path, &self.dbs)); } + let book = self.book.clone().unwrap_or(BookChoice::None); let mut outcome = None; let ready = db.is_some() && !self.ticked.is_empty(); let ticked_names: Vec = self @@ -454,11 +467,11 @@ impl PrepDialog { self.ticked.clear(); self.counts = None; self.count_job = None; - self.book = BookChoice::from_setting( + self.book = Some(BookChoice::from_setting( settings.prep.book.as_deref(), &self.path, &self.dbs, - ); + )); } }); ui.horizontal(|ui| { @@ -524,7 +537,6 @@ impl PrepDialog { ui.add_space(8.0); ui.horizontal_wrapped(|ui| { ui.add_sized([label_w, 20.0], egui::Label::new(tr("Colour"))); - ui.radio_value(&mut self.side, ColorChoice::Both, tr("Both")); let (w, b) = match counts { Some((w, b)) => (w.to_string(), b.to_string()), None if self.ticked.is_empty() => ("—".to_owned(), "—".to_owned()), @@ -540,13 +552,14 @@ impl PrepDialog { ColorChoice::Black, trf("Black — {n}", &[("n", &b)]), ); + ui.radio_value(&mut self.side, ColorChoice::Both, tr("Both")); }); ui.horizontal(|ui| { ui.add_sized([label_w, 20.0], egui::Label::new(tr("Book"))); let width = ui.available_width() - 8.0; - if let Some(b) = book_picker(ui, "prep_dialog_book", &self.book, &self.path, &own_name, &self.dbs, width) { - self.book = b; - settings.prep.book = Some(self.book.setting(&self.path)); + if let Some(b) = book_picker(ui, "prep_dialog_book", &book, &self.path, &self.dbs, width, false) { + settings.prep.book = Some(b.setting(&self.path)); + self.book = Some(b); } }); ui.label( @@ -591,7 +604,7 @@ impl PrepDialog { path: self.path.clone(), player: Player::new(self.ticked.iter().copied()), side: self.side, - book: self.book.clone(), + book: self.book.clone().unwrap_or(BookChoice::None), } } @@ -815,6 +828,46 @@ enum TreeRow { Others { white: bool, parent: u32, depth: usize, count: usize }, } +/// A row of the errors tab. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +enum ErrRow { + /// «Repeated errors — …» / «By opening». + RepeatedTitle, + OpeningsTitle, + /// A repeated error (colour, index into `repeated`) and one of its games. + Repeated { white: bool, index: usize }, + RepeatedGame { white: bool, index: usize, game: u32 }, + /// A variation with errors (colour, family, variation) and one of its errors. + Variation { white: bool, family: usize, variation: usize }, + Error { white: bool, index: usize }, +} + +impl ErrRow { + fn is_title(self) -> bool { + matches!(self, ErrRow::RepeatedTitle | ErrRow::OpeningsTitle) + } +} + +/// The engine part of the controls. +enum EngineTexts { + Running, + /// A button to start or go on, and a note beside it. + Button { label: String, note: Option }, + /// Done: a quiet label. + Done { label: String, note: Option }, +} + +/// Where the engine run stands for the colour(s) shown. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +enum EngineState { + Running, + /// No evaluation yet. + NotRun, + /// Some positions evaluated (a run stopped, a new depth, new games). + Partial { done: usize, total: usize }, + Complete { total: usize }, +} + /// The default expansion: nodes with at least this many games, this deep. const EXPAND_GAMES: u32 = 5; const EXPAND_PLIES: u8 = 6; @@ -868,6 +921,18 @@ pub struct PrepScreen { others_open: HashSet<(bool, u32)>, open_families: HashSet<(bool, usize)>, open_repeated: HashSet<(bool, usize)>, + open_variations: HashSet<(bool, usize, usize)>, + /// The row of the errors tab the keyboard is on. + err_cursor: Option, + /// The fingerprint of the chosen book, once it is open (`None`: no book), and the + /// book and its database it was taken from. + book_fp: Option, + book_fp_of: Option<(BookChoice, usize)>, + /// Inaccuracies shown (`settings.prep.inaccuracies`, read every frame). + show_inaccuracies: bool, + /// The board stands over the lists (a narrow or low window); the window is low. + stacked: bool, + low_window: bool, selection: Selection, shown_pos: Option, /// The user turned the board (else it is the player's colour). @@ -927,17 +992,54 @@ fn line_text(sans: &[String]) -> String { crate::san::show_line(&out) } -/// "…" in the middle when the text is longer than `max` characters: the first and -/// the last moves of a line matter more than the middle. -fn shorten_middle(s: &str, max: usize) -> String { - let n = s.chars().count(); - if n <= max { - return s.to_owned(); +/// The table's line ("1. e4 c5 2. Nf3") as the program writes lines: moves with +/// their numbers joined ("1.e4", "c5", "2.Nf3"). +fn table_line(line: &str) -> Vec { + let mut out: Vec = Vec::new(); + let mut number: Option<&str> = None; + for tok in line.split_whitespace() { + if tok.ends_with('.') && tok.trim_end_matches('.').chars().all(|c| c.is_ascii_digit()) { + number = Some(tok); + } else { + out.push(match number.take() { + Some(n) if n.ends_with("...") => format!("{}…{tok}", n.trim_end_matches('.')), + Some(n) => format!("{n}{tok}"), + None => tok.to_owned(), + }); + } + } + out +} + +/// The moves in `width`: whole moves, the first and the last kept, «…» for the middle +/// ones that do not fit (they matter less). +fn fit_line(ui: &Ui, tokens: &[String], width: f32) -> String { + let fits = |t: &str| text_width(ui, t, egui::TextStyle::Body) <= width; + let full = crate::san::show_line(&tokens.join(" ")); + if fits(&full) || tokens.len() < 3 { + return full; + } + // Drop moves from the middle until the rest fits. + let mut head = tokens.len().div_ceil(2); + let mut tail = tokens.len() - head; + loop { + if head > 1 && head >= tail { + head -= 1; + } else if tail > 1 { + tail -= 1; + } else { + return crate::san::show_line(&format!("{} … {}", tokens[0], tokens[tokens.len() - 1])); + } + let text = format!( + "{} … {}", + tokens[..head].join(" "), + tokens[tokens.len() - tail..].join(" ") + ); + let text = crate::san::show_line(&text); + if fits(&text) { + return text; + } } - let keep = max.saturating_sub(1) / 2; - let head: String = s.chars().take(keep).collect(); - let tail: String = s.chars().skip(n - keep).collect(); - format!("{head}…{tail}") } /// "01.2026 – 10.2026" from the games' dates (empty without dates). @@ -962,15 +1064,45 @@ fn period(games: &[GameInfo]) -> String { } } -/// The player's tally as the result bar wants it (White's wins · draws · Black's wins). -fn bar_tally(t: &Tally, white: bool) -> chess_import::position::Tally { +/// The results as a bar, by lightness (White's wins light, draws grey, Black's wins +/// dark, as on the search board) with no numbers in it: the score beside it is the +/// player's, the percentages are in its tooltip. Faint over few games. +fn score_bar(ui: &mut Ui, t: &Tally, white: bool, few: bool) { + let (rect, resp) = ui.allocate_exact_size(vec2(56.0, 12.0), Sense::hover()); let (white_wins, black_wins) = if white { (t.wins, t.losses) } else { (t.losses, t.wins) }; - chess_import::position::Tally { - games: t.games, - white_wins, - draws: t.draws, - black_wins, - ..Default::default() + let decided = white_wins + t.draws + black_wins; + let fade = |c: Color32| if few { c.gamma_multiply(0.45) } else { c }; + let painter = ui.painter(); + let outline = if ui.visuals().dark_mode { + Color32::from_gray(0x70) + } else { + ui.visuals().weak_text_color() + }; + if decided > 0 { + let mut x = rect.left(); + for (n, fill) in [ + (white_wins, Color32::from_gray(0xe8)), + (t.draws, Color32::from_gray(0x8c)), + (black_wins, Color32::from_gray(0x2b)), + ] { + let w = rect.width() * n as f32 / decided as f32; + if w > 0.0 { + painter.rect_filled( + egui::Rect::from_min_max(egui::pos2(x, rect.top()), egui::pos2(x + w, rect.bottom())), + 0.0, + fade(fill), + ); + } + x += w; + } + } + painter.rect_stroke(rect, 2.0, egui::Stroke::new(1.0, fade(outline)), egui::StrokeKind::Inside); + if decided > 0 { + let pct = |n: u32| 100 * n / decided; + resp.on_hover_text(trf( + "White wins {w} % · draws {d} % · Black wins {b} %", + &[("w", &pct(white_wins)), ("d", &pct(t.draws)), ("b", &pct(black_wins))], + )); } } @@ -1008,6 +1140,20 @@ fn pill(ui: &mut Ui, j: Judgement) -> egui::Response { resp } +/// The width of [`counts_text`]. +fn errors_text_width(ui: &Ui, c: &ErrorCounts) -> f32 { + let parts: Vec = [ + (c.inaccuracies, Judgement::Inaccuracy), + (c.mistakes, Judgement::Mistake), + (c.blunders, Judgement::Blunder), + ] + .iter() + .filter(|(n, _)| *n > 0) + .map(|(n, j)| format!("{n} {}", review::judgement_symbol(*j))) + .collect(); + text_width(ui, &parts.join(" · "), egui::TextStyle::Body) + 8.0 * parts.len() as f32 +} + /// "3 ? · 1 ??" in the colours of the signs (nothing when there are none). fn counts_text(ui: &mut Ui, c: &ErrorCounts) { let dark = ui.visuals().dark_mode; @@ -1078,6 +1224,13 @@ impl PrepScreen { others_open: HashSet::new(), open_families: HashSet::new(), open_repeated: HashSet::new(), + open_variations: HashSet::new(), + err_cursor: None, + book_fp: None, + book_fp_of: None, + show_inaccuracies: settings.prep.inaccuracies, + stacked: false, + low_window: false, selection: Selection::None, shown_pos: None, flipped: None, @@ -1174,11 +1327,174 @@ impl PrepScreen { } } } + // A book step of the report this one replaces is not this report's. + self.book_job = None; self.report = Some(report); self.rebuild_marks(); self.selection = Selection::None; self.shown_pos = None; self.games_cursor = None; + self.err_cursor = None; + } + + /// The same player asked for again from the dialog: its colour and book. + pub fn reopen(&mut self, side: ColorChoice, book: BookChoice) { + self.shown = true; + self.set_color(side); + if book != self.book { + self.book = book; + self.book_failed = None; + self.book_asked = None; + } + } + + fn set_color(&mut self, color: ColorChoice) { + self.color = color; + // A selection of a colour no longer shown is dropped. + let keep = match &self.selection { + Selection::None => true, + Selection::Node { white, .. } + | Selection::Opening { white, .. } + | Selection::Repeated { white, .. } + | Selection::Error { white, .. } => color.colours().contains(white), + }; + if !keep { + self.select(Selection::None); + } + } + + /// Another depth: the report of that depth from the cache, else built anew. + fn set_plies(&mut self, plies: usize, settings: &mut Settings, ctx: &egui::Context) { + if plies == self.plies { + return; + } + self.stop_engine(&mut Vec::new()); + self.save(); + self.plies = plies; + settings.prep.plies = plies; + self.report = None; + let options = Options { + plies, + side: Side::Any, + }; + let cached = cache_dir() + .as_deref() + .and_then(|d| PrepReport::load(d, &self.db, &self.player, &options)); + match cached { + Some(r) => self.take_report(r, settings), + None => self.rebuild(ctx), + } + } + + /// The report's book is the one chosen (else its column and line are not shown). + fn book_ok(&self) -> bool { + let Some(report) = &self.report else { + return false; + }; + self.book_fp.is_some() + && report.book.as_ref().map(|b| b.fingerprint) == self.book_fp + } + + /// The judgement is shown (inaccuracies can be hidden). + fn visible(&self, j: Judgement) -> bool { + self.show_inaccuracies || j != Judgement::Inaccuracy + } + + /// The counts as shown. + fn shown_counts(&self, c: &ErrorCounts) -> ErrorCounts { + let mut c = *c; + if !self.show_inaccuracies { + c.inaccuracies = 0; + } + c + } + + /// The engine run for the colour(s) shown. + fn engine_state(&self, settings: &Settings) -> EngineState { + if self.job.is_some() { + return EngineState::Running; + } + let Some(report) = &self.report else { + return EngineState::NotRun; + }; + if !report.evaluated() { + return EngineState::NotRun; + } + let side = self.color.side(); + let total = report.distinct_positions_for(side); + let missing = report.missing_for(settings.prep.nodes(), side); + if missing == 0 { + EngineState::Complete { total } + } else { + EngineState::Partial { + done: total - missing, + total, + } + } + } + + /// Judges the errors anew (`f` changes the evaluations): the lists of errors are + /// rebuilt, so a chosen error is found again in them by what it is, not by its + /// place (else the choice is dropped). + fn rejudge(&mut self, f: impl FnOnce(&mut PrepReport)) { + let Some(report) = self.report.as_mut() else { return }; + // What the selection and the errors tab's row are, by content. + let error_id = |r: &PrepReport, white: bool, i: usize| { + r.color(white).errors.get(i).map(|e| (e.game, e.ply)) + }; + let repeated_id = |r: &PrepReport, white: bool, i: usize| { + r.color(white).repeated.get(i).map(|x| (x.key, x.uci.clone())) + }; + let sel = match &self.selection { + Selection::Error { white, index } => error_id(report, *white, *index).map(|id| (*white, Ok(id))), + Selection::Repeated { white, index } => repeated_id(report, *white, *index).map(|id| (*white, Err(id))), + _ => None, + }; + let cursor = match self.err_cursor { + Some(ErrRow::Error { white, index }) => error_id(report, white, index).map(|id| (white, Ok(id))), + Some(ErrRow::Repeated { white, index }) => repeated_id(report, white, index).map(|id| (white, Err(id))), + _ => None, + }; + let open: Vec<(bool, (u64, String))> = self + .open_repeated + .iter() + .filter_map(|&(w, i)| repeated_id(report, w, i).map(|id| (w, id))) + .collect(); + f(report); + let find = |r: &PrepReport, white: bool, id: &Result<(u32, u32), (u64, String)>| -> Option { + match id { + Ok((game, ply)) => r.color(white).errors.iter().position(|e| e.game == *game && e.ply == *ply), + Err((key, uci)) => r.color(white).repeated.iter().position(|x| x.key == *key && x.uci == *uci), + } + }; + if let Some((white, id)) = &sel { + let found = find(report, *white, id); + self.selection = match (found, id) { + (Some(index), Ok(_)) => Selection::Error { white: *white, index }, + (Some(index), Err(_)) => Selection::Repeated { white: *white, index }, + (None, _) => Selection::None, + }; + if found.is_none() { + self.shown_pos = None; + } + } + if let Some((white, id)) = &cursor { + self.err_cursor = match (find(report, *white, id), id) { + (Some(index), Ok(_)) => Some(ErrRow::Error { white: *white, index }), + (Some(index), Err(_)) => Some(ErrRow::Repeated { white: *white, index }), + (None, _) => None, + }; + } else if matches!(self.err_cursor, Some(ErrRow::RepeatedGame { .. })) { + self.err_cursor = None; + } + self.open_repeated = open + .into_iter() + .filter_map(|(w, (key, uci))| { + let i = report.color(w).repeated.iter().position(|x| x.key == key && x.uci == uci)?; + Some((w, i)) + }) + .collect(); + self.rebuild_marks(); } /// The errors by node, for the tree and the hover texts. @@ -1216,6 +1532,7 @@ impl PrepScreen { None => self.error = Some(tr("The games could not be read").to_owned()), } } + self.show_inaccuracies = settings.prep.inaccuracies; if let Some((fp, job)) = &self.book_job && let Some(r) = job.poll() { @@ -1258,26 +1575,35 @@ impl PrepScreen { if self.book_job.is_some() || self.build.is_some() { return; } - let (book_db, same) = match &self.book { - BookChoice::None => return, - BookChoice::Same => (self.db.clone(), true), - BookChoice::Database(p) => { - let Some(d) = self.dbs.iter().find(|d| d.path == *p) else { - return; - }; - match &d.db { - Some(db) => (db.clone(), false), + let book = match &self.book { + BookChoice::None => None, + BookChoice::Same => Some((self.db.clone(), true)), + BookChoice::Database(p) => match self.dbs.iter().find(|d| d.path == *p) { + Some(d) => match &d.db { + Some(db) => Some((db.clone(), false)), None => { if d.failed.is_none() && self.book_asked.as_ref() != Some(p) { self.book_asked = Some(p.clone()); actions.push(PrepAction::LoadDb(p.clone())); } - return; + None } - } - } + }, + None => None, + }, }; - let fp = prep::fingerprint(&book_db); + let Some((book_db, same)) = book else { + self.book_fp = None; + self.book_fp_of = None; + return; + }; + // The fingerprint reads the file's data: once per book and database read. + let of = (self.book.clone(), Arc::as_ptr(&book_db) as usize); + if self.book_fp_of.as_ref() != Some(&of) { + self.book_fp = Some(prep::fingerprint(&book_db)); + self.book_fp_of = Some(of); + } + let Some(fp) = self.book_fp else { return }; if report.book.as_ref().is_some_and(|b| b.fingerprint == fp) || self.book_failed.as_ref().is_some_and(|(f, _)| *f == fp) { @@ -1300,9 +1626,10 @@ impl PrepScreen { /// The book's count in a position, when the book step looked at it. fn book_count(&self, key: u64) -> Option { - let report = self.report.as_ref()?; - report.book.as_ref()?; - report.book_counts.get(&key).copied() + if !self.book_ok() { + return None; + } + self.report.as_ref()?.book_counts.get(&key).copied() } // ----- the engine ---------------------------------------------------------------- @@ -1341,11 +1668,13 @@ impl PrepScreen { actions.push(PrepAction::NeedEngine); return; }; - let Some(report) = self.report.as_mut() else { return }; let nodes = settings.prep.nodes(); - if report.take_cached(&self.cache, nodes) > 0 { - self.dirty = true; - } + let cache = std::mem::take(&mut self.cache); + let mut taken = 0; + self.rejudge(|r| taken = r.take_cached(&cache, nodes)); + self.cache = cache; + self.dirty |= taken > 0; + let Some(report) = self.report.as_ref() else { return }; let targets = report.targets_for(nodes, self.color.side()); if targets.is_empty() { actions.push(PrepAction::Toast(tr("Every position is already evaluated").to_owned())); @@ -1442,10 +1771,9 @@ impl PrepScreen { } let now = ctx.input(|i| i.time); if self.pending_refresh && (ended || now - self.last_refresh > 1.0) { - report.refresh(); self.pending_refresh = false; self.last_refresh = now; - self.rebuild_marks(); + self.rejudge(PrepReport::refresh); } if ended { self.job = None; @@ -1454,13 +1782,15 @@ impl PrepScreen { } } + /// Stops the engine run (quitting): what was evaluated is kept. + pub fn stop(&mut self) { + self.stop_engine(&mut Vec::new()); + } + /// «Stop»: what was evaluated stays. fn stop_engine(&mut self, actions: &mut Vec) { if self.job.take().is_some() { - if let Some(r) = self.report.as_mut() { - r.refresh(); - } - self.rebuild_marks(); + self.rejudge(PrepReport::refresh); self.pending_refresh = false; self.save(); actions.push(PrepAction::EngineEnded); @@ -1549,13 +1879,13 @@ impl PrepScreen { .map_or(0, |r| r.distinct_positions_for(self.color.side())); ui.label(trf( "{n} positions, about {time}", - &[("n", &missing), ("time", &review::format_duration(secs))], + &[("n", &grouped(missing)), ("time", &review::format_duration(secs))], )); let cached = all.saturating_sub(missing); let note = if cached > 0 { trf( "identical positions are counted once; {n} already evaluated earlier", - &[("n", &cached)], + &[("n", &grouped(cached))], ) } else { tr("identical positions are counted once").to_owned() @@ -1736,13 +2066,14 @@ impl PrepScreen { .iter() .flat_map(|&w| report.color(w).games.iter().copied()) .collect(), - Selection::Node { white, node } => report - .color(*white) - .tree - .nodes - .get(*node as usize) - .map(|n| n.games.clone()) - .unwrap_or_default(), + // The games of the position, by any move order. + Selection::Node { white, node } => { + let tree = &report.color(*white).tree; + tree.nodes + .get(*node as usize) + .map(|n| tree.position_games(n.key)) + .unwrap_or_default() + } Selection::Opening { white, family, @@ -1780,6 +2111,24 @@ impl PrepScreen { self.shown_pos.as_ref().map_or(0, |s| s.ucis.len()) } + /// Where game `gi` reaches the chosen position: a node's position may come by + /// another move order (another ply) in some of its games. + fn game_ply(&self, gi: u32) -> usize { + if let (Selection::Node { white, node }, Some(report)) = (&self.selection, &self.report) + && let Some(n) = report.color(*white).tree.nodes.get(*node as usize) + && let Some(p) = report.games[gi as usize].keys.iter().position(|k| *k == n.key) + { + return p; + } + self.selection_ply() + } + + /// The move to open game `gi` at: the chosen position, or after the error. + fn open_ply(&self, gi: u32) -> usize { + let after = matches!(self.selection, Selection::Error { .. } | Selection::Repeated { .. }); + self.game_ply(gi) + usize::from(after) + } + /// The player's colour the board is seen from. fn board_white(&self) -> bool { let base = self @@ -1812,6 +2161,8 @@ impl PrepScreen { let (w, h) = (content.width(), content.height() - 44.0); let stacked = w < BOARD_MIN + 24.0 + RIGHT_MIN || h < 600.0; let low = stacked && h < 720.0; + self.stacked = stacked; + self.low_window = h < 600.0; egui::Panel::top("prep_controls").show(ui, |ui| { ui.add_space(4.0); self.controls(ui, settings, low, &mut actions); @@ -1827,7 +2178,10 @@ impl PrepScreen { ui.add_space(4.0); ui.horizontal(|ui| { ui.allocate_ui(vec2(240.0, 240.0), |ui| self.board(ui, settings, 240.0)); - ui.vertical(|ui| self.board_info(ui, &mut actions)); + ui.vertical(|ui| { + self.board_caption(ui); + self.board_info(ui, &mut actions); + }); }); ui.add_space(4.0); }); @@ -1925,29 +2279,33 @@ impl PrepScreen { /// The colour switch, the book, the depth and the engine button or its progress. fn controls(&mut self, ui: &mut Ui, settings: &mut Settings, low: bool, actions: &mut Vec) { let width = ui.available_width(); + let gap = ui.spacing().item_spacing.x; + let pad = 2.0 * ui.spacing().button_padding.x; + let state = self.engine_state(settings); + // The engine part on the right is measured first: the rest gets what it leaves. + let engine = self.engine_texts(settings, state, width); + let engine_w = match &engine { + EngineTexts::Running => (width * 0.35).clamp(90.0, 360.0) + text_width(ui, tr("Stop"), egui::TextStyle::Button) + pad + 2.0 * gap, + EngineTexts::Button { label, note } | EngineTexts::Done { label, note } => { + text_width(ui, label, egui::TextStyle::Button) + + pad + + note.as_deref().map_or(0.0, |n| text_width(ui, n, egui::TextStyle::Body) + gap) + + gap + } + } + 26.0 + gap; ui.horizontal(|ui| { for choice in [ColorChoice::White, ColorChoice::Black, ColorChoice::Both] { - if ui.selectable_value(&mut self.color, choice, choice.label()).clicked() { - // A selection of a colour no longer shown is dropped. - let keep = match &self.selection { - Selection::None => true, - Selection::Node { white, .. } - | Selection::Opening { white, .. } - | Selection::Repeated { white, .. } - | Selection::Error { white, .. } => self.color.colours().contains(white), - }; - if !keep { - self.select(Selection::None); - } + if ui.selectable_label(self.color == choice, choice.label()).clicked() { + self.set_color(choice); } } ui.separator(); - let book_w = if width < 900.0 { 150.0 } else { 240.0 }; - if width >= 640.0 { + let caption_apart = width >= 640.0; + if caption_apart { ui.label(tr("Book")); } - let own_name = self.db_name.clone(); - if let Some(b) = book_picker(ui, "prep_book", &self.book, &self.path, &own_name, &self.dbs, book_w) { + let book_w = if width < 900.0 { 150.0 } else { 240.0 }; + if let Some(b) = book_picker(ui, "prep_book", &self.book, &self.path, &self.dbs, book_w, !caption_apart) { self.book = b; self.book_failed = None; self.book_asked = None; @@ -1955,15 +2313,22 @@ impl PrepScreen { actions.push(PrepAction::SettingsChanged); } if let Some((_, why)) = &self.book_failed { - ui.label(RichText::new(trf("Book: could not open — {reason}", &[("reason", why)])).color(ui.visuals().warn_fg_color)); + ui.label(RichText::new("⚠").color(ui.visuals().warn_fg_color)) + .on_hover_text(trf("Book: could not open — {reason}", &[("reason", why)])); } ui.separator(); + // The depth's caption by the room left: «Opening: 10 moves», «10 moves», «10 m.». let moves = self.plies.div_ceil(2); - let depth_label = if width < 760.0 { - format!("{moves}") - } else { - trf("Opening: {n} moves", &[("n", &moves)]) - }; + let board_w = if low { text_width(ui, "♙", egui::TextStyle::Button) + pad + 2.0 * gap } else { 0.0 }; + let room = ui.available_width() - engine_w - board_w; + let depth_label = [ + trf("Opening: {n} moves", &[("n", &moves)]), + trf("{n} moves", &[("n", &moves)]), + trf("{n} m.", &[("n", &moves)]), + ] + .into_iter() + .find(|l| text_width(ui, l, egui::TextStyle::Button) + pad + 20.0 + gap <= room) + .unwrap_or_else(|| trf("{n} m.", &[("n", &moves)])); let mut new_plies = None; egui::ComboBox::from_id_salt("prep_plies") .selected_text(depth_label) @@ -1979,31 +2344,14 @@ impl PrepScreen { }) .response .on_hover_text(tr("How deep the tree and the engine look")); - if let Some(p) = new_plies.filter(|p| *p != self.plies) { - self.plies = p; - settings.prep.plies = p; + if let Some(p) = new_plies { + self.set_plies(p, settings, ui.ctx()); actions.push(PrepAction::SettingsChanged); - self.save(); - self.report = None; - let dir = cache_dir(); - let options = Options { - plies: p, - side: Side::Any, - }; - let cached = dir - .as_deref() - .and_then(|d| PrepReport::load(d, &self.db, &self.player, &options)); - match cached { - Some(r) => self.take_report(r, settings), - None => self.rebuild(ui.ctx()), - } - self.selection = Selection::None; - self.shown_pos = None; } if low { ui.separator(); if ui - .selectable_label(self.board_popup, if width < 760.0 { "♙" } else { tr("♙ Board") }) + .selectable_label(self.board_popup, "♙") .on_hover_text(tr("The board of the chosen position")) .clicked() { @@ -2011,13 +2359,63 @@ impl PrepScreen { } } ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { - self.engine_control(ui, settings, width, actions); + self.engine_control(ui, settings, engine, width, actions); }); }); } - /// The engine button, the progress while it runs, the state after. - fn engine_control(&mut self, ui: &mut Ui, settings: &Settings, width: f32, actions: &mut Vec) { + /// What the engine part of the controls says, by the room there is. + fn engine_texts(&self, settings: &Settings, state: EngineState, width: f32) -> EngineTexts { + let (missing, secs) = self.estimate(settings); + let time = review::format_duration(secs); + match state { + EngineState::Running => EngineTexts::Running, + EngineState::NotRun => EngineTexts::Button { + label: if width < 700.0 { + format!("▶ ≈ {time}") + } else if width < 900.0 { + trf("▶ Errors ≈ {time}", &[("time", &time)]) + } else { + trf("▶ Find opening errors ≈ {time}", &[("time", &time)]) + }, + note: None, + }, + EngineState::Partial { done, total } => EngineTexts::Button { + label: if width < 700.0 { + format!("▶ ≈ {time}") + } else { + trf("Continue ≈ {time}", &[("time", &time)]) + }, + note: (width >= 900.0).then(|| { + trf( + "Checked {done} of {total} positions", + &[("done", &grouped(done)), ("total", &grouped(total))], + ) + }), + }, + EngineState::Complete { .. } => { + let _ = missing; + EngineTexts::Done { + label: tr("Errors found").to_owned(), + note: None, + } + } + } + } + + /// The engine button, the progress while it runs, the state after; «▾» (the + /// options) at the right end. + fn engine_control( + &mut self, + ui: &mut Ui, + settings: &Settings, + texts: EngineTexts, + width: f32, + actions: &mut Vec, + ) { + if ui.button("▾").on_hover_text(tr("Options…")).clicked() { + self.dialog_open = true; + } if let Some(job) = &self.job { let (done, total) = (job.done, job.total); if ui.button(tr("Stop")).on_hover_text("Shift+A").clicked() { @@ -2028,11 +2426,11 @@ impl PrepScreen { let per_thread = self.nps_per_thread.unwrap_or(review::DEFAULT_NPS); let secs = review::estimate_secs(left, job.nodes, per_thread, job.threads); let text = if width < 760.0 { - format!("{done}/{total}") + format!("{}/{}", grouped(done), grouped(total)) } else { trf( "Finding errors: {done} of {total} positions · ≈ {time}", - &[("done", &done), ("total", &total), ("time", &review::format_duration(secs))], + &[("done", &grouped(done)), ("total", &grouped(total)), ("time", &review::format_duration(secs))], ) }; ui.add( @@ -2043,44 +2441,23 @@ impl PrepScreen { return; } let Some(report) = &self.report else { return }; - let (missing, secs) = self.estimate(settings); - let time = review::format_duration(secs); - let done_before = report.engine.is_some(); - let label = if missing == 0 && done_before { - tr("Errors found").to_owned() - } else if width < 700.0 { - format!("▶ ≈ {time}") - } else if width < 900.0 { - trf("▶ Errors ≈ {time}", &[("time", &time)]) - } else if done_before { - trf("Analyse {n} more positions ≈ {time}", &[("n", &missing), ("time", &time)]) - } else { - trf("▶ Find opening errors ≈ {time}", &[("time", &time)]) - }; - let hint = match &report.engine { - Some(e) => { - let quality = REVIEW_QUALITY - .iter() - .find(|q| q.1 == e.nodes) - .map_or_else(|| review::format_count(e.nodes), |q| tr(q.0).to_owned()); - trf( - "Errors found · {engine} · {quality} · {n} positions", - &[("engine", &e.name), ("quality", &quality), ("n", &report.evals.len())], - ) + let hint = self.engine_status(settings).unwrap_or_else(|| { + tr("The engine finds the opening errors in his games (Shift+A)").to_owned() + }); + let _ = report; + match texts { + EngineTexts::Done { label, .. } => { + ui.label(RichText::new(label).weak()).on_hover_text(hint); } - None => tr("The engine finds the opening errors in his games (Shift+A)").to_owned(), - }; - if missing == 0 && done_before { - ui.label(RichText::new(label).weak()).on_hover_text(hint); - } else if crate::widgets::primary(ui, &label).on_hover_text(hint).clicked() { - self.engine_asked(settings, ui.ctx(), actions); - } - if ui - .button("▾") - .on_hover_text(tr("Options…")) - .clicked() - { - self.dialog_open = true; + EngineTexts::Button { label, note } => { + if crate::widgets::primary(ui, &label).on_hover_text(hint).clicked() { + self.engine_asked(settings, ui.ctx(), actions); + } + if let Some(n) = note { + ui.label(RichText::new(n).weak()); + } + } + EngineTexts::Running => {} } if let Some(e) = &self.error { ui.label(RichText::new("⚠").color(ui.visuals().error_fg_color)) @@ -2088,91 +2465,155 @@ impl PrepScreen { } } - /// A line per colour: games, score, opponents, the last game, the book. + /// «Errors found · Stockfish 19 · Fast · 2 947 positions», once evaluated. + fn engine_status(&self, settings: &Settings) -> Option { + let report = self.report.as_ref()?; + if !report.evaluated() { + return None; + } + let nodes = report.engine.as_ref().map_or(settings.prep.nodes(), |e| e.nodes); + let quality = REVIEW_QUALITY + .iter() + .find(|q| q.1 == nodes) + .map_or_else(|| review::format_count(nodes), |q| tr(q.0).to_owned()); + let n = grouped(report.distinct_positions_for(self.color.side())); + Some(match report.engine.as_ref().filter(|e| !e.name.is_empty()) { + Some(e) => trf( + "Errors found · {engine} · {quality} · {n} positions", + &[("engine", &e.name), ("quality", &quality), ("n", &n)], + ), + None => trf( + "Errors found · {quality} · {n} positions", + &[("quality", &quality), ("n", &n)], + ), + }) + } + + /// The summary: a row per colour in columns — colour, games, score, opponents, + /// the last game, the book, the errors; the columns give way from the right (the + /// last game, the book, the opponents) instead of wrapping. fn summary(&self, ui: &mut Ui, stacked: bool) { let Some(report) = &self.report else { return }; let colours = if stacked { self.color.colours() } else { vec![true, false] }; - for white in colours { + let evaluated = report.evaluated() && !stacked; + let book = self.book_ok(); + // Texts per colour: [games, score, opponents, last, book]. + let mut rows: Vec<(bool, [String; 5], ErrorCounts, usize)> = Vec::new(); + for &white in &colours { let cr = report.color(white); - let tally = &cr.tree.nodes[0].tally; - let weak = !self.color.colours().contains(&white); + let root = &cr.tree.nodes[0]; + let tally = &root.tally; let title = if white { tr("As White") } else { tr("As Black") }; - ui.horizontal_wrapped(|ui| { - let text = |ui: &mut Ui, s: String| { - let rt = RichText::new(s); - ui.label(if weak { rt.weak() } else { rt }); - }; - text(ui, format!("{title} {}", tally.games)); - if tally.games == 0 { - return; - } - text(ui, format!("· {} ({})", score_text(tally), tally_hint(tally))); - if !stacked { - if let Some(elo) = cr.tree.nodes[0].average_elo() { - text(ui, format!("· {}", trf("opponents ≈ {elo}", &[("elo", &elo)]))); - } - let last = crate::library::display_date(&cr.tree.nodes[0].last_date); - if !last.is_empty() { - text(ui, format!("· {}", trf("last {date}", &[("date", &last)]))); - } - } - if report.book.is_some() { - let mut plies: Vec = cr - .games - .iter() - .filter_map(|&g| report.games[g as usize].book.map(|b| b.ply)) - .collect(); - if !plies.is_empty() { - plies.sort_unstable(); - let median = plies[plies.len() / 2]; + let games = format!("{title} {}", tally.games); + let score = if tally.games > 0 { + format!("{} ({})", score_text(tally), tally_hint(tally)) + } else { + String::new() + }; + let opponents = root + .average_elo() + .map(|elo| trf("opponents ≈ {elo}", &[("elo", &elo)])) + .unwrap_or_default(); + let last = crate::library::display_date(&root.last_date); + let last = if last.is_empty() { String::new() } else { trf("last {date}", &[("date", &last)]) }; + let book_text = if book { + let mut plies: Vec = cr + .games + .iter() + .filter_map(|&g| report.games[g as usize].book.map(|b| b.ply)) + .collect(); + plies.sort_unstable(); + match plies.get(plies.len() / 2) { + Some(median) => { let (own, other) = cr.book_exits(&report.games); let p = 100 * own / (own + other).max(1); - text( - ui, - format!( - "· {}", - trf( - "leaves the book at move {n}, first in {p} % of games", - &[("n", &median.div_ceil(2).max(1)), ("p", &p)] - ) - ), - ); + trf( + "leaves the book at move {n}, first in {p} % of games", + &[("n", &median.div_ceil(2).max(1)), ("p", &p)], + ) } - } else if self.book_job.is_some() { - text(ui, format!("· {}", tr("book…"))); + None => String::new(), } - if !stacked && report.engine.is_some() && cr.counts.total() > 0 { - let games_with: HashSet = cr.errors.iter().map(|e| e.game).collect(); - let n = games_with.len(); - let p = 100 * n / cr.games.len().max(1); - let c = &cr.counts; - ui.label(RichText::new("·").weak()); - let line = trf( - "Opening errors: {i} inaccuracies · {m} mistakes · {b} blunders — in {g} games ({p} %)", - &[ - ("i", &c.inaccuracies), - ("m", &c.mistakes), - ("b", &c.blunders), - ("g", &n), - ("p", &p), - ], - ); - let rt = RichText::new(line); - ui.label(if weak { rt.weak() } else { rt }); + } else if self.book_job.is_some() { + tr("book…").to_owned() + } else { + String::new() + }; + let with_errors: HashSet = cr + .errors + .iter() + .filter(|e| self.visible(e.judgement)) + .map(|e| e.game) + .collect(); + let p = 100 * with_errors.len() / cr.games.len().max(1); + rows.push((white, [games, score, opponents, last, book_text], self.shown_counts(&cr.counts), p)); + } + // Which columns fit: the errors stay; last, book, opponents give way in turn. + let gap = 14.0; + let col_w = |k: usize| -> f32 { + rows.iter() + .map(|r| text_width(ui, &r.1[k], egui::TextStyle::Body)) + .fold(0.0, f32::max) + }; + let errors_w = if evaluated { + rows.iter() + .map(|(_, _, c, p)| { + errors_text_width(ui, c) + text_width(ui, &trf("in {p} % of games", &[("p", p)]), egui::TextStyle::Body) + 12.0 + }) + .fold(0.0, f32::max) + } else { + 0.0 + }; + let width = ui.available_width(); + let mut shown = [true; 5]; + let used = |shown: &[bool; 5]| -> f32 { + (0..5).filter(|&k| shown[k]).map(|k| col_w(k) + gap).sum::() + errors_w + }; + for k in [3, 4, 2, 1] { + if used(&shown) <= width { + break; + } + shown[k] = false; + } + egui::Grid::new("prep_summary") + .num_columns(6) + .spacing(vec2(gap, 2.0)) + .show(ui, |ui| { + for (white, texts, counts, p) in &rows { + let weak = !self.color.colours().contains(white); + for k in 0..5 { + if !shown[k] { + continue; + } + let rt = RichText::new(&texts[k]); + let rt = if k == 0 { rt.strong() } else { rt }; + ui.label(if weak { rt.weak() } else { rt }); + } + if evaluated { + ui.horizontal(|ui| { + ui.spacing_mut().item_spacing.x = 4.0; + if counts.total() > 0 { + counts_text(ui, counts); + ui.label(RichText::new(trf("in {p} % of games", &[("p", p)])).weak()); + } else { + ui.label(RichText::new(tr("no errors")).weak()); + } + }); + } + ui.end_row(); } }); - } - let shown: usize = self + let n: usize = self .color .colours() .iter() .map(|&w| report.color(w).games.len()) .sum(); - if shown > 0 && shown < 10 { + if n > 0 && n < 10 { ui.label( RichText::new(trf( "Few games ({n}): percentages and scores are unreliable", - &[("n", &shown)], + &[("n", &n)], )) .color(ui.visuals().warn_fg_color), ); @@ -2298,7 +2739,12 @@ impl PrepScreen { ui.label(RichText::new(tr("Start position")).weak()); } for (i, san) in s.sans.iter().enumerate() { - let label = short_label(i, san); + // Numbers at White's moves only: «1.e4 c5 2.Nf3 d6». + let label = if i.is_multiple_of(2) { + short_label(i, san) + } else { + crate::san::show(san).into_owned() + }; let current = i + 1 == s.ply; let text = if current { RichText::new(label).strong() @@ -2443,11 +2889,13 @@ impl PrepScreen { fn right_column(&mut self, ui: &mut Ui, settings: &mut Settings, actions: &mut Vec) { let height = ui.available_height(); let width = ui.available_width(); - let least = 4.0 * ROW_H + 60.0; + // In a low window the tabs keep the most: two rows of games at least, a quarter. + let (rows, share) = if self.low_window { (2.0, 0.25) } else { (4.0, 0.35) }; + let least = rows * ROW_H + 60.0; let most = (height - 160.0).max(least); let games_h = self .games_height - .unwrap_or(height * 0.35) + .unwrap_or(height * share) .clamp(least, most) .floor(); let tabs_h = (height - games_h - 10.0).max(0.0); @@ -2637,7 +3085,7 @@ impl PrepScreen { let Some(report) = self.report.as_ref() else { return }; let width = ui.available_width(); let gap = ui.spacing().item_spacing.x; - let has_book = report.book.is_some() || self.book_job.is_some(); + let has_book = self.book_ok() || (self.book_job.is_some() && self.book != BookChoice::None); let mut used = 180.0 + 56.0 + 40.0 + 50.0 + 4.0 * gap; let mut fits = |w: f32, wanted: bool| { let ok = wanted && used + w + gap <= width; @@ -2713,7 +3161,14 @@ impl PrepScreen { if ui.add(egui::Label::new(RichText::new(glyph).weak()).sense(Sense::click())).clicked() { toggled = Some(r); } - ui.label(RichText::new(trf("other moves ({n})", &[("n", &count)])).weak()); + // Short when the column is narrow at this depth. + let full = trf("other moves ({n})", &[("n", &count)]); + let text = if text_width(ui, &full, egui::TextStyle::Body) > ui.available_width() { + trf("others ({n})", &[("n", &count)]) + } else { + full + }; + ui.label(RichText::new(text).weak()); }); let rest = 2 + usize::from(show_opening) + 1 + usize::from(show_last) + usize::from(show_book); for _ in 0..rest { @@ -2726,7 +3181,9 @@ impl PrepScreen { let parent = n.parent.map(|p| &cr.tree.nodes[p as usize]); let has_children = !n.children.is_empty(); let open = self.expanded.contains(&(white, node)); - let few = n.tally.games < FEW_GAMES; + // The statistics are the position's, whatever the move order. + let tally = cr.tree.position_tally(n.key); + let few = tally.games < FEW_GAMES; row.col(|ui| { ui.add_space(depth as f32 * 14.0); let glyph = if !has_children { " " } else if open { "▾" } else { "▸" }; @@ -2744,7 +3201,9 @@ impl PrepScreen { let label = short_label(ply, &n.san); let text = if players { RichText::new(label) } else { RichText::new(label).weak() }; let l = ui.add(egui::Label::new(text).truncate()); - if !show_opening && let Some(o) = n.opening.filter(|_| n.named).and_then(|o| report.openings.get(o)) { + if !show_opening + && let Some(o) = n.opening.filter(|_| n.named).and_then(|o| report.openings.get(o)) + { l.on_hover_text(format!("{} · {}", o.name, o.eco)); } if n.transposition { @@ -2763,16 +3222,18 @@ impl PrepScreen { } if let Some(p) = parent && let Some(m) = self.mark_of(white, p.key, &n.uci) + && self.visible(m.judgement) { let best = crate::san::show(&m.best_san).into_owned(); - pill(ui, m.judgement).on_hover_text(format!( - "{}: {}", - review::judgement_name(m.judgement), - trf( - "Mistake: better {best} ({before} → {after}) · in {n} games", - &[("best", &best), ("before", &m.before.format()), ("after", &m.after.format()), ("n", &m.games)], - ) - .trim_start_matches(&format!("{}: ", tr("Mistake"))) + pill(ui, m.judgement).on_hover_text(trf( + "{judgement}: better {best} ({before} → {after}) · in {n} games", + &[ + ("judgement", &review::judgement_name(m.judgement)), + ("best", &best), + ("before", &m.before.format()), + ("after", &m.after.format()), + ("n", &m.games), + ], )); if m.games > 1 { ui.label(RichText::new(format!("×{}", m.games)).weak().small()); @@ -2781,24 +3242,25 @@ impl PrepScreen { }); if show_opening { row.col(|ui| { - // The name where it first appears (the table names - // 2.Nf3 «Sicilian Defense» again: not repeated). - let new_name = n.named - && parent.is_none_or(|p| { - p.opening.map(|o| report.openings[o].name.as_str()) - != n.opening.map(|o| report.openings[o].name.as_str()) + // The name where it changes (`named`); the ECO keeps + // its place at the right, the name takes the rest. + if n.named && let Some(o) = n.opening.and_then(|o| report.openings.get(o)) { + let eco = RichText::new(&o.eco).weak().small(); + let eco_w = text_width(ui, &o.eco, egui::TextStyle::Small) + ui.spacing().item_spacing.x; + let name_w = (ui.available_width() - eco_w).max(0.0); + ui.allocate_ui(vec2(name_w, ROW_H), |ui| { + ui.add(egui::Label::new(RichText::new(&o.name).weak()).truncate()) + .on_hover_text(format!("{} · {}", o.name, o.eco)); }); - if new_name && let Some(o) = n.opening.and_then(|o| report.openings.get(o)) { - ui.add(egui::Label::new(RichText::new(&o.name).weak()).truncate()) - .on_hover_text(format!("{} · {}", o.name, o.eco)); - ui.label(RichText::new(&o.eco).weak().small()); + ui.label(eco); } }); } row.col(|ui| { - ui.label(n.tally.games.to_string()); + ui.label(tally.games.to_string()); }); row.col(|ui| { + // The move's share where the games were (this order). if let Some(p) = parent { let pct = 100 * n.tally.games / p.tally.games.max(1); let t = RichText::new(format!("{pct}")); @@ -2809,19 +3271,16 @@ impl PrepScreen { } }); row.col(|ui| { - let t = RichText::new(score_text(&n.tally)); + let t = RichText::new(score_text(&tally)); let l = ui.label(if few { t.weak() } else { t }); - l.on_hover_text(tally_hint(&n.tally)); + l.on_hover_text(tally_hint(&tally)); if show_bar { - let (rect, _) = ui.allocate_exact_size(vec2(56.0, 14.0), Sense::hover()); - let painter_alpha = if few { 0.5 } else { 1.0 }; - let _ = painter_alpha; - board_search::results_bar(ui, rect, &bar_tally(&n.tally, white), ui.visuals().text_color()); + score_bar(ui, &tally, white, few); } }); if show_last { row.col(|ui| { - let d = crate::library::display_date(&n.last_date); + let d = crate::library::display_date(cr.tree.position_last_date(n.key)); ui.label(RichText::new(if d.is_empty() { "—".to_owned() } else { d }).weak()); }); } @@ -2949,7 +3408,7 @@ impl PrepScreen { let both = self.color == ColorChoice::Both; let width = ui.available_width(); let gap = ui.spacing().item_spacing.x; - let mut used = 200.0 + 56.0 + 40.0 + 50.0 + 4.0 * gap + if both { 90.0 + gap } else { 0.0 }; + let mut used = 180.0 + 56.0 + 40.0 + 50.0 + 4.0 * gap + if both { 24.0 + gap } else { 0.0 }; let mut fits = |w: f32, wanted: bool| { let ok = wanted && used + w + gap <= width; if ok { @@ -2958,11 +3417,11 @@ impl PrepScreen { ok }; // The errors stay as long as possible; the first moves give way first. - let show_errors = fits(90.0, report.engine.is_some()); + let show_errors = fits(90.0, report.evaluated()); let show_bar = fits(64.0, true); let show_eco = fits(64.0, true); let show_last = fits(84.0, true); - let show_moves = fits(160.0, true); + let show_moves = fits(140.0, true); ui.style_mut().interaction.selectable_labels = false; let mut table = TableBuilder::new(ui) .id_salt("prep_openings") @@ -2971,14 +3430,14 @@ impl PrepScreen { .auto_shrink([false, false]) .cell_layout(egui::Layout::left_to_right(egui::Align::Center)); if both { - table = table.column(Column::exact(90.0)); + table = table.column(Column::exact(24.0)); } - table = table.column(Column::remainder().at_least(200.0).clip(true)); + table = table.column(Column::remainder().at_least(180.0).clip(true)); if show_eco { table = table.column(Column::exact(64.0)); } if show_moves { - table = table.column(Column::remainder().at_least(160.0).clip(true)); + table = table.column(Column::remainder().at_least(140.0).clip(true)); } table = table.column(Column::exact(56.0)).column(Column::exact(40.0)); table = table.column(Column::exact(if show_bar { 110.0 } else { 50.0 })); @@ -3002,7 +3461,7 @@ impl PrepScreen { table .header(ROW_H, |mut h| { if both { - head_col(&mut h, tr("Colour"), ""); + head_col(&mut h, "", ""); } head_col(&mut h, tr("Opening"), ""); if show_eco { @@ -3012,7 +3471,7 @@ impl PrepScreen { head_col(&mut h, tr("First moves"), ""); } head_col(&mut h, tr("Games"), ""); - head_col(&mut h, "%", ""); + head_col(&mut h, "%", tr("Share of the colour's games; a variation's — of its family's")); head_col(&mut h, tr("Score"), tr("The opponent's points in these games")); if show_last { head_col(&mut h, tr("Last"), ""); @@ -3039,7 +3498,8 @@ impl PrepScreen { if both { row.col(|ui| { if v.is_none() { - ui.label(RichText::new(if white { tr("♙ White") } else { tr("♟ Black") }).weak()); + ui.label(RichText::new(if white { "♙" } else { "♟" }).weak()) + .on_hover_text(if white { tr("As White") } else { tr("As Black") }); } }); } @@ -3101,9 +3561,10 @@ impl PrepScreen { None => family_line(report, fam), }; if let Some(l) = line { - let shown = crate::san::show_line(&shorten_middle(&l, 40)); - ui.add(egui::Label::new(RichText::new(shown).weak()).truncate()) - .on_hover_text(crate::san::show_line(&l)); + let tokens = table_line(&l); + let full = crate::san::show_line(&tokens.join(" ")); + let shown = fit_line(ui, &tokens, ui.available_width()); + ui.label(RichText::new(shown).weak()).on_hover_text(full); } }); } @@ -3123,8 +3584,7 @@ impl PrepScreen { let t = RichText::new(score_text(tally)); ui.label(if few { t.weak() } else { t }).on_hover_text(tally_hint(tally)); if show_bar { - let (rect, _) = ui.allocate_exact_size(vec2(56.0, 14.0), Sense::hover()); - board_search::results_bar(ui, rect, &bar_tally(tally, white), ui.visuals().text_color()); + score_bar(ui, tally, white, few); } }); if show_last { @@ -3141,7 +3601,7 @@ impl PrepScreen { if show_errors { row.col(|ui| { ui.spacing_mut().item_spacing.x = 4.0; - counts_text(ui, errors); + counts_text(ui, &self.shown_counts(errors)); }); } let resp = row.response(); @@ -3164,10 +3624,11 @@ impl PrepScreen { // ----- the errors ---------------------------------------------------------------- - fn errors_tab(&mut self, ui: &mut Ui, settings: &Settings, actions: &mut Vec) { + fn errors_tab(&mut self, ui: &mut Ui, settings: &mut Settings, actions: &mut Vec) { let Some(report) = self.report.as_ref() else { return }; let moves = self.plies.div_ceil(2); - if report.engine.is_none() && self.job.is_none() { + let state = self.engine_state(settings); + if state == EngineState::NotRun { // The invitation (§5). let (positions, secs) = self.estimate(settings); let games: usize = self.color.colours().iter().map(|&w| report.color(w).games.len()).sum(); @@ -3185,7 +3646,7 @@ impl PrepScreen { ("n", &moves), ("games", &games), ("colour", &colour), - ("positions", &positions), + ("positions", &grouped(positions)), ("time", &review::format_duration(secs)), ], )); @@ -3196,56 +3657,72 @@ impl PrepScreen { }); return; } - let dark = ui.visuals().dark_mode; let (mut ask_engine, mut open_dialog) = (false, false); - // The state line and the summary per colour. + let mut inaccuracies = settings.prep.inaccuracies; + // The state line: how far the engine got; the switch of the inaccuracies. ui.horizontal_wrapped(|ui| { - match (&self.job, &report.engine) { - (Some(job), _) => { - let left = job.total.saturating_sub(job.done); - let per_thread = self.nps_per_thread.unwrap_or(review::DEFAULT_NPS); - let secs = review::estimate_secs(left, job.nodes, per_thread, job.threads); + match state { + EngineState::Running => { + if let Some(job) = &self.job { + let left = job.total.saturating_sub(job.done); + let per_thread = self.nps_per_thread.unwrap_or(review::DEFAULT_NPS); + let secs = review::estimate_secs(left, job.nodes, per_thread, job.threads); + ui.label( + RichText::new(trf( + "Checked {done} of {total} positions", + &[("done", &grouped(job.done)), ("total", &grouped(job.total))], + )) + .weak(), + ); + ui.label(RichText::new(format!("· ≈ {}", review::format_duration(secs))).weak()); + } + } + EngineState::Partial { done, total } => { + let (_, secs) = self.estimate(settings); ui.label( RichText::new(trf( "Checked {done} of {total} positions", - &[("done", &job.done), ("total", &job.total)], + &[("done", &grouped(done)), ("total", &grouped(total))], )) .weak(), - ); - ui.label(RichText::new(format!("· ≈ {}", review::format_duration(secs))).weak()); + ) + .on_hover_text(tr("The counts are of the checked positions")); + ui.label(RichText::new("·").weak()); + if ui + .link(trf("Continue ≈ {time}", &[("time", &review::format_duration(secs))])) + .clicked() + { + ask_engine = true; + } } - (None, Some(e)) => { - let quality = REVIEW_QUALITY - .iter() - .find(|q| q.1 == e.nodes) - .map_or_else(|| review::format_count(e.nodes), |q| tr(q.0).to_owned()); - ui.label( - RichText::new(trf( - "Errors found · {engine} · {quality} · {n} positions", - &[("engine", &e.name), ("quality", &quality), ("n", &report.evals.len())], - )) - .weak(), - ); - let (missing, secs) = self.estimate(settings); - if missing > 0 { - ui.label(RichText::new("·").weak()); - if ui - .link(trf("Analyse {n} more positions ≈ {time}", &[("n", &missing), ("time", &review::format_duration(secs))])) - .clicked() - { - ask_engine = true; - } + EngineState::Complete { .. } => { + if let Some(status) = self.engine_status(settings) { + ui.label(RichText::new(status).weak()); } if settings.prep.quality == 0 { ui.label(RichText::new("·").weak()); - if ui.link(tr("More precisely…")).on_hover_text(tr("The same positions at «Normal» quality")).clicked() { + if ui + .link(tr("More precisely…")) + .on_hover_text(tr("The same positions at «Normal» quality")) + .clicked() + { open_dialog = true; } } } - (None, None) => {} + EngineState::NotRun => {} } + ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { + ui.checkbox(&mut inaccuracies, tr("Inaccuracies")) + .on_hover_text(tr("Show the inaccuracies (?!) with the mistakes and blunders")); + }); }); + if inaccuracies != settings.prep.inaccuracies { + settings.prep.inaccuracies = inaccuracies; + self.show_inaccuracies = inaccuracies; + self.rebuild_marks(); + actions.push(PrepAction::SettingsChanged); + } if ask_engine { self.engine_asked(settings, ui.ctx(), actions); return; @@ -3254,32 +3731,20 @@ impl PrepScreen { self.dialog_open = true; } let Some(report) = self.report.as_ref() else { return }; - for white in self.color.colours() { - let cr = report.color(white); - let games_with: HashSet = cr.errors.iter().map(|e| e.game).collect(); - let c = &cr.counts; - let title = if white { tr("As White") } else { tr("As Black") }; - let p = 100 * games_with.len() / cr.games.len().max(1); - ui.horizontal_wrapped(|ui| { - ui.label(RichText::new(format!("{title}:")).strong()); - let text = trf( - "{i} inaccuracies · {m} mistakes · {b} blunders — in {g} games of {t} ({p} %)", - &[ - ("i", &c.inaccuracies), - ("m", &c.mistakes), - ("b", &c.blunders), - ("g", &games_with.len()), - ("t", &cr.games.len()), - ("p", &p), - ], - ); - let l = ui.label(text); - if self.job.is_some() { - l.on_hover_text(tr("of the checked positions")); - } - }); + // The lines per colour: in the stack only (beside the board the summary has them). + if self.stacked { + for white in self.color.colours() { + let cr = report.color(white); + let with: HashSet = cr.errors.iter().filter(|e| self.visible(e.judgement)).map(|e| e.game).collect(); + let p = 100 * with.len() / cr.games.len().max(1); + ui.horizontal_wrapped(|ui| { + ui.spacing_mut().item_spacing.x = 4.0; + ui.label(RichText::new(if white { tr("As White") } else { tr("As Black") }).strong()); + counts_text(ui, &self.shown_counts(&cr.counts)); + ui.label(RichText::new(trf("in {p} % of games", &[("p", &p)])).weak()); + }); + } } - let total_errors: u32 = self.color.colours().iter().map(|&w| report.color(w).counts.total()).sum(); let serious: u32 = self .color .colours() @@ -3289,269 +3754,401 @@ impl PrepScreen { c.mistakes + c.blunders }) .sum(); - if self.job.is_none() && serious == 0 { + let inacc: u32 = self.color.colours().iter().map(|&w| report.color(w).counts.inaccuracies).sum(); + if matches!(state, EngineState::Complete { .. }) && serious == 0 { + let mut deeper = false; ui.add_space(8.0); ui.horizontal_wrapped(|ui| { - ui.label(trf("No errors in the first {n} moves ({i} inaccuracies).", &[("n", &moves), ("i", &(total_errors - serious))])); + ui.label(trf("No errors in the first {n} moves ({i} inaccuracies).", &[("n", &moves), ("i", &inacc)])); if self.plies < 30 && ui.link(trf("Deeper: {n} moves", &[("n", &15)])).clicked() { - // The depth picker's choice, as if chosen there. - self.plies = 30; - self.report = None; - self.rebuild(ui.ctx()); - actions.push(PrepAction::SettingsChanged); + deeper = true; } }); - if total_errors == 0 { + if deeper { + // As if chosen in the depth list. + self.set_plies(30, settings, ui.ctx()); + actions.push(PrepAction::SettingsChanged); return; } } - ui.add_space(6.0); - let both = self.color == ColorChoice::Both; - egui::ScrollArea::vertical() - .id_salt("prep_errors") - .auto_shrink([false, false]) - .show(ui, |ui| { - ui.style_mut().interaction.selectable_labels = false; - self.repeated_list(ui, both, dark, actions); - ui.add_space(10.0); - self.by_opening_list(ui, both, dark, actions); - }); + ui.add_space(4.0); + self.errors_table(ui, actions); } - /// «Repeated errors — the same position, the same move». - fn repeated_list(&mut self, ui: &mut Ui, both: bool, dark: bool, actions: &mut Vec) { - let Some(report) = self.report.as_ref() else { return }; - let mut list: Vec<(bool, usize)> = Vec::new(); - for white in self.color.colours() { - for i in 0..report.color(white).repeated.len() { - list.push((white, i)); + /// The repeated errors (the same position and move in several games) and the + /// errors by opening (the variations, the worst first), the inaccuracies left out + /// when they are hidden. + fn repeated_shown(&self) -> Vec<(bool, usize)> { + let Some(report) = &self.report else { + return Vec::new(); + }; + let mut list: Vec<(bool, usize)> = self + .color + .colours() + .into_iter() + .flat_map(|w| { + report + .color(w) + .repeated + .iter() + .enumerate() + .filter(|(_, r)| self.visible(r.judgement)) + .map(move |(i, _)| (w, i)) + }) + .collect(); + list.sort_by(|a, b| { + let ra = &report.color(a.0).repeated[a.1]; + let rb = &report.color(b.0).repeated[b.1]; + rb.games + .len() + .cmp(&ra.games.len()) + .then(judgement_weight(rb.judgement).cmp(&judgement_weight(ra.judgement))) + }); + list + } + + /// The games of a repeated error, the newest first. + fn repeated_games(&self, white: bool, index: usize) -> Vec { + let Some(report) = &self.report else { + return Vec::new(); + }; + let mut games = report.color(white).repeated[index].games.clone(); + games.sort_by_key(|&g| std::cmp::Reverse(report.games[g as usize].date_number())); + games + } + + fn err_rows(&self) -> Vec { + let Some(report) = &self.report else { + return Vec::new(); + }; + let mut rows = vec![ErrRow::RepeatedTitle]; + for (white, index) in self.repeated_shown() { + rows.push(ErrRow::Repeated { white, index }); + if self.open_repeated.contains(&(white, index)) { + for game in self.repeated_games(white, index) { + rows.push(ErrRow::RepeatedGame { white, index, game }); + } } } - if both { - list.sort_by(|a, b| { - let ra = &report.color(a.0).repeated[a.1]; - let rb = &report.color(b.0).repeated[b.1]; - rb.games.len().cmp(&ra.games.len()).then(judgement_weight(rb.judgement).cmp(&judgement_weight(ra.judgement))) - }); - } - ui.label(RichText::new(tr("Repeated errors — the same position, the same move")).strong()); - if list.is_empty() { - ui.label(RichText::new(tr("None so far")).weak()); - return; - } - let width = ui.available_width(); - let show_opening = width > 700.0; - let show_score = width > 560.0; - let mut clicked = None; - let mut opened = None; - let mut toggled = None; - egui::Grid::new("prep_repeated") - .num_columns(5 + usize::from(show_score) + usize::from(show_opening) + usize::from(both)) - .striped(true) - .spacing(vec2(10.0, 4.0)) - .show(ui, |ui| { - let head = |ui: &mut Ui, t: &str| { - ui.label(RichText::new(t).strong()); - }; - head(ui, ""); - if both { - head(ui, tr("Colour")); - } - head(ui, tr("Position")); - head(ui, tr("Played")); - head(ui, tr("Better")); - head(ui, "×"); - if show_score { - head(ui, tr("Score")); - } - if show_opening { - head(ui, tr("Opening")); - } - ui.end_row(); - for &(white, i) in &list { - let cr = report.color(white); - let r = &cr.repeated[i]; - let selected = self.selection == Selection::Repeated { white, index: i }; - let open = self.open_repeated.contains(&(white, i)); - let g = &report.games[r.games[0] as usize]; - let glyph = if open { "▾" } else { "▸" }; - if ui.add(egui::Label::new(RichText::new(glyph).weak()).sense(Sense::click())).clicked() { - toggled = Some((white, i)); - } - if both { - ui.label(RichText::new(if white { tr("♙ White") } else { tr("♟ Black") }).weak()); - } - let before = (r.ply as usize) - .checked_sub(1) - .map(|p| short_label(p, &g.sans[p])) - .map_or_else(|| tr("start").to_owned(), |m| trf("after {move}", &[("move", &m)])); - let side = if r.ply.is_multiple_of(2) { tr("White to move") } else { tr("Black to move") }; - let pos_text = format!("{before} · {side}"); - let t = RichText::new(pos_text); - let resp = ui.add(egui::Label::new(if selected { t.strong() } else { t }).sense(Sense::click())); - if resp.clicked() { - clicked = Some((white, i)); - } - if resp.double_clicked() { - opened = Some((r.games[0], r.ply as usize)); - } - ui.horizontal(|ui| { - ui.spacing_mut().item_spacing.x = 4.0; - ui.label(short_label(r.ply as usize, &r.san)); - pill(ui, r.judgement).on_hover_text(review::judgement_name(r.judgement)); - }); - ui.label(short_label(r.ply as usize, &r.best_san)); - ui.label(r.times().to_string()); - if show_score { - ui.label(RichText::new(tally_hint(&r.tally)).weak()); - } - if show_opening { - let name = r.opening.and_then(|o| report.openings.get(o)).map(|o| format!("{} · {}", o.name, o.eco)).unwrap_or_default(); - ui.label(RichText::new(name).weak()); - } - ui.end_row(); - if open { - for &gi in &r.games { - let g = &report.games[gi as usize]; - let row = &self.rows[gi as usize]; - ui.label(""); - if both { - ui.label(""); - } - let text = format!("{} — {}", row.white, row.black); - let resp = ui.add(egui::Label::new(RichText::new(text).weak()).sense(Sense::click()).truncate()); - if resp.double_clicked() { - opened = Some((gi, r.ply as usize)); - } - ui.label(RichText::new(result_text(row.result)).weak()); - ui.label(RichText::new(crate::library::display_date(&g.date)).weak()); - ui.end_row(); - } - } - } - }); - let _ = dark; - let opened = opened.map(|(gi, ply)| (report.games[gi as usize].index as usize, ply)); - if let Some(k) = toggled - && !self.open_repeated.remove(&k) - { - self.open_repeated.insert(k); - } - if let Some((white, index)) = clicked { - self.focus_games = false; - self.select(Selection::Repeated { white, index }); - } - if let Some((index, ply)) = opened { - actions.push(PrepAction::OpenGame { - path: self.path.clone(), - index, - ply, - }); - } - } - - /// «By opening»: the variations with errors, the worst first, their errors by game. - fn by_opening_list(&mut self, ui: &mut Ui, both: bool, dark: bool, actions: &mut Vec) { - let Some(report) = self.report.as_ref() else { return }; - ui.label(RichText::new(tr("By opening")).strong()); + rows.push(ErrRow::OpeningsTitle); // (white, family, variation, weight) let mut vars: Vec<(bool, usize, usize, u32)> = Vec::new(); for white in self.color.colours() { let cr = report.color(white); for (f, fam) in cr.families.iter().enumerate() { for (v, var) in fam.variations.iter().enumerate() { - if var.errors.total() == 0 { - continue; + let weight: u32 = var + .error_list + .iter() + .map(|&e| cr.errors[e as usize].judgement) + .filter(|j| self.visible(*j)) + .map(judgement_weight) + .sum(); + if weight > 0 { + vars.push((white, f, v, weight)); } - let weight = var.error_list.iter().map(|&e| judgement_weight(cr.errors[e as usize].judgement)).sum(); - vars.push((white, f, v, weight)); } } } vars.sort_by_key(|v| std::cmp::Reverse(v.3)); - if vars.is_empty() { - ui.label(RichText::new(tr("None so far")).weak()); - return; - } - let mut clicked = None; - let mut opened = None; - let mut toggled = None; - for (white, f, v, _) in vars { - let cr = report.color(white); - let var = &cr.families[f].variations[v]; - let name = var - .opening - .and_then(|o| report.openings.get(o)) - .map_or_else(|| tr("no name").to_owned(), |o| format!("{} · {}", o.name, o.eco)); - let open = self.open_families.contains(&(white, f * 1000 + v + 100_000)); - ui.horizontal(|ui| { - let glyph = if open { "▾" } else { "▸" }; - if ui.add(egui::Label::new(RichText::new(glyph).weak()).sense(Sense::click())).clicked() { - toggled = Some((white, f * 1000 + v + 100_000)); - } - if both { - ui.label(RichText::new(if white { "♙" } else { "♟" }).weak()); - } - let selected = self.selection == Selection::Opening { white, family: f, variation: Some(v) }; - let t = RichText::new(name); - let resp = ui.add(egui::Label::new(if selected { t.strong() } else { t }).sense(Sense::click()).truncate()); - if resp.clicked() { - clicked = Some(Selection::Opening { white, family: f, variation: Some(v) }); - } - if resp.double_clicked() { - toggled = Some((white, f * 1000 + v + 100_000)); - } - ui.label(RichText::new(format!("· {}", crate::i18n::games(var.games.len()))).weak()); - ui.label(RichText::new("·").weak()); - ui.spacing_mut().item_spacing.x = 4.0; - counts_text(ui, &var.errors); - }); - if open { - for &ei in &var.error_list { - let e = &cr.errors[ei as usize]; - let g = &report.games[e.game as usize]; - let row = &self.rows[e.game as usize]; - let selected = self.selection == Selection::Error { white, index: ei as usize }; - ui.horizontal(|ui| { - ui.add_space(24.0); - ui.spacing_mut().item_spacing.x = 4.0; - let t = RichText::new(short_label(e.ply as usize, &e.san)); - let resp = ui.add(egui::Label::new(if selected { t.strong() } else { t }).sense(Sense::click())); - pill(ui, e.judgement).on_hover_text(format!( - "{} · {} → {}", - review::judgement_name(e.judgement), - e.before.format(), - e.after.format() - )); - ui.add_space(6.0); - ui.label(RichText::new(trf("better {best}", &[("best", &crate::san::show(&e.best_san))])).weak()); - ui.add_space(8.0); - let names = format!("{} — {}", row.white, row.black); - let r2 = ui.add(egui::Label::new(RichText::new(names).weak()).sense(Sense::click()).truncate()); - ui.label(RichText::new(result_text(row.result)).weak()); - ui.label(RichText::new(crate::library::display_date(&g.date)).weak()); - if resp.clicked() || r2.clicked() { - clicked = Some(Selection::Error { white, index: ei as usize }); - } - if resp.double_clicked() || r2.double_clicked() { - opened = Some((e.game, e.ply as usize)); - } - }); + for (white, family, variation, _) in vars { + rows.push(ErrRow::Variation { white, family, variation }); + if self.open_variations.contains(&(white, family, variation)) { + let cr = report.color(white); + for &e in &cr.families[family].variations[variation].error_list { + if self.visible(cr.errors[e as usize].judgement) { + rows.push(ErrRow::Error { white, index: e as usize }); + } } } } - let _ = dark; - let opened = opened.map(|(gi, ply)| (report.games[gi as usize].index as usize, ply)); - if let Some(k) = toggled - && !self.open_families.remove(&k) + rows + } + + /// The error of a repeated error in one of its games. + fn error_in(&self, white: bool, index: usize, game: u32) -> Option { + let cr = self.report.as_ref()?.color(white); + let r = cr.repeated.get(index)?; + cr.errors + .iter() + .position(|e| e.game == game && e.key == r.key && e.uci == r.uci) + } + + /// What a row of the errors tab chooses. + fn err_select(&mut self, row: ErrRow) { + self.err_cursor = Some(row); + self.focus_games = false; + let sel = match row { + ErrRow::Repeated { white, index } => Selection::Repeated { white, index }, + ErrRow::RepeatedGame { white, index, game } => match self.error_in(white, index, game) { + Some(e) => Selection::Error { white, index: e }, + None => return, + }, + ErrRow::Variation { white, family, variation } => Selection::Opening { + white, + family, + variation: Some(variation), + }, + ErrRow::Error { white, index } => Selection::Error { white, index }, + ErrRow::RepeatedTitle | ErrRow::OpeningsTitle => return, + }; + self.select(sel); + } + + /// The game a row opens, at the move after the error: (record, ply). A repeated + /// error opens its newest game. + fn err_open(&self, row: ErrRow) -> Option<(usize, usize)> { + let report = self.report.as_ref()?; + let (white, e) = match row { + ErrRow::Repeated { white, index } => { + let game = *self.repeated_games(white, index).first()?; + (white, self.error_in(white, index, game)?) + } + ErrRow::RepeatedGame { white, index, game } => (white, self.error_in(white, index, game)?), + ErrRow::Error { white, index } => (white, index), + _ => return None, + }; + let e = report.color(white).errors.get(e)?; + Some((report.games[e.game as usize].index as usize, e.ply as usize + 1)) + } + + fn err_toggle(&mut self, row: ErrRow) { + match row { + ErrRow::Repeated { white, index } => { + if !self.open_repeated.remove(&(white, index)) { + self.open_repeated.insert((white, index)); + } + } + ErrRow::Variation { white, family, variation } => { + let k = (white, family, variation); + if !self.open_variations.remove(&k) { + self.open_variations.insert(k); + } + } + _ => {} + } + } + + /// The errors tab as one table: the repeated errors, then by opening; a click + /// chooses, a double click (Enter) opens the game at the error. + fn errors_table(&mut self, ui: &mut Ui, actions: &mut Vec) { + let rows = self.err_rows(); + let Some(report) = self.report.as_ref() else { return }; + let both = self.color == ColorChoice::Both; + let width = ui.available_width(); + let show_last = width > 640.0; + let cursor = self.err_cursor.and_then(|c| rows.iter().position(|r| *r == c)); + ui.style_mut().interaction.selectable_labels = false; + let mut table = TableBuilder::new(ui) + .id_salt("prep_errors") + .striped(true) + .sense(Sense::click()) + .auto_shrink([false, false]) + .cell_layout(egui::Layout::left_to_right(egui::Align::Center)) + .column(Column::remainder().at_least(180.0).clip(true)) + .column(Column::exact(110.0)) + .column(Column::exact(80.0)) + .column(Column::exact(70.0)) + .column(Column::exact(120.0).clip(true)); + if show_last { + table = table.column(Column::exact((width * 0.24).clamp(120.0, 260.0)).clip(true)); + } + if self.scroll_to_selected + && let Some(i) = cursor { - self.open_families.insert(k); + table = table.scroll_to_row(i, None); } - if let Some(sel) = clicked { - self.focus_games = false; - self.select(sel); + self.scroll_to_selected = false; + let mut clicked = None; + let mut toggled = None; + let mut opened = None; + let colour_icon = |ui: &mut Ui, white: bool| { + if both { + ui.label(RichText::new(if white { "♙" } else { "♟" }).weak()) + .on_hover_text(if white { tr("As White") } else { tr("As Black") }); + } + }; + let repeated_n = rows.iter().filter(|r| matches!(r, ErrRow::Repeated { .. })).count(); + let openings_n = rows.iter().filter(|r| matches!(r, ErrRow::Variation { .. })).count(); + table.body(|body| { + body.rows(ROW_H, rows.len(), |mut row| { + let r = rows[row.index()]; + row.set_selected(Some(row.index()) == cursor); + let weak = |t: &str| RichText::new(t).weak(); + match r { + ErrRow::RepeatedTitle | ErrRow::OpeningsTitle => { + let repeated = r == ErrRow::RepeatedTitle; + let (title, empty) = if repeated { + (tr("Repeated errors — the same position, the same move"), repeated_n == 0) + } else { + (tr("By opening"), openings_n == 0) + }; + row.col(|ui| { + ui.label(RichText::new(title).strong()); + if empty { + ui.label(weak(tr("none"))); + } + }); + let captions: [&str; 5] = if repeated { + [tr("Played"), tr("Better"), "×", tr("Score"), tr("Opening")] + } else { + [tr("Played"), tr("Better"), tr("Games"), tr("Errors"), tr("Date")] + }; + for (k, c) in captions.iter().enumerate() { + if k < 4 || show_last { + row.col(|ui| { + ui.label(weak(c)); + }); + } + } + } + ErrRow::Repeated { white, index } => { + let cr = report.color(white); + let rep = &cr.repeated[index]; + let g = &report.games[rep.games[0] as usize]; + let open = self.open_repeated.contains(&(white, index)); + row.col(|ui| { + if ui.add(egui::Label::new(weak(if open { "▾" } else { "▸" })).sense(Sense::click())).clicked() { + toggled = Some(r); + } + colour_icon(ui, white); + let before = (rep.ply as usize) + .checked_sub(1) + .map(|p| short_label(p, &g.sans[p])) + .map_or_else(|| tr("start").to_owned(), |m| trf("after {move}", &[("move", &m)])); + let side = if rep.ply.is_multiple_of(2) { tr("White to move") } else { tr("Black to move") }; + ui.add(egui::Label::new(format!("{before} · {side}")).truncate()); + }); + row.col(|ui| { + ui.spacing_mut().item_spacing.x = 4.0; + ui.label(short_label(rep.ply as usize, &rep.san)); + pill(ui, rep.judgement).on_hover_text(review::judgement_name(rep.judgement)); + }); + row.col(|ui| { + ui.label(short_label(rep.ply as usize, &rep.best_san)); + }); + row.col(|ui| { + ui.label(rep.times().to_string()); + }); + row.col(|ui| { + ui.label(weak(&tally_hint(&rep.tally))); + }); + if show_last { + row.col(|ui| { + let name = rep + .opening + .and_then(|o| report.openings.get(o)) + .map(|o| format!("{} · {}", o.name, o.eco)) + .unwrap_or_default(); + ui.add(egui::Label::new(weak(&name)).truncate()).on_hover_text(name); + }); + } + } + ErrRow::RepeatedGame { white, index, game } => { + let g = &report.games[game as usize]; + let lr = &self.rows[game as usize]; + let _ = (white, index); + row.col(|ui| { + ui.add_space(28.0); + ui.add(egui::Label::new(format!("{} — {}", lr.white, lr.black)).truncate()); + }); + row.col(|_| {}); + row.col(|_| {}); + row.col(|_| {}); + row.col(|ui| { + ui.label(result_text(lr.result)); + }); + if show_last { + row.col(|ui| { + ui.label(weak(&crate::library::display_date(&g.date))); + }); + } + } + ErrRow::Variation { white, family, variation } => { + let cr = report.color(white); + let var = &cr.families[family].variations[variation]; + let open = self.open_variations.contains(&(white, family, variation)); + let mut counts = ErrorCounts::default(); + for &e in &var.error_list { + counts.add(cr.errors[e as usize].judgement); + } + row.col(|ui| { + if ui.add(egui::Label::new(weak(if open { "▾" } else { "▸" })).sense(Sense::click())).clicked() { + toggled = Some(r); + } + colour_icon(ui, white); + let name = var + .opening + .and_then(|o| report.openings.get(o)) + .map_or_else(|| tr("no name").to_owned(), |o| format!("{} · {}", o.name, o.eco)); + ui.add(egui::Label::new(name.as_str()).truncate()).on_hover_text(name); + }); + row.col(|_| {}); + row.col(|_| {}); + row.col(|ui| { + ui.label(weak(&var.games.len().to_string())); + }); + row.col(|ui| { + ui.spacing_mut().item_spacing.x = 4.0; + counts_text(ui, &self.shown_counts(&counts)); + }); + if show_last { + row.col(|_| {}); + } + } + ErrRow::Error { white, index } => { + let e = &report.color(white).errors[index]; + let g = &report.games[e.game as usize]; + let lr = &self.rows[e.game as usize]; + row.col(|ui| { + ui.add_space(28.0); + ui.add(egui::Label::new(format!("{} — {}", lr.white, lr.black)).truncate()); + }); + row.col(|ui| { + ui.spacing_mut().item_spacing.x = 4.0; + ui.label(short_label(e.ply as usize, &e.san)); + pill(ui, e.judgement).on_hover_text(format!( + "{} · {} → {}", + review::judgement_name(e.judgement), + e.before.format(), + e.after.format() + )); + }); + row.col(|ui| { + ui.label(short_label(e.ply as usize, &e.best_san)); + }); + row.col(|_| {}); + row.col(|ui| { + ui.label(result_text(lr.result)); + }); + if show_last { + row.col(|ui| { + ui.label(weak(&crate::library::display_date(&g.date))); + }); + } + } + } + if !r.is_title() { + let resp = row.response(); + if resp.double_clicked() { + match r { + ErrRow::Repeated { .. } | ErrRow::Variation { .. } => toggled = Some(r), + _ => opened = Some(r), + } + clicked = Some(r); + } else if resp.clicked() { + clicked = Some(r); + } + } + }); + }); + if let Some(r) = toggled { + self.err_toggle(r); } - if let Some((index, ply)) = opened { + if let Some(r) = clicked { + self.err_select(r); + } + if let Some((index, ply)) = opened.and_then(|r| self.err_open(r)) { actions.push(PrepAction::OpenGame { path: self.path.clone(), index, @@ -3560,6 +4157,72 @@ impl PrepScreen { } } + /// The keyboard in the errors tab: ↑/↓ the rows, →/← open and close, Enter the game. + #[allow(clippy::too_many_arguments)] + fn errors_keys(&mut self, up: bool, down: bool, left: bool, right: bool, enter: bool, space: bool, home: bool, end: bool, actions: &mut Vec) { + let rows: Vec = self.err_rows().into_iter().filter(|r| !r.is_title()).collect(); + if rows.is_empty() { + return; + } + let at = self.err_cursor.and_then(|c| rows.iter().position(|r| *r == c)); + let Some(at) = at else { + if up || down || home || end { + self.err_select(rows[0]); + self.scroll_to_selected = true; + } + return; + }; + let r = rows[at]; + let next = if down { + Some((at + 1).min(rows.len() - 1)) + } else if up { + Some(at.saturating_sub(1)) + } else if home { + Some(0) + } else if end { + Some(rows.len() - 1) + } else { + None + }; + if let Some(i) = next { + self.err_select(rows[i]); + self.scroll_to_selected = true; + return; + } + let open = match r { + ErrRow::Repeated { white, index } => Some(self.open_repeated.contains(&(white, index))), + ErrRow::Variation { white, family, variation } => { + Some(self.open_variations.contains(&(white, family, variation))) + } + _ => None, + }; + if (right && open == Some(false)) || (left && open == Some(true)) || (space && open.is_some()) { + self.err_toggle(r); + } else if left { + // A game or an error row: to the row it is under. + if let Some(parent) = rows[..at] + .iter() + .rev() + .find(|p| matches!(p, ErrRow::Repeated { .. } | ErrRow::Variation { .. })) + { + self.err_select(*parent); + self.scroll_to_selected = true; + } + } else if enter { + match self.err_open(r) { + Some((index, ply)) => actions.push(PrepAction::OpenGame { + path: self.path.clone(), + index, + ply, + }), + None => { + self.focus_games = true; + self.games_cursor = Some(0); + } + } + } + } + // ----- the games list ------------------------------------------------------------ fn games_list(&mut self, ui: &mut Ui, actions: &mut Vec) { @@ -3595,7 +4258,7 @@ impl PrepScreen { ui.horizontal(|ui| { ui.label(RichText::new(title).strong()); if self.selection != Selection::None - && ui.small_button("🗙").on_hover_text(tr("All games")).clicked() + && crate::widgets::small_close_button(ui).on_hover_text(tr("All games")).clicked() { clear = true; } @@ -3607,26 +4270,44 @@ impl PrepScreen { if list.is_empty() { return; } - let ply = self.selection_ply(); let width = ui.available_width(); - let show_event = width > 820.0; - let show_then = width > 600.0; - let show_date = width > 480.0; - let show_elo = width > 400.0; - let show_errors = report.engine.is_some() && width > 540.0; - let columns = 3 + 2 * usize::from(show_elo) + usize::from(show_date) + usize::from(show_then) + usize::from(show_event) + usize::from(show_errors); - let fixed = 44.0 - + if show_elo { 88.0 } else { 0.0 } - + if show_date { 84.0 } else { 0.0 } - + if show_errors { 80.0 } else { 0.0 } - + match (show_then, show_event) { - (true, true) => 150.0, - (true, false) => 100.0, - _ => 0.0, + // The names first (at least 110 each): the event, «Then», the ratings (they go + // into the name cell), the errors and the date give way in turn. + let mut show_event = true; + let mut show_then = true; + let mut show_elo = true; + let mut show_errors = report.evaluated(); + let mut show_date = true; + let gap = ui.spacing().item_spacing.x; + let player_w_of = |event: bool, then: bool, elo: bool, errors: bool, date: bool| -> f32 { + let columns = 3 + 2 * usize::from(elo) + usize::from(date) + usize::from(then) + usize::from(event) + usize::from(errors); + let fixed = 44.0 + + if elo { 88.0 } else { 0.0 } + + if date { 84.0 } else { 0.0 } + + if errors { 80.0 } else { 0.0 } + + match (then, event) { + (true, true) => 150.0, + (true, false) => 100.0, + _ => 0.0, + } + + if event { 100.0 } else { 0.0 } + + gap * columns as f32; + (width - fixed) / 2.0 + }; + for drop in 0..5 { + if player_w_of(show_event, show_then, show_elo, show_errors, show_date) >= 110.0 { + break; } - + if show_event { 100.0 } else { 0.0 } - + ui.spacing().item_spacing.x * columns as f32; - let player_w = ((width - fixed) / 2.0).clamp(60.0, 170.0); + match drop { + 0 => show_event = false, + 1 => show_then = false, + 2 => show_elo = false, + 3 => show_errors = false, + _ => show_date = false, + } + } + let player_w = player_w_of(show_event, show_then, show_elo, show_errors, show_date).clamp(60.0, 170.0); + let plies: HashMap = list.iter().map(|&g| (g, self.game_ply(g))).collect(); ui.style_mut().interaction.selectable_labels = false; let mut table = TableBuilder::new(ui) .id_salt("prep_games_table") @@ -3716,13 +4397,21 @@ impl PrepScreen { ui.add(egui::Label::new(if player_names.contains(n) { t.strong() } else { t }).truncate()); }; let elo = |e: u16| if e > 0 { e.to_string() } else { String::new() }; - row.col(|ui| name(ui, &r.white)); + let ply = plies.get(&gi).copied().unwrap_or(0); + // Without their column the ratings go after the names, weak. + let name = |ui: &mut Ui, n: &str, e: u16| { + name(ui, n); + if !show_elo && e > 0 { + ui.label(RichText::new(e.to_string()).weak().small()); + } + }; + row.col(|ui| name(ui, &r.white, r.white_elo)); if show_elo { row.col(|ui| { ui.label(RichText::new(elo(r.white_elo)).weak()); }); } - row.col(|ui| name(ui, &r.black)); + row.col(|ui| name(ui, &r.black, r.black_elo)); if show_elo { row.col(|ui| { ui.label(RichText::new(elo(r.black_elo)).weak()); @@ -3761,7 +4450,7 @@ impl PrepScreen { row.col(|ui| { ui.spacing_mut().item_spacing.x = 3.0; let cr = report.color(g.white); - for e in cr.errors.iter().filter(|e| e.game == gi) { + for e in cr.errors.iter().filter(|e| e.game == gi && self.visible(e.judgement)) { let number = e.ply as usize / 2 + 1; ui.label(RichText::new(format!("{number}.")).small()); pill(ui, e.judgement).on_hover_text(format!( @@ -3793,6 +4482,7 @@ impl PrepScreen { && s.ply + 1 == s.positions.len() { let g = &report.games[gi as usize]; + let ply = plies.get(&gi).copied().unwrap_or(0); if let Some(m) = g.ucis.get(ply).and_then(|u| u.parse::().ok()).and_then(|u| u.to_move(&s.positions[s.ply]).ok()) { self.hover_arrow = m.from().map(|f| (f, crate::board::ui_target(&m))); } @@ -3805,7 +4495,7 @@ impl PrepScreen { actions.push(PrepAction::OpenGame { path: self.path.clone(), index: report.games[gi as usize].index as usize, - ply, + ply: self.open_ply(gi), }); } } @@ -3918,7 +4608,7 @@ impl PrepScreen { actions.push(PrepAction::OpenGame { path: self.path.clone(), index: r.games[list[next] as usize].index as usize, - ply: self.selection_ply(), + ply: self.open_ply(list[next]), }); } return; @@ -3926,28 +4616,7 @@ impl PrepScreen { match self.tab { Tab::Repertoire => self.tree_keys(up, down, left, right, enter, space, home, end), Tab::Openings => self.openings_keys(up, down, left, right, enter, space, home, end), - Tab::Errors => { - if enter && let Some(r) = &self.report { - let open = match &self.selection { - Selection::Repeated { white, index } => { - let rep = &r.color(*white).repeated[*index]; - Some((rep.games[0], rep.ply as usize)) - } - Selection::Error { white, index } => { - let e = &r.color(*white).errors[*index]; - Some((e.game, e.ply as usize)) - } - _ => None, - }; - if let Some((gi, ply)) = open { - actions.push(PrepAction::OpenGame { - path: self.path.clone(), - index: r.games[gi as usize].index as usize, - ply, - }); - } - } - } + Tab::Errors => self.errors_keys(up, down, left, right, enter, space, home, end, actions), } } @@ -4218,8 +4887,8 @@ mod tests { assert_eq!(short_label(4, "Bb5"), "3.Bb5"); let sans: Vec = ["e4", "c5", "Nf3"].iter().map(|s| (*s).to_owned()).collect(); assert_eq!(line_text(&sans), "1.e4 c5 2.Nf3"); - assert_eq!(shorten_middle("1. e4 c5 2. Nf3", 100), "1. e4 c5 2. Nf3"); - assert_eq!(shorten_middle("abcdefghij", 7), "abc…hij"); + assert_eq!(table_line("1. e4 c5 2. Nf3 Nc6 3. Bb5"), vec!["1.e4", "c5", "2.Nf3", "Nc6", "3.Bb5"]); + assert_eq!(table_line("1... e5"), vec!["1…e5"]); let ucis: Vec = ["e2e4", "c7c5", "g1f3"].iter().map(|s| (*s).to_owned()).collect(); assert_eq!(replay(&ucis).len(), 4); assert_eq!(replay(&["zz".to_owned()]).len(), 1); diff --git a/apps/desktop/src/settings.rs b/apps/desktop/src/settings.rs index b57d7df..90396cf 100644 --- a/apps/desktop/src/settings.rs +++ b/apps/desktop/src/settings.rs @@ -167,6 +167,8 @@ pub struct PrepSettings { pub branches_from: u32, /// The engine was started from the dialog once: the button starts it at once. pub chosen: bool, + /// Inaccuracies (?!) are shown with the mistakes and blunders. + pub inaccuracies: bool, } impl Default for PrepSettings { @@ -177,6 +179,7 @@ impl Default for PrepSettings { plies: 20, branches_from: 3, chosen: false, + inaccuracies: true, } } } diff --git a/crates/prep/src/lib.rs b/crates/prep/src/lib.rs index 99a1869..2a9623f 100644 --- a/crates/prep/src/lib.rs +++ b/crates/prep/src/lib.rs @@ -138,7 +138,7 @@ pub struct BookInfo { pub left: u32, } -const REPORT_VERSION: u32 = 2; +const REPORT_VERSION: u32 = 3; /// Everything the preparation knows about the player. #[derive(Clone, Debug, Serialize, Deserialize)] @@ -400,6 +400,12 @@ impl PrepReport { out } + /// Some position has an engine evaluation (from a run or from the cache): the + /// errors are judged. + pub fn evaluated(&self) -> bool { + self.evals.values().any(|e| e.nodes != EXACT) + } + /// Distinct positions an engine run looks at. pub fn distinct_positions(&self) -> usize { self.positions().len() @@ -890,6 +896,7 @@ mod tests { } assert_eq!(report.missing(1000), 0); assert_eq!(report.missing(2000), total); + assert!(report.evaluated()); report.refresh(); assert_eq!(report.engine.as_ref().map(|e| e.nodes), Some(1000)); let w = &report.white; @@ -921,7 +928,9 @@ mod tests { assert!(PrepReport::load(&dir, &db, &other, &Options::default()).is_none()); let mut fresh = build(&db, &player, &Options::default(), &AtomicUsize::new(0), &never) .expect("report"); + assert!(!fresh.evaluated()); assert_eq!(fresh.take_cached(&cache, 1000), total); + assert!(fresh.evaluated(), "evaluations from the cache judge the errors too"); assert_eq!(fresh.white.repeated, report.white.repeated); assert_eq!(fresh.take_cached(&cache, 1000), 0); let _ = std::fs::remove_dir_all(&dir); diff --git a/crates/prep/src/openings.rs b/crates/prep/src/openings.rs index f7cecb0..21a8604 100644 --- a/crates/prep/src/openings.rs +++ b/crates/prep/src/openings.rs @@ -122,13 +122,34 @@ pub fn get(id: usize) -> &'static Opening { &table().entries[id] } -/// The deepest named position among `keys` (the positions of a line, in order): its -/// index in `keys` and its entry. +/// The name of a line (the positions `keys`, in order): its deepest named position, +/// its index in `keys` and its entry — but a deeper position whose name is only a +/// more general one ("Sicilian Defense" after 3.d4 in the "Modern Variations") does +/// not take the name back: the most precise name met stays. pub fn deepest(keys: &[u64]) -> Option<(usize, usize)> { - keys.iter() - .enumerate() - .rev() - .find_map(|(i, k)| by_position(*k).map(|id| (i, id))) + let mut out: Option<(usize, usize)> = None; + for (i, k) in keys.iter().enumerate() { + if let Some(id) = by_position(*k) + && out.is_none_or(|(_, cur)| !more_general(id, cur)) + { + out = Some((i, id)); + } + } + out +} + +/// Entry `a`'s name is a more general form of entry `b`'s ("Sicilian Defense" of +/// "Sicilian Defense: Modern Variations"; "…: Najdorf Variation" of "…: Najdorf +/// Variation, English Attack"). +pub fn more_general(a: usize, b: usize) -> bool { + is_prefix_name(&get(a).name, &get(b).name) +} + +/// `general` names a family or a variation `precise` is part of. +pub fn is_prefix_name(general: &str, precise: &str) -> bool { + precise.len() > general.len() + && precise.starts_with(general) + && matches!(precise[general.len()..].chars().next(), Some(':' | ',')) } /// The openings a report refers to, each once, in the order they were first met. @@ -198,6 +219,17 @@ mod tests { assert_eq!(o.variation(), None); // Nothing before the first move. assert_eq!(deepest(&keys(&[])), None); + // A deeper position with a more general name keeps the precise one: the + // table names 1.e4 c5 2.Nf3 d6 3.d4 just «Sicilian Defense». + let line = keys(&["e4", "c5", "Nf3", "d6", "d4"]); + let after_d4 = by_position(line[5]).map(|id| get(id).name.clone()); + assert_eq!(after_d4.as_deref(), Some("Sicilian Defense")); + let (at, id) = deepest(&line).expect("named"); + assert_eq!((at, get(id).name.as_str()), (4, "Sicilian Defense: Modern Variations")); + assert!(is_prefix_name("Sicilian Defense", "Sicilian Defense: Modern Variations")); + assert!(is_prefix_name("A: B", "A: B, C")); + assert!(!is_prefix_name("Sicilian Defense", "Sicilian Defense")); + assert!(!is_prefix_name("English", "English Opening")); } #[test] diff --git a/crates/prep/src/tree.rs b/crates/prep/src/tree.rs index 5796c97..764f3f4 100644 --- a/crates/prep/src/tree.rs +++ b/crates/prep/src/tree.rs @@ -96,7 +96,14 @@ impl Tree { Some(&c) => c as usize, None => { let key = game.keys[i + 1]; - let named = openings::by_position(key); + // A more general name than the path's keeps the path's + // (see `openings::deepest`). + let parent = tree.nodes[at].opening.map(|o| openings.list[o].name.clone()); + let named = openings::by_position(key).filter(|&id| { + parent + .as_deref() + .is_none_or(|p| !openings::is_prefix_name(&openings::get(id).name, p)) + }); let opening = named .map(|id| openings.intern(id)) .or(tree.nodes[at].opening); @@ -139,9 +146,52 @@ impl Tree { for n in &mut tree.nodes { n.transposition = seen.get(&n.key).is_some_and(|c| *c > 1); } + // One position, one name: the most precise of its move orders' names; a node + // is «named» where its name differs from its parent's. + let mut best: HashMap = HashMap::new(); + for n in tree.nodes.iter().filter(|n| n.transposition) { + if let Some(o) = n.opening { + let e = best.entry(n.key).or_insert(o); + if openings::is_prefix_name(&openings.list[*e].name, &openings.list[o].name) { + *e = o; + } + } + } + for i in 0..tree.nodes.len() { + if let Some(&o) = best.get(&tree.nodes[i].key) { + tree.nodes[i].opening = Some(o); + } + let parent = tree.nodes[i].parent.and_then(|p| tree.nodes[p as usize].opening); + let name = |o: Option| o.map(|o| openings.list[o].name.as_str()); + tree.nodes[i].named = tree.nodes[i].opening.is_some() && name(tree.nodes[i].opening) != name(parent); + } tree } + /// The games through the position `key` by any move order (indices into + /// [`crate::PrepReport::games`], in order). + pub fn position_games(&self, key: u64) -> Vec { + let mut out: Vec = self + .nodes + .iter() + .filter(|n| n.key == key) + .flat_map(|n| n.games.iter().copied()) + .collect(); + out.sort_unstable(); + out.dedup(); + out + } + + /// The latest date among the games through the position `key`. + pub fn position_last_date(&self, key: u64) -> &str { + self.nodes + .iter() + .filter(|n| n.key == key) + .map(|n| n.last_date.as_str()) + .max_by_key(|d| chess_import::pgn_catalog::date_number(d)) + .unwrap_or("") + } + fn count(&mut self, node: usize, g: u32, game: &GameInfo) { let n = &mut self.nodes[node]; n.tally.add(game.outcome); @@ -244,6 +294,8 @@ pub(crate) mod tests { let after_d4 = tree.nodes.iter().find(|n| n.ply == 3 && n.san == "d4").unwrap(); assert_eq!(after_nf3.key, after_d4.key); assert_eq!(tree.position_tally(after_nf3.key).games, 2); + assert_eq!(tree.position_games(after_nf3.key), vec![0, 1]); + assert_eq!(tree.position_last_date(after_nf3.key), "2026.03.01"); assert!(!tree.nodes.iter().find(|n| n.san == "c4").unwrap().transposition); assert_eq!(tree.path(after_d4.parent.unwrap() as usize), vec!["Nf3", "d5"]); // Names: 1.d4 d5 2.Nf3 is named in the table, 2...Nf6 is too (Zukertort); diff --git a/docs/design/opponent-prep.md b/docs/design/opponent-prep.md index 697fe89..fe60a31 100644 --- a/docs/design/opponent-prep.md +++ b/docs/design/opponent-prep.md @@ -477,6 +477,55 @@ 9. **Период** (последний год / всё) как переключатель в отчёте — не делаю (объём «только дебюты», фильтр библиотеки закрывает); подтвердить. 10. **«Играть отсюда…» и «Открыть как партию»** с доски отчёта — в первую версию (рекомендация: это существующие действия) или после? +## 12. Ревью реализации (f02f140, 2026-10-28) + +Проверено по снимкам разработчика (1400×1000 тёмная, 640×1000, 640×480) и своим: светлая тема (репертуар, ошибки), «Чёрные» с книгой «Эта же база», «Дебюты» при «Чёрные», диалог движка, ход движка, 804/803×900, 960×1050, диалог при 640×480, «Ошибки» и «Дебюты» при 640×1000, вход из панели фильтров. Снимки — `scratchpad/prep-design/*.png`. Не снято: выбранная ошибка со стрелками на доске (выбрать её можно только мышью — см. А6). + +Общее: архитектура экрана, диалог, три вкладки, список партий, книга, движок, стопка и низкое окно — по дизайну; палитра отметок и пилюли — как в нотации, в обеих темах читаются. Замечания ниже — по приоритету: **А** мешает читать и понимать данные, **Б** расходится с визуальной системой, **В** узкие окна. У каждого — правка. + +### А. Данные и понимание + +1. **Сводка — одно длинное предложение.** С книгой и после движка строка цвета — ~130 знаков из семи частей через «·»; при 960 и 804 она переносится посреди фразы («Ошибок в / дебюте: …», `w960.png`, `w804.png`), и вторая строка читается как новая запись. Правка: сводка — `egui::Grid` в две строки с колонками «Цвет · Партий · Счёт (+= −) · Соперники · Последняя · Книга · Ошибки»; при нехватке ширины колонки прячутся справа налево (Книга → Соперники → Последняя), как в дереве, — переносов не бывает. Счётчики ошибок — через уже существующий `counts_text` («60 ?! · 14 ? · 8 ??» цветом отметок; плюс «в 40 % партий»): три числа одного вида в простом тексте («неточностей 60 · ошибок 14 · зевков 8») глаз не различает и они не связаны с колонками «Ошибки» в таблицах, где те же счётчики цветные. «Последняя» в сводке дублирует корень дерева — можно убрать первой. +2. **Числа в полосе счёта спорят с «Счётом».** В строке «Белыми · 138» рядом стоят «78 %» (очки) и «75» внутри полосы (доля побед белых); у чёрных внутри светлого сегмента стоит доля побед **соперника** («Queen's Pawn Game · 56 % · [56]», `openings_black.png`). Два разных числа в одной ячейке без подписи — главный источник непонимания колонки «Счёт». Правка: в полосе 56 точек чисел не рисовать (`results_bar` с флагом без текста либо своя узкая версия); проценты — только в подсказке «+10 =1 −3». Полоса остаётся абсолютной (Б светлый слева, Ч тёмный справа), как на доске поиска. Заодно: при «мало партий» полоса не приглушается (`painter_alpha` вычислен и выброшен) — рисовать её с `gamma_multiply(0.5)` или не рисовать вовсе. +3. **Линия под доской нумерует чёрные ходы:** «1.e4 1…c5 2.Nf3 2…d6». Нигде в программе так не пишут. Правка: `short_label` только для первого хода и для белых ходов; чёрные — голым SAN («1.e4 c5 2.Nf3 d6»). Та же линия нужна в «Первые ходы» таблицы дебютов, где сейчас формат таблицы lichess «1. e4 c5» (с пробелом после номера) — привести к `line_text`. +4. **«Первые ходы» нет на 1400×1000 при «Оба»** (`openings.png`): колонка «Цвет» 90 + «Дебют» ≥ 200 не оставляют 160 для ходов, и между «Дебют» и «ECO» пустота. Это именно те данные, ради которых владелец просил «всегда с первыми ходами». Правка: «Цвет» — только значок `♙`/`♟` шириной 24 с подсказкой (слово «Белыми» 11 раз подряд — шум); минимум «Дебют» 180, «Первые ходы» 140; порядок скрытия как в §6. Альтернатива лучше, но дороже: вместо колонки — строки-заголовки «Белыми · 138» / «Чёрными · 133», как корни дерева. Также сокращение линии режет ход пополам и даёт двойное многоточие («…5 4. Bg2 Be7 5. …», `openings_black.png`): `shorten_middle` — по границам ходов и по измеренной ширине, без второго `truncate`. +5. **Имя дебюта в дереве «откатывается»:** под «2…d6 Sicilian Defense: Modern Variations» стоит «3.d4 Sicilian Defense» — таблица даёт менее точное имя глубже, и правило «показывать, когда меняется» печатает его как новое. Правка: не показывать имя, если оно — префикс имени родителя (семейство без варианта); лучше — в `prep` сделать имя узла «липким» (самое глубокое имя по пути), тогда и подсказка, и таблица дебютов согласуются. +6. **Вкладка «Ошибки» без клавиатуры и без строк.** Стрелки там ничего не выбирают (`keyboard` → только Enter), а щелчок ловит лишь подпись «Позиция» / имя дебюта, не строка (`egui::Grid` без ответа строки). В «По дебютам» счётчики ошибок стоят на разной высоте — не сравнить. Правка: обе части — `TableBuilder` со `striped`, `sense(click)` и выделением строки, как дерево; клавиши ↑/↓/→/← по общему списку строк (повторяющиеся + дебюты + раскрытые партии), Enter — открыть партию. Это же даст хук для снимка выбранной ошибки (`CP_KEYS`). +7. **Четыре строки одних и тех же чисел** на 1400 (`errors.png`): сводка (2 строки) и сразу под ней в «Ошибках» «Белыми: … / Чёрными: …». Правка: во вкладке строки цветов показывать только в стопке (там сводка их не несёт, §6); рядом — только строка состояния «Ошибки найдены · Stockfish 19 · Быстро · 2 947 позиций · Точнее…». +8. **Колонка «Дебют» в дереве теряет ECO:** длинное имя забирает всю ширину, ECO обрезается до «··» («Nyezhmetdinov-Rossolimo Attack ··», `repertoire.png`). Правка: ECO класть первым в `right_to_left`, имя — в остаток с `truncate`. +9. Мелкое: «2947 позиций» без разделителя тысяч (статус, диалог, прогресс) — `large_db::grouped`; «%» в таблице дебютов без подсказки (в дереве есть) — «Доля от партий цветом; у варианта — от семейства»; «Книга [Нет ▾]» без слова «Книга» при W < 640 читается как «Нет» неизвестно чего — текст в самом списке «Книга: Нет». + +### Б. Визуальная система + +1. **«▾» слева от «Ошибки найдены»** (все снимки): в `right_to_left` кнопка параметров добавлена второй и встала левее подписи — выглядит как сворачивалка. Правка: добавлять «▾» первой (окажется справа), как `[Точнее…] [▾]` в §4.4. +2. **Три порядка цветов:** диалог «Оба · Белые · Чёрные», диалог движка «Белые · Чёрные · Оба», переключатель «Белые · Чёрные · Оба». Правка: везде «Белые · Чёрные · Оба». +3. **«🗙» у заголовка списка партий** — крупная рамочная кнопка тяжелее заголовка. Правка: `widgets::small_close_button`, как в диалоге у поля «Игрок» и у чипов. +4. **Полоса счёта в светлой теме** почти сливается с фоном строки (`light_rep.png`) — общее свойство `results_bar`, не этого экрана; если править п. А2 своей версией полосы — дать светлому сегменту обводку 1 px `weak_text_color` в светлой теме. +5. Глубина «Дебют: 10 ходов» при W < 760 превращается в голое «10» (`narrow640.png`), хотя в строке остаётся ~150 точек. Правка: выбирать подпись по измеренной ширине («Дебют: 10 ходов» → «10 ходов» → «10 х.»), а не по порогу окна. + +### В. Узкие и низкие окна + +1. **Имена в списке партий уже `NAME_MIN` 110** при 640–804 («Вафин Рад…», «Конюшенко С…», `narrow640.png`, `w804.png`): Elo и «Дальше» остаются, имена ужимаются до 82–95. Правка (как §3.10 и `board-search.md` §2.7): сначала считать `player_w`; если < 110 — прятать «Дальше», затем Elo (в ячейку имени слабым), и только потом резать имена. +2. **640×480: дереву остаётся 6 строк** (`low640.png`) — минимум списка партий 4 строки + 60 и доля 35 %. Правка: при H < 600 минимум списка — 2 строки, доля 25 %; дерево получает ≈ 10 строк. +3. В стопке над доской нет подписи «Ход белых · после 2.Nf3» (`board_caption` не вызывается, `w803.png`): добавить первой строкой в колонку справа от доски. +4. «другие ходы (1)» на глубине обрезается в «другие ход…» при минимуме колонки 180 (`w804.png`): короче — «другие (1)». +5. Пороги 804/803 и 720 работают как задумано (`w804.png` — рядом, `w803.png` — стопка; `low640.png` — доска по кнопке); диалоги при 640×480 помещаются. + +### Что принимаю из отклонений разработчика + +- «⤳» → «⇄» — да, яснее. +- Имя дебюта в дереве только когда меняется относительно родителя — да, с поправкой А5 (не показывать менее точное имя). +- «Первые ходы» семейства — его позиция по таблице — да. +- Строки ошибок в сводке нет в стопке — да (§6 так и задумано). +- Строка ошибок в сводке простым текстом — **нет**, см. А1: `counts_text` уже есть, это три строки правки. +- Отложены: вход с экрана партии, мини-доска в подсказке, «показать в дереве», сортировка таблицы дебютов — да; «Точнее…» только во вкладке «Ошибки», а не в строке переключателей — да, строка и так тесная. +- Автопереход на вкладку «Ошибки» при запуске движка (в дизайне не было) — да, полезно. + +### Не проверено + +Выбранная ошибка (стрелки сыгранного/лучшего хода, строка «… — лучше … · 0,0 → −1,2» под доской), «Остановлено → Продолжить», «нет партий цветом», «книга не открылась», партия, открытая из отчёта («⬅ К подготовке»). Для снимков нужна клавиатура во вкладке «Ошибки» (А6) или хук `CP_PREP_SELECT`. + ## Изменения - 2026-10-28: первая версия. +- 2026-10-28: §12 — ревью реализации f02f140 (замечания А/Б/В, принятые отклонения, что не проверено). From 3d72f80ab5a997be6e63ca4d2555f09fc9e6fb7c Mon Sep 17 00:00:00 2001 From: vrubelroman Date: Wed, 28 Oct 2026 16:50:32 +0300 Subject: [PATCH 8/9] =?UTF-8?q?Tasks:=20opponent=20prep=20status;=20=C2=AB?= =?UTF-8?q?Open=20as=20a=20game=C2=BB=20left=20for=20the=20owner=20to=20de?= =?UTF-8?q?cide?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- docs/dev/tasks.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/dev/tasks.md b/docs/dev/tasks.md index 3939e70..d241fa3 100644 --- a/docs/dev/tasks.md +++ b/docs/dev/tasks.md @@ -136,7 +136,8 @@ - **Суть:** в партии с компьютером кнопка «½ Предложить ничью» слишком длинная, ряд кнопок под часами переносится. Владелец: переименовать в «½–½» или похоже; полное «Предложить ничью» оставить во всплывающей подсказке (и для экранного чтения). Компьютер; на телефоне проверить ту же кнопку. ### 19. Дебютный репертуар и подготовка к сопернику (2026-10-28) -- **Статус:** исследование готово (2026-10-28): концепция и аналоги — `docs/research/opponent-prep.md`, техническая часть и замеры — `docs/research/opponent-prep-tech.md`. Ждёт решений владельца по открытым вопросам, затем дизайн. +- **Статус:** подготовка к сопернику делается в ветке `opponent-prep` (2026-10-28): только дебюты — репертуар по цветам с названиями, ошибки движком по дебютам, повторяющиеся ошибки; компьютер, Android потом. Исследование — `docs/research/opponent-prep.md` (§9 — решения владельца), `opponent-prep-tech.md`; дизайн — `docs/design/opponent-prep.md`. Слияние в `main` — после того, как владелец посмотрит. +- **Неясно владельцу, подумает:** кнопка «Открыть как партию» под доской отчёта (создаёт новую партию из ходов до выбранной позиции). Пока не трогаем: оставить, убрать или переделать (например, «Анализировать позицию») — решит владелец. - **Суть:** (1) дебютный репертуар — свои дебюты за белых и за чёрных деревом вариантов, с тренировкой по нему (продолжение задачи 15: «Мои дебюты», повторение по расписанию); (2) подготовка к сопернику — по партиям соперника (своя база, Lichess, Chess.com) показать, что он играет в дебюте, где ошибается, и сопоставить с моим репертуаром. ## Сделано From 7891d5d0517a30b201fda6f16966b285d7634a54 Mon Sep 17 00:00:00 2001 From: vrubelroman Date: Wed, 28 Oct 2026 16:56:43 +0300 Subject: [PATCH 9/9] Opponent prep: everything folded at first, every table sortable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The repertoire starts with its roots folded (no automatic expansion, after a rebuild, a colour or a depth either); the user opens what he wants. A click on a column's header orders the table by it, a second click turns the order round, ⏶/⏷ beside the title as in the library's game table (the header button is now `widgets::sort_header`, shared with it): the games list (all columns), the openings (families, and the variations inside each, by name, ECO, games, %, score, last game, errors), the errors tab (repeated errors by move, ×, score, opening; «By opening» by games and errors) and the repertoire (the moves of every position by games, %, score, last game; games first by default). Each table's order is kept in `settings.prep.sorts`. Co-Authored-By: Claude Opus 5.5 --- apps/desktop/src/large_db.rs | 12 +- apps/desktop/src/prep_ui.rs | 491 ++++++++++++++++++++++++++++------- apps/desktop/src/settings.rs | 3 + apps/desktop/src/widgets.rs | 11 + 4 files changed, 413 insertions(+), 104 deletions(-) diff --git a/apps/desktop/src/large_db.rs b/apps/desktop/src/large_db.rs index bc11dbd..cc908fb 100644 --- a/apps/desktop/src/large_db.rs +++ b/apps/desktop/src/large_db.rs @@ -2126,16 +2126,8 @@ impl LargeView { .header(26.0, |mut header| { for (label, key, _) in &columns { header.col(|ui| { - let arrow = match key { - Some(k) if sort.0 == *k => { - if sort.1 { " ⏶" } else { " ⏷" } - } - _ => "", - }; - let r = ui.add( - egui::Button::new(RichText::new(format!("{label}{arrow}")).strong()) - .frame(false), - ); + let active = key.filter(|k| sort.0 == *k).map(|_| sort.1); + let r = crate::widgets::sort_header(ui, label, active); if let Some(k) = key && r.clicked() { diff --git a/apps/desktop/src/prep_ui.rs b/apps/desktop/src/prep_ui.rs index 34649fd..b51ec7d 100644 --- a/apps/desktop/src/prep_ui.rs +++ b/apps/desktop/src/prep_ui.rs @@ -15,6 +15,7 @@ use chess_import::Database; use chess_import::chessbase::base::{Side, fold}; use egui::{Color32, Key, KeyboardShortcut, Modifiers, RichText, Sense, Ui, vec2}; use egui_extras::{Column, TableBuilder}; +use serde::{Deserialize, Serialize}; use game_review::{JobEvent, JobFailure, JobSettings, Judgement}; use prep::{ BookExit, BookOptions, Candidate, ErrorCounts, GameInfo, Options, Player, @@ -41,6 +42,152 @@ pub struct PrepEntry { pub side: Side, } +/// A table's order: the column and the direction. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub struct SortBy { + pub key: K, + pub ascending: bool, +} + +impl SortBy { + /// A click on the header of `key`: the same column turns the order round, another + /// one starts in its natural direction (names A–Z, numbers and dates high first). + fn click(&mut self, key: K, ascending_first: bool) { + if self.key == key { + self.ascending = !self.ascending; + } else { + *self = SortBy { + key, + ascending: ascending_first, + }; + } + } + + /// `ord` (ascending) in this table's direction. + fn apply(&self, ord: std::cmp::Ordering) -> std::cmp::Ordering { + if self.ascending { ord } else { ord.reverse() } + } +} + +/// The columns the repertoire tree orders the moves of a position by. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub enum TreeSort { + Games, + Share, + Score, + Last, +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub enum OpeningSort { + Name, + Eco, + Games, + Share, + Score, + Last, + Errors, +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub enum RepeatedSort { + Move, + Times, + Score, + Opening, +} + +/// «By opening» of the errors tab. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub enum VariationSort { + Games, + Errors, +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub enum GameSort { + White, + WhiteElo, + Black, + BlackElo, + Result, + Date, + Then, + Event, + Errors, +} + +/// The order of every table of the screen (kept in the settings). +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(default)] +pub struct PrepSorts { + pub tree: SortBy, + pub openings: SortBy, + pub repeated: SortBy, + pub variations: SortBy, + pub games: SortBy, +} + +impl Default for PrepSorts { + fn default() -> Self { + // Most played, most repeated, worst, newest first. + PrepSorts { + tree: SortBy { key: TreeSort::Games, ascending: false }, + openings: SortBy { key: OpeningSort::Games, ascending: false }, + repeated: SortBy { key: RepeatedSort::Times, ascending: false }, + variations: SortBy { key: VariationSort::Errors, ascending: false }, + games: SortBy { key: GameSort::Date, ascending: false }, + } + } +} + +/// A sort column of the errors tab (its two parts). +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +enum SortKeyOf { + Repeated(RepeatedSort), + Variation(VariationSort), +} + +/// A value a table is ordered by. +#[derive(Clone, Debug, PartialEq, PartialOrd)] +enum SortVal { + Num(f64), + Text(String), +} + +fn num(x: impl Into) -> SortVal { + SortVal::Num(x.into()) +} + +/// `a` against `b` (a value never compared to another kind is equal). +fn cmp_val(a: &SortVal, b: &SortVal) -> std::cmp::Ordering { + a.partial_cmp(b).unwrap_or(std::cmp::Ordering::Equal) +} + +/// A score for ordering: games without a result last when high first. +fn score_val(t: &Tally) -> SortVal { + num(t.score().unwrap_or(-1.0)) +} + +/// A sortable column's header: the title with ▲/▼ when the table is ordered by it; +/// a click is noted in `clicked`. +fn sort_col( + h: &mut egui_extras::TableRow<'_, '_>, + text: &str, + hint: &str, + key: K, + sort: SortBy, + clicked: &mut Option, +) { + h.col(|ui| { + let r = crate::widgets::sort_header(ui, text, (sort.key == key).then_some(sort.ascending)); + let r = if hint.is_empty() { r } else { r.on_hover_text(hint) }; + if r.clicked() { + *clicked = Some(key); + } + }); +} + /// The colour switch of the report. #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum ColorChoice { @@ -868,9 +1015,6 @@ enum EngineState { Complete { total: usize }, } -/// The default expansion: nodes with at least this many games, this deep. -const EXPAND_GAMES: u32 = 5; -const EXPAND_PLIES: u8 = 6; /// Fewer games: the percentages are shown weak. const FEW_GAMES: u32 = 5; const BOARD_MIN: f32 = 220.0; @@ -940,7 +1084,8 @@ pub struct PrepScreen { board_state: BoardState, /// In a low window the board is a panel over the lists, opened by a button. board_popup: bool, - newest_first: bool, + /// The order of each table (the settings' `prep.sorts`, written back on change). + sorts: PrepSorts, /// The keyboard is in the games list (else in the tab's table). focus_games: bool, games_cursor: Option, @@ -1236,7 +1381,7 @@ impl PrepScreen { flipped: None, board_state: BoardState::default(), board_popup: false, - newest_first: true, + sorts: settings.prep.sorts.clone(), focus_games: false, games_cursor: None, hover_arrow: None, @@ -1318,15 +1463,12 @@ impl PrepScreen { } }) .collect(); + // Everything folded: the user opens what he wants (the roots too). self.expanded.clear(); self.others_open.clear(); - for cr in [&report.white, &report.black] { - for (i, n) in cr.tree.nodes.iter().enumerate() { - if n.tally.games >= EXPAND_GAMES && n.ply <= EXPAND_PLIES { - self.expanded.insert((cr.white, i as u32)); - } - } - } + self.open_families.clear(); + self.open_variations.clear(); + self.open_repeated.clear(); // A book step of the report this one replaces is not this report's. self.book_job = None; self.report = Some(report); @@ -2059,7 +2201,7 @@ impl PrepScreen { let Some(report) = &self.report else { return Vec::new(); }; - let mut list: Vec = match &self.selection { + let list: Vec = match &self.selection { Selection::None => self .color .colours() @@ -2100,10 +2242,33 @@ impl PrepScreen { .map(|e| vec![e.game]) .unwrap_or_default(), }; - if self.newest_first { - list.sort_by_key(|&g| std::cmp::Reverse(report.games[g as usize].date_number())); - } - list + let sort = self.sorts.games; + let val = |gi: u32| -> SortVal { + let g = &report.games[gi as usize]; + let r = &self.rows[gi as usize]; + match sort.key { + GameSort::White => SortVal::Text(fold(&r.white)), + GameSort::Black => SortVal::Text(fold(&r.black)), + GameSort::WhiteElo => num(r.white_elo), + GameSort::BlackElo => num(r.black_elo), + GameSort::Result => SortVal::Text(r.result.to_owned()), + GameSort::Date => num(g.date_number()), + GameSort::Then => SortVal::Text(g.sans.iter().skip(self.game_ply(gi)).take(3).cloned().collect::>().join(" ")), + GameSort::Event => SortVal::Text(fold(&r.event)), + GameSort::Errors => num( + report + .color(g.white) + .errors + .iter() + .filter(|e| e.game == gi && self.visible(e.judgement)) + .map(|e| judgement_weight(e.judgement)) + .sum::(), + ), + } + }; + let mut keyed: Vec<(SortVal, u32)> = list.into_iter().map(|g| (val(g), g)).collect(); + keyed.sort_by(|a, b| sort.apply(cmp_val(&a.0, &b.0))); + keyed.into_iter().map(|(_, g)| g).collect() } /// The move of the selection to open a game at. @@ -2209,6 +2374,10 @@ impl PrepScreen { if !typing && !overlay { self.keyboard(&ctx, settings, &mut actions); } + if settings.prep.sorts != self.sorts { + settings.prep.sorts = self.sorts.clone(); + actions.push(PrepAction::SettingsChanged); + } actions } @@ -3041,10 +3210,21 @@ impl PrepScreen { } }; let n = &tree.nodes[node as usize]; - let (main, rest): (Vec, Vec) = n - .children - .iter() - .copied() + let mut children = n.children.clone(); + let sort = self.sorts.tree; + let val = |c: u32| -> SortVal { + let m = &tree.nodes[c as usize]; + match sort.key { + TreeSort::Games => num(tree.position_tally(m.key).games), + TreeSort::Share => num(m.tally.games), + TreeSort::Score => score_val(&tree.position_tally(m.key)), + TreeSort::Last => num(chess_import::pgn_catalog::date_number(tree.position_last_date(m.key))), + } + }; + // Ties: most played first, as the tree has them. + children.sort_by(|&a, &b| sort.apply(cmp_val(&val(a), &val(b)))); + let (main, rest): (Vec, Vec) = children + .into_iter() .partition(|&c| tree.nodes[c as usize].tally.games >= self.branches_from); // Pushed in reverse: the stack pops the first child first. if listed { @@ -3086,7 +3266,7 @@ impl PrepScreen { let width = ui.available_width(); let gap = ui.spacing().item_spacing.x; let has_book = self.book_ok() || (self.book_job.is_some() && self.book != BookChoice::None); - let mut used = 180.0 + 56.0 + 40.0 + 50.0 + 4.0 * gap; + let mut used = 180.0 + 76.0 + 48.0 + 50.0 + 4.0 * gap; let mut fits = |w: f32, wanted: bool| { let ok = wanted && used + w + gap <= width; if ok { @@ -3110,7 +3290,7 @@ impl PrepScreen { if show_opening { table = table.column(Column::remainder().at_least(160.0).clip(true)); } - table = table.column(Column::exact(56.0)).column(Column::exact(40.0)); + table = table.column(Column::exact(76.0)).column(Column::exact(48.0)); table = table.column(Column::exact(if show_bar { 110.0 } else { 50.0 })); if show_last { table = table.column(Column::exact(84.0)); @@ -3132,17 +3312,19 @@ impl PrepScreen { let mut toggled: Option = None; let mut hovered: Option<(bool, u32)> = None; let threshold = report.book.as_ref().map_or(prep::DEFAULT_BOOK_THRESHOLD, |b| b.threshold); + let mut tree_click = None; table .header(ROW_H, |mut h| { head_col(&mut h, tr("Move"), tr("His moves plain, the opponents' weak; ⇄ — the position is reached by another move order too")); if show_opening { head_col(&mut h, tr("Opening"), ""); } - head_col(&mut h, tr("Games"), ""); - head_col(&mut h, "%", tr("Share of the games of the move above")); - head_col(&mut h, tr("Score"), tr("The opponent's points in these games")); + let sort = self.sorts.tree; + sort_col(&mut h, tr("Games"), "", TreeSort::Games, sort, &mut tree_click); + sort_col(&mut h, "%", tr("Share of the games of the move above"), TreeSort::Share, sort, &mut tree_click); + sort_col(&mut h, tr("Score"), tr("The opponent's points in these games"), TreeSort::Score, sort, &mut tree_click); if show_last { - head_col(&mut h, tr("Last"), ""); + sort_col(&mut h, tr("Last"), "", TreeSort::Last, sort, &mut tree_click); } if show_book { head_col(&mut h, book_title, tr("Games of the book in this position; the first number under the threshold is where he leaves the book")); @@ -3325,6 +3507,9 @@ impl PrepScreen { } }); }); + if let Some(k) = tree_click { + self.sorts.tree.click(k, false); + } // A child of the chosen node under the pointer: its move as an arrow. if let (Some((white, node)), Selection::Node { white: sw, node: sn }) = (hovered, &self.selection) && white == *sw @@ -3386,21 +3571,85 @@ impl PrepScreen { // ----- the openings -------------------------------------------------------------- - fn openings_table(&mut self, ui: &mut Ui) { - let Some(report) = self.report.as_ref() else { return }; - // (white, family, variation): the rows as laid out. - let mut rows: Vec<(bool, usize, Option)> = Vec::new(); + /// The value of a family (`v` None) or a variation for the openings' order. + fn opening_val(&self, white: bool, f: usize, v: Option, key: OpeningSort) -> SortVal { + let Some(report) = &self.report else { + return num(0); + }; + let cr = report.color(white); + let fam = &cr.families[f]; + let vars: Vec<&prep::Variation> = match v { + Some(v) => vec![&fam.variations[v]], + None => fam.variations.iter().collect(), + }; + let tally = match v { + Some(v) => fam.variations[v].tally, + None => fam.tally, + }; + let opening = |var: &prep::Variation| var.opening.and_then(|o| report.openings.get(o)); + match key { + OpeningSort::Name => SortVal::Text(match v { + Some(_) => vars[0].opening.map_or_else(String::new, |o| report.openings[o].name.clone()), + None => fam.name.clone(), + }), + OpeningSort::Eco => SortVal::Text(vars.iter().filter_map(|x| opening(x)).map(|o| o.eco.clone()).min().unwrap_or_default()), + OpeningSort::Games | OpeningSort::Share => num(tally.games), + OpeningSort::Score => score_val(&tally), + OpeningSort::Last => num( + vars.iter() + .flat_map(|x| x.games.iter()) + .map(|&g| report.games[g as usize].date_number()) + .max() + .unwrap_or(0), + ), + OpeningSort::Errors => num( + vars.iter() + .flat_map(|x| x.error_list.iter()) + .map(|&e| cr.errors[e as usize].judgement) + .filter(|j| self.visible(*j)) + .map(judgement_weight) + .sum::(), + ), + } + } + + /// The rows of the openings table: (white, family, variation) — families in the + /// chosen order, the variations of an open one under it in the same order. + fn opening_rows(&self) -> Vec<(bool, usize, Option)> { + let Some(report) = &self.report else { + return Vec::new(); + }; + let sort = self.sorts.openings; + let mut rows = Vec::new(); for white in self.color.colours() { let cr = report.color(white); - for (f, fam) in cr.families.iter().enumerate() { + let mut fams: Vec = (0..cr.families.len()).collect(); + fams.sort_by(|&a, &b| { + sort.apply(cmp_val( + &self.opening_val(white, a, None, sort.key), + &self.opening_val(white, b, None, sort.key), + )) + }); + for f in fams { rows.push((white, f, None)); if self.open_families.contains(&(white, f)) { - for v in 0..fam.variations.len() { - rows.push((white, f, Some(v))); - } + let mut vars: Vec = (0..cr.families[f].variations.len()).collect(); + vars.sort_by(|&a, &b| { + sort.apply(cmp_val( + &self.opening_val(white, f, Some(a), sort.key), + &self.opening_val(white, f, Some(b), sort.key), + )) + }); + rows.extend(vars.into_iter().map(|v| (white, f, Some(v)))); } } } + rows + } + + fn openings_table(&mut self, ui: &mut Ui) { + let rows = self.opening_rows(); + let Some(report) = self.report.as_ref() else { return }; if rows.is_empty() { self.no_games_note(ui); return; @@ -3408,7 +3657,7 @@ impl PrepScreen { let both = self.color == ColorChoice::Both; let width = ui.available_width(); let gap = ui.spacing().item_spacing.x; - let mut used = 180.0 + 56.0 + 40.0 + 50.0 + 4.0 * gap + if both { 24.0 + gap } else { 0.0 }; + let mut used = 180.0 + 76.0 + 48.0 + 50.0 + 4.0 * gap + if both { 24.0 + gap } else { 0.0 }; let mut fits = |w: f32, wanted: bool| { let ok = wanted && used + w + gap <= width; if ok { @@ -3439,7 +3688,7 @@ impl PrepScreen { if show_moves { table = table.column(Column::remainder().at_least(140.0).clip(true)); } - table = table.column(Column::exact(56.0)).column(Column::exact(40.0)); + table = table.column(Column::exact(76.0)).column(Column::exact(48.0)); table = table.column(Column::exact(if show_bar { 110.0 } else { 50.0 })); if show_last { table = table.column(Column::exact(84.0)); @@ -3457,27 +3706,30 @@ impl PrepScreen { } self.scroll_to_selected = false; let mut clicked = None; + let mut opening_click = None; let mut toggled = None; table .header(ROW_H, |mut h| { if both { head_col(&mut h, "", ""); } - head_col(&mut h, tr("Opening"), ""); + let sort = self.sorts.openings; + let c = &mut opening_click; + sort_col(&mut h, tr("Opening"), "", OpeningSort::Name, sort, c); if show_eco { - head_col(&mut h, "ECO", ""); + sort_col(&mut h, "ECO", "", OpeningSort::Eco, sort, c); } if show_moves { head_col(&mut h, tr("First moves"), ""); } - head_col(&mut h, tr("Games"), ""); - head_col(&mut h, "%", tr("Share of the colour's games; a variation's — of its family's")); - head_col(&mut h, tr("Score"), tr("The opponent's points in these games")); + sort_col(&mut h, tr("Games"), "", OpeningSort::Games, sort, c); + sort_col(&mut h, "%", tr("Share of the colour's games; a variation's — of its family's"), OpeningSort::Share, sort, c); + sort_col(&mut h, tr("Score"), tr("The opponent's points in these games"), OpeningSort::Score, sort, c); if show_last { - head_col(&mut h, tr("Last"), ""); + sort_col(&mut h, tr("Last"), "", OpeningSort::Last, sort, c); } if show_errors { - head_col(&mut h, tr("Errors"), ""); + sort_col(&mut h, tr("Errors"), "", OpeningSort::Errors, sort, c); } }) .body(|body| { @@ -3612,6 +3864,9 @@ impl PrepScreen { } }); }); + if let Some(k) = opening_click { + self.sorts.openings.click(k, matches!(k, OpeningSort::Name | OpeningSort::Eco)); + } if let Some(key) = toggled { if !self.open_families.remove(&key) { self.open_families.insert(key); @@ -3796,12 +4051,20 @@ impl PrepScreen { .map(move |(i, _)| (w, i)) }) .collect(); + let sort = self.sorts.repeated; + let val = |&(w, i): &(bool, usize)| -> SortVal { + let r = &report.color(w).repeated[i]; + match sort.key { + RepeatedSort::Move => num(r.ply), + RepeatedSort::Times => num(r.games.len() as u32), + RepeatedSort::Score => score_val(&r.tally), + RepeatedSort::Opening => SortVal::Text(r.opening.map_or_else(String::new, |o| report.openings[o].name.clone())), + } + }; + // Ties: the worst first. list.sort_by(|a, b| { - let ra = &report.color(a.0).repeated[a.1]; - let rb = &report.color(b.0).repeated[b.1]; - rb.games - .len() - .cmp(&ra.games.len()) + let (ra, rb) = (&report.color(a.0).repeated[a.1], &report.color(b.0).repeated[b.1]); + sort.apply(cmp_val(&val(a), &val(b))) .then(judgement_weight(rb.judgement).cmp(&judgement_weight(ra.judgement))) }); list @@ -3850,7 +4113,14 @@ impl PrepScreen { } } } - vars.sort_by_key(|v| std::cmp::Reverse(v.3)); + let sort = self.sorts.variations; + let val = |v: &(bool, usize, usize, u32)| -> u32 { + match sort.key { + VariationSort::Games => report.color(v.0).families[v.1].variations[v.2].games.len() as u32, + VariationSort::Errors => v.3, + } + }; + vars.sort_by(|a, b| sort.apply(val(a).cmp(&val(b))).then(b.3.cmp(&a.3))); for (white, family, variation, _) in vars { rows.push(ErrRow::Variation { white, family, variation }); if self.open_variations.contains(&(white, family, variation)) { @@ -3969,6 +4239,8 @@ impl PrepScreen { } }; let repeated_n = rows.iter().filter(|r| matches!(r, ErrRow::Repeated { .. })).count(); + let sorts = self.sorts.clone(); + let mut sort_click: Option = None; let openings_n = rows.iter().filter(|r| matches!(r, ErrRow::Variation { .. })).count(); table.body(|body| { body.rows(ROW_H, rows.len(), |mut row| { @@ -3989,15 +4261,40 @@ impl PrepScreen { ui.label(weak(tr("none"))); } }); - let captions: [&str; 5] = if repeated { - [tr("Played"), tr("Better"), "×", tr("Score"), tr("Opening")] + // The captions of the part's columns; those it can be ordered by + // are sort buttons. + let captions: [(&str, Option); 5] = if repeated { + [ + (tr("Played"), Some(SortKeyOf::Repeated(RepeatedSort::Move))), + (tr("Better"), None), + ("×", Some(SortKeyOf::Repeated(RepeatedSort::Times))), + (tr("Score"), Some(SortKeyOf::Repeated(RepeatedSort::Score))), + (tr("Opening"), Some(SortKeyOf::Repeated(RepeatedSort::Opening))), + ] } else { - [tr("Played"), tr("Better"), tr("Games"), tr("Errors"), tr("Date")] + [ + (tr("Played"), None), + (tr("Better"), None), + (tr("Games"), Some(SortKeyOf::Variation(VariationSort::Games))), + (tr("Errors"), Some(SortKeyOf::Variation(VariationSort::Errors))), + (tr("Date"), None), + ] }; - for (k, c) in captions.iter().enumerate() { + for (k, (c, key)) in captions.iter().enumerate() { if k < 4 || show_last { - row.col(|ui| { - ui.label(weak(c)); + row.col(|ui| match key { + Some(key) => { + let active = match key { + SortKeyOf::Repeated(k) => (sorts.repeated.key == *k).then_some(sorts.repeated.ascending), + SortKeyOf::Variation(k) => (sorts.variations.key == *k).then_some(sorts.variations.ascending), + }; + if crate::widgets::sort_header(ui, c, active).clicked() { + sort_click = Some(*key); + } + } + None => { + ui.label(weak(c)); + } }); } } @@ -4142,6 +4439,14 @@ impl PrepScreen { } }); }); + match sort_click { + Some(SortKeyOf::Repeated(k)) => { + // Indices into the lists do not change: the rows only reorder. + self.sorts.repeated.click(k, matches!(k, RepeatedSort::Move | RepeatedSort::Opening)) + } + Some(SortKeyOf::Variation(k)) => self.sorts.variations.click(k, false), + None => {} + } if let Some(r) = toggled { self.err_toggle(r); } @@ -4347,43 +4652,32 @@ impl PrepScreen { let mut hovered = None; let mut clicked = None; let mut opened = None; - let mut sort_click = false; - let newest = self.newest_first; + let mut game_click = None; + let sort = self.sorts.games; let player_names: HashSet<&str> = self.names.iter().map(String::as_str).collect(); table .header(ROW_H, |mut h| { - head_col(&mut h, tr("White"), ""); + let c = &mut game_click; + sort_col(&mut h, tr("White"), "", GameSort::White, sort, c); if show_elo { - head_col(&mut h, "Elo", ""); + sort_col(&mut h, "Elo", "", GameSort::WhiteElo, sort, c); } - head_col(&mut h, tr("Black"), ""); + sort_col(&mut h, tr("Black"), "", GameSort::Black, sort, c); if show_elo { - head_col(&mut h, "Elo", ""); + sort_col(&mut h, "Elo", "", GameSort::BlackElo, sort, c); } - head_col(&mut h, tr("Res."), ""); + sort_col(&mut h, tr("Res."), "", GameSort::Result, sort, c); if show_date { - h.col(|ui| { - let arrow = if newest { " ⏷" } else { " ⏶" }; - if ui - .add(egui::Button::new(RichText::new(format!("{}{arrow}", tr("Date"))).strong()).frame(false)) - .on_hover_text(tr("Newest first")) - .clicked() - { - sort_click = true; - } - }); + sort_col(&mut h, tr("Date"), "", GameSort::Date, sort, c); } if show_then { - h.col(|ui| { - ui.label(RichText::new(tr("Then")).strong()) - .on_hover_text(tr("How the game went on from this position")); - }); + sort_col(&mut h, tr("Then"), tr("How the game went on from this position"), GameSort::Then, sort, c); } if show_event { - head_col(&mut h, tr("Event"), ""); + sort_col(&mut h, tr("Event"), "", GameSort::Event, sort, c); } if show_errors { - head_col(&mut h, tr("Errors"), tr("His marked moves in the opening of this game")); + sort_col(&mut h, tr("Errors"), tr("His marked moves in the opening of this game"), GameSort::Errors, sort, c); } }) .body(|body| { @@ -4473,8 +4767,11 @@ impl PrepScreen { } }); }); - if sort_click { - self.newest_first = !self.newest_first; + if let Some(k) = game_click { + let names = matches!(k, GameSort::White | GameSort::Black | GameSort::Result | GameSort::Then | GameSort::Event); + self.sorts.games.click(k, names); + // The keyboard's row is a place in the list: it goes back to the top. + self.games_cursor = None; } // The game's move from the shown position, as an arrow. if let Some(gi) = hovered @@ -4697,19 +4994,7 @@ impl PrepScreen { #[allow(clippy::too_many_arguments)] fn openings_keys(&mut self, up: bool, down: bool, left: bool, right: bool, enter: bool, space: bool, home: bool, end: bool) { - let Some(report) = &self.report else { return }; - let mut rows: Vec<(bool, usize, Option)> = Vec::new(); - for white in self.color.colours() { - let cr = report.color(white); - for (f, fam) in cr.families.iter().enumerate() { - rows.push((white, f, None)); - if self.open_families.contains(&(white, f)) { - for v in 0..fam.variations.len() { - rows.push((white, f, Some(v))); - } - } - } - } + let rows = self.opening_rows(); if rows.is_empty() { return; } @@ -4880,6 +5165,24 @@ mod tests { assert_eq!(exact.iter().map(|c| c.id).collect::>(), vec![2]); } + #[test] + fn a_header_click_sorts_then_turns_the_order_round() { + let mut s = PrepSorts::default().games; + assert_eq!((s.key, s.ascending), (GameSort::Date, false), "newest first"); + s.click(GameSort::Date, false); + assert!(s.ascending, "the same column again: the other way"); + s.click(GameSort::White, true); + assert_eq!((s.key, s.ascending), (GameSort::White, true), "a name column starts A–Z"); + assert_eq!(s.apply(std::cmp::Ordering::Less), std::cmp::Ordering::Less); + s.click(GameSort::White, true); + assert_eq!(s.apply(std::cmp::Ordering::Less), std::cmp::Ordering::Greater); + assert_eq!(cmp_val(&num(2), &num(10)), std::cmp::Ordering::Less); + assert_eq!(cmp_val(&SortVal::Text("b".into()), &SortVal::Text("a".into())), std::cmp::Ordering::Greater); + // Kept in the settings as they are. + let json = serde_json::to_string(&PrepSorts::default()).unwrap(); + assert_eq!(serde_json::from_str::(&json).unwrap(), PrepSorts::default()); + } + #[test] fn labels_and_lines() { assert_eq!(short_label(0, "e4"), "1.e4"); diff --git a/apps/desktop/src/settings.rs b/apps/desktop/src/settings.rs index 90396cf..47639a3 100644 --- a/apps/desktop/src/settings.rs +++ b/apps/desktop/src/settings.rs @@ -169,6 +169,8 @@ pub struct PrepSettings { pub chosen: bool, /// Inaccuracies (?!) are shown with the mistakes and blunders. pub inaccuracies: bool, + /// The order of each table of the screen. + pub sorts: crate::prep_ui::PrepSorts, } impl Default for PrepSettings { @@ -180,6 +182,7 @@ impl Default for PrepSettings { branches_from: 3, chosen: false, inaccuracies: true, + sorts: Default::default(), } } } diff --git a/apps/desktop/src/widgets.rs b/apps/desktop/src/widgets.rs index c79f65c..551a050 100644 --- a/apps/desktop/src/widgets.rs +++ b/apps/desktop/src/widgets.rs @@ -32,6 +32,17 @@ pub fn check_panel(name: &str, panel: &egui::Response) { } } +/// A sortable column's header: the title in bold, ▲/▼ when the table is ordered by +/// it (`Some(ascending)`); click to sort. +pub fn sort_header(ui: &mut Ui, label: &str, ascending: Option) -> egui::Response { + let arrow = match ascending { + Some(true) => " ⏶", + Some(false) => " ⏷", + None => "", + }; + ui.add(egui::Button::new(egui::RichText::new(format!("{label}{arrow}")).strong()).frame(false)) +} + /// Compact ✕ (e.g. to cancel a running task); the caller adds the tooltip. pub fn small_close_button(ui: &mut Ui) -> egui::Response { x_button(ui, vec2(22.0, 20.0), 4.5)