Make the AI opponent skeleton playable (single-player mode)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript
- Ambito
- game-dev
Direzione di ricerca
Start with js/ai.js and js/game.js, especially the listed move generation and search methods, then read docs/ARCHITECTURE.md. The proposal spans legal move generation, search, UI controls, and responsive play, with a Web Worker question still open. Done means a player can choose a side, start a game against the computer, and the computer always makes legal moves while the UI stays responsive.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
The app supports only two players on one device. js/ai.js holds an AI skeleton, but it is not loaded and cannot produce a move.
Where
js/ai.js:132-139(_getAllLegalMovesreturns[]),js/ai.js:76-86(findBestMovetherefore resolvesnull),js/ai.js:151-161(_minimaxreturns 0)js/config.js:13,js/config.js:26(AI_DIFFICULTY: 'easy'does not match theEASY/MEDIUM/HARDkeys atjs/ai.js:9-13)index.html:65-71(script not loaded),js/game.js:313-325(generateAllLegalMoves)
Proposal
- Make move generation and apply/unapply take a board argument so search can run on a copy (#31).
- Ship a first version that plays a random legal move, then a material-greedy one-ply move using the existing
_evaluatePosition. - Add minimax with alpha-beta at depth 2 to 3.
- UI: a "Play vs computer" toggle with side and difficulty selectors; lock input while the AI is thinking; Undo takes back two plies in AI mode. Normalise the difficulty key casing.
Open question: depth 4 on the main thread may stall the UI. A Web Worker needs the engine code to be DOM-free, which game.js is not today.
Who benefits
Solo visitors to the hosted page, who currently have no one to play against.
Acceptance criteria
- A player can start a game against the computer and pick a side
- The computer always plays a legal move
- The UI stays responsive while it thinks
Getting started
- Relevant files:
js/ai.js,js/game.js,js/config.js,index.html - 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: medium. Effort: L. audit-key: enhancement|js/ai.js|ChessAI._getAllLegalMoves
- Lingua principale
- JavaScript
- Stelle
- 4
- Fork
- 2
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TMHSDigital/Static_Chess
-
enhancement good first issue severity: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
TMHSDigital/Static_Chess#53 ·
-
documentation good first issue severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
TMHSDigital/Static_Chess#49 ·
-
documentation good first issue severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
TMHSDigital/Static_Chess#48 ·
-
documentation severity: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
TMHSDigital/Static_Chess#47 ·
-
documentation good first issue severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
TMHSDigital/Static_Chess#46 ·
Tutte le issue di TMHSDigital/Static_Chess
Issue simili
-
good first issue tests
Difficoltà 1/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
-
1️⃣ phase/under-investigation flaky/confirmed flaky/needs-decision type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
growilabs/growi#12246 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
TMHSDigital/Free-Game-Dev-Assets#301 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100