Let the player choose the promotion piece
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript
- Lĩnh vực
- accessibility, frontend
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- JavaScript
- Star
- 4
- Fork
- 2
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TMHSDigital/Static_Chess
-
enhancement good first issue severity: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
TMHSDigital/Static_Chess#53 ·
-
documentation good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
TMHSDigital/Static_Chess#49 ·
-
documentation good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
TMHSDigital/Static_Chess#48 ·
-
documentation severity: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
TMHSDigital/Static_Chess#47 ·
-
documentation good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
TMHSDigital/Static_Chess#46 ·
Tất cả issue của TMHSDigital/Static_Chess
Issue tương tự
-
good first issue tests
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Download a leaderboard as CSVĐang mởenhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
-
1️⃣ phase/under-investigation flaky/confirmed flaky/needs-decision type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
growilabs/growi#12246 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
TMHSDigital/Free-Game-Dev-Assets#301 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100