Skip to content

Replace chapter 3 demos with official NKS versions#5

Open
lichenbo wants to merge 1 commit into
masterfrom
codex/verify-and-implement-chapter-3-demos
Open

Replace chapter 3 demos with official NKS versions#5
lichenbo wants to merge 1 commit into
masterfrom
codex/verify-and-implement-chapter-3-demos

Conversation

@lichenbo

Copy link
Copy Markdown
Owner

Summary

  • replace the chapter 3 demo index with the official list of cellular automaton, mobile automaton, Turing machine, substitution, tag and register machine experiments from the NKS site
  • rebuild every chapter 3 demo page so it mirrors the rules, presets and controls that appear in the original book and online demos
  • remove the improvised chapter 3 lab/interactive pages and duplicate three-colour demo in favour of the authentic recreations

Testing

  • not run (static HTML updates only)

https://chatgpt.com/codex/tasks/task_e_68cfe086c0a08322b86d803882ac8eb8

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines +150 to +153
buildInstructions(ruleNumber) {
const action0 = decodeInstruction(ruleNumber % 4);
const action1 = decodeInstruction(Math.floor(ruleNumber / 4) % 4);
return { 0: action0, 1: action1 };

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P1] Decode mobile automaton rules for the wrong cell values

The rule decoder assigns the low‑order base‑4 digit to the white‑cell transition and the high‑order digit to the black‑cell transition (buildInstructions uses ruleNumber % 4 for state 0 and Math.floor(ruleNumber / 4) for state 1). Wolfram’s numbering scheme encodes the 0‑cell instruction in the high‑order digit and the 1‑cell instruction in the low‑order digit, so the mapping is reversed. For example, selecting rule 9 should yield 0→1L, 1→0R, but the current code runs 0→0R, 1→1L. Every rule therefore simulates the wrong behaviour relative to the descriptions and the original NKS demo. Swap the digits when decoding so that each dropdown choice executes the intended rule.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant