Add a flip board option

Aberta
#57 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
76/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
css, html, javascript
Domínio
frontend, web-dev

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
JavaScript
Estrelas
4
Forks
2
Métricas de merge de PRs
Nenhum PR com merge em 30d

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TMHSDigital/Static_Chess

Todas as issues de TMHSDigital/Static_Chess

Issues semelhantes

Mais issues de JavaScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.