Add a flip board option

Ouverte
#57 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
76/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
css, html, javascript
Domaine
frontend, web-dev

Piste de recherche

Read js/board.js around createBoard and the keyboard handler, then inspect settings wiring in js/main.js, the toggles in index.html, and board styling in css/board.css. Run npm test and npm run lint as the issue describes. Done when the flip toggle persists after reload and the coordinates and arrow-key movement match the displayed orientation.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

enhancement good first issue severity: low

Summary

The board is always drawn with White at the bottom. With two people sharing one device, Black always plays upside down, and a flip option becomes necessary once a player can choose Black against a computer.

Where

  • js/board.js:16-27 (createBoard appends squares in a fixed order)
  • index.html:28-57 (settings panel, four toggles, none for orientation)

Proposal

Add a "Flip board" toggle, persisted like the other settings. Squares carry data-row and data-col and lookups go through getSquareElement, so flipping can be done in presentation only: a class on the board that reverses the grid order, or a reversed append order in createBoard. Check that coordinate labels and the arrow-key directions in the keyboard handler (js/board.js:111-127) follow the visual orientation. Optional: flip automatically each turn.

Who benefits

The player with the black pieces.

Acceptance criteria

  • A toggle flips the board and the choice survives a reload
  • Coordinates and arrow keys match what is on screen

Getting started

  • Relevant files: js/board.js, js/main.js, index.html, css/board.css
  • How to run tests: npm install, then npm test and npm run lint
  • Related docs: docs/ARCHITECTURE.md, .github/CONTRIBUTING.md

Filed by repo-audit/full-audit at 8a2c86c. Severity: low. Effort: S. audit-key: enhancement|js/board.js|createBoard.orientation

Langage dominant
JavaScript
Étoiles
4
Forks
2
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de TMHSDigital/Static_Chess

Toutes les issues de TMHSDigital/Static_Chess

Issues similaires

Plus d'issues JavaScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.