Skip to content

Change board from boolean[][] to number[][] - #33

Merged
aster-void merged 3 commits into
mainfrom
boolean_to_number
Nov 15, 2025
Merged

Change board from boolean[][] to number[][]#33
aster-void merged 3 commits into
mainfrom
boolean_to_number

Conversation

@kg0816

@kg0816 kg0816 commented Nov 15, 2025

Copy link
Copy Markdown
Contributor

・boolean[][]からnumber[][]への移行

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 15, 2025

Copy link
Copy Markdown

Deploying life-code with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2ee12aa
Status: ✅  Deploy successful!
Preview URL: https://3edd34c6.life-code.pages.dev
Branch Preview URL: https://boolean-to-number.life-code.pages.dev

View logs

Comment thread src/iframe/life-game.js
for (let jj = 0; jj < yoko.length; jj++) {
if (tate[ii] !== 0 || yoko[jj] !== 0) {
around += board[i + tate[ii]][j + yoko[jj]] ? 1 : 0;
around += board[i + tate[ii]][j + yoko[jj]] !== 0 ? 1 : 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+= board[ii][jj] でもいいかも

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

現行の0or1しかとりえない状況だと動くと思いますが、numberを活用しだすとエラー吐きそうなので触れずに行こうと思ってます。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

濃度つきセルのコードを書くときに変えればいいので、よさそう

@aster-void aster-void left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🪀

@aster-void
aster-void merged commit 4bc03af into main Nov 15, 2025
4 checks passed
@aster-void
aster-void deleted the boolean_to_number branch November 15, 2025 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants