Let the player choose the promotion piece
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 55/100
- Issue-Typ
- Feature
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- javascript
- Bereich
- accessibility, frontend
Rechercherichtung
Read js/game.js:221-228 and js/promotion.js:153-185 to trace how moves and the existing dialog work; check index.html:65-71 and js/config.js:14 for loading and configuration. Run npm test and npm run lint to establish the baseline. Done when players can choose all four pieces, keyboard users can operate the dialog, notation records the choice, and undo restores the pawn.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
A pawn reaching the last rank always becomes a queen with no prompt, so underpromotion is impossible. A promotion dialog already exists in js/promotion.js but is never loaded or called.
Where
js/game.js:221-228(auto-queen,// TODO: Implement choice?)js/promotion.js:153-185(showPromotionModalreturns a Promise),js/promotion.js:57-64(options are click-onlydivs)index.html:65-71(script not loaded),js/config.js:14(PROMOTION_UI: false)
Proposal
Load promotion.js. When a pawn reaches the last rank, hold the move, show the dialog, then finish the move (notation, check detection, save) with the chosen piece. Block board input while the dialog is open. Make the options real <button> elements with labels so keyboard users can promote.
Open question: makeMove is synchronous and tests call it directly. An optional promotionType parameter, defaulting to queen, keeps tests and a future AI simple. See #31.
Who benefits
Every player whose game reaches promotion; knight promotions and rook or bishop promotions that avoid stalemate become possible.
Acceptance criteria
- The player can choose queen, rook, bishop or knight
- Notation shows the chosen piece (
e8=N) - The dialog is usable by keyboard
- Undo after a promotion restores the pawn
Getting started
- Relevant files:
js/game.js,js/promotion.js,index.html,js/config.js - How to run tests:
npm install, thennpm testandnpm run lint - Related docs:
docs/ARCHITECTURE.md,.github/CONTRIBUTING.md
Filed by repo-audit/full-audit at 8a2c86c. Severity: high. Effort: M. audit-key: enhancement|js/game.js|makeMove.promotion
- Vorherrschende Sprache
- JavaScript
- Sterne
- 4
- Forks
- 2
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TMHSDigital/Static_Chess
-
enhancement good first issue severity: medium
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
TMHSDigital/Static_Chess#53 ·
-
documentation good first issue severity: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
TMHSDigital/Static_Chess#49 ·
-
documentation good first issue severity: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
TMHSDigital/Static_Chess#48 ·
-
documentation severity: medium
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
TMHSDigital/Static_Chess#47 ·
-
documentation good first issue severity: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
TMHSDigital/Static_Chess#46 ·
Alle Issues in TMHSDigital/Static_Chess
Ähnliche Issues
-
good first issue tests
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100
-
1️⃣ phase/under-investigation flaky/confirmed flaky/needs-decision type/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
growilabs/growi#12246 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
TMHSDigital/Free-Game-Dev-Assets#301 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100