Choose a random side against the computer

オープン 初心者向け
#163 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript
領域
frontend, game-dev

調査の方向性

#side-select のある index.html と、190~197 行付近の js/main.js を読み、選択した側がどのように保存され、盤面がどのように反転されるかをたどってください。次に js/game.js と tests/unit/settings.test.js を調べ、新しいゲームと保存されたゲーム状態の仕組みを確認してください。新しいゲームごとに側を選択する Random の選択肢を追加し、再読み込み時にはそのゲームの側が保持されるようにしてください。Math.random をスタブ化して npm ci && npm test で確認してください。

索引モデルが issue の本文から書いたものです。

説明

enhancement good first issue severity: low

Summary

Against the computer the player chooses White or Black; there is no Random option.

Where

  • index.html:159-161 (#side-select)
  • js/main.js:190-197 (the choice is stored and also flips the board)

Proposal

Add a "Random" option. Store random as the setting, and pick White or Black at each New Game, flipping the board to match. The chosen side is recorded in the game as today, so reload and PGN stay correct.

Who benefits

Players who want variety without choosing each time; a common option in chess apps.

Acceptance criteria

  • With Random selected, New Game picks a side and the board orientation matches
  • Reloading keeps the side of the game in progress (it does not re-roll)
  • Tests with a stubbed Math.random

Getting started

  • Relevant files: index.html, js/main.js, js/game.js, tests/unit/settings.test.js
  • How to run tests: npm ci && npm test

Filed by repo-audit/full-audit at 73cd279. Severity: low. Effort: S. audit-key: enhancement|index.html|side-select

主要言語
JavaScript
スター
4
フォーク
2
平均マージ
6時間 13分
マージ済み PR(30日)
4

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TMHSDigital/Static_Chess のほかの issue

TMHSDigital/Static_Chess の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。