Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Multiple free-space tiles can render an incomplete card

未关闭
#13 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript
领域
full-stack

调研方向

先从 src/lib/bingo.ts 和 src/lib/server/cardShuffle.ts 中 effectivePoolSize、getCardSize 和 pickCardWithFreeSpace 的流程开始,然后检查受影响的 bingo 和 tile-admin server 路由。复现一个包含两个 free-space tiles 的 25-tile pool,并比较 raw 和 effective 计数。完成标准是阻止或规范化无效配置,并且 /bingo 不再渲染少于 25 个单元格。

由索引模型根据 Issue 内容生成。

描述

Problem

The admin UI permits multiple isFreeSpace tiles. effectivePoolSize subtracts every free space after the first, but getCardSize still returns the minimum size of 5. pickCardWithFreeSpace then drops all but one free-space tile and can return fewer than 25 cells. tooFewTiles uses the raw tile count, so it does not prevent rendering.

Reproduction

  1. Create a 25-tile pool with two tiles marked Free.
  2. Open /bingo.

The effective pool is 24, the selected card has 23 regular tiles plus one centered free space (24 total), and the UI renders only 24 cells in a 5-column grid. The core calculation reproduces as { effectivePoolSize: 24, cardSize: 5, renderedTiles: 24 }.

Suggested fix

Validate or enforce exactly zero or one free-space tile, or base the availability check on the effective pool and require cardSize ** 2 selected tiles before showing the board. The tile admin should prevent the invalid configuration or clearly normalize extra free spaces.

Affected code

  • src/lib/bingo.ts
  • src/lib/server/cardShuffle.ts
  • src/routes/bingo/+page.server.ts
  • src/routes/admin/tiles/+page.server.ts
主要语言
TypeScript
星标
0
派生
0
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

hacksu/bingo 的其他 Issue

查看 hacksu/bingo 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。