Custom time controls

Aperta
#159 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
56/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript
Ambito
frontend, game-dev

Direzione di ricerca

Start with js/config.js and index.html to see how the existing presets populate #clock-select, then follow the selection handling in js/main.js and clock startup in js/clock.js. Read tests/unit/clock.test.js and run npm ci && npm test to understand current validation. Done when custom controls persist across reloads, invalid values cannot start the clock, and the tests cover the new behavior; bounds and PGN formatting still need decisions.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement help wanted severity: low

Summary

The clock offers only five fixed presets (1+0, 3+2, 5+0, 10+0, 15+10). Common controls such as 3+0, 5+3 or 30+0, and odds games, cannot be chosen.

Where

  • js/config.js:18-25 (TIME_CONTROLS)
  • index.html:166 (#clock-select)

Proposal

Add a "Custom..." option to #clock-select that shows two number inputs (minutes, increment seconds), validated and stored as custom:M+I in the time-control setting. Optionally, a per-side minutes field for odds games.

Who benefits

Players who want a longer game, or an odds game against a stronger friend.

Open questions

  • Bounds (e.g. 1 to 180 minutes, 0 to 60 seconds increment).
  • How a custom control is written to the PGN TimeControl tag.

Acceptance criteria

  • A custom control is kept across reloads and validated by validateSavedGame
  • Invalid input cannot start a clock
  • Tests in tests/unit/clock.test.js

Getting started

  • Relevant files: js/config.js, js/main.js, js/clock.js, index.html
  • How to run tests: npm ci && npm test

Filed by repo-audit/full-audit at 73cd279. Severity: low. Effort: M. audit-key: enhancement|js/config.js|TIME_CONTROLS

Lingua principale
JavaScript
Stelle
4
Fork
2
Merge medio
22h 16m
PR unite (30g)
9

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TMHSDigital/Static_Chess

Tutte le issue di TMHSDigital/Static_Chess

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.