Repository navigation
feat(tutorial): add the half adder and full adder stages - #102
Merged
Merged
Conversation
Stage 4, "Adding one digit", introduces binary: ON is 1 and OFF is 0, and A + B is output as the twos digit C and the ones digit S, from And and Xor. Stage 5, "Adding with a carry", adds Cin too, from Or and two of stage 4's part. The stage factory no longer assumes the two switches and one lamp of the first stages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…der is built - Stage 4 compares binary carrying with 9 + 1 becoming 10. - Stage 5 says to add A and B with one half adder, then Cin with another. - The English failure message lists three inputs as "A, B and Cin". - Both adder stages share one check, and stage 5's solution is laid out with Or level with C. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… divider colour In that header cell, the colour of the left border came before the bottom border, whose shorthand reset its colour to black. Each border now carries its colour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ches binary From stage 4 on, the goal asks to read C and S as a binary number, so ON and OFF in the tables had to be translated in the head. A stage now says how its tables write a bit, and the stage page passes it to every table on it, including the side panel's. A line under the goal table says that 1 is ON and 0 is OFF. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…there Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the review - Stage 4 says the twos digit is the left one and the ones digit the right one. - The English legend speaks of the tables, as a page has several. - The message on a wrong output is tested in both languages, with two and three inputs. - The notation context lives in its own file, so the table keeps fast refresh. - The play-mode value uses bitDigit, and two comments that went stale or only restated the code are trimmed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee with
|
| Latest commit: |
cbe02bc
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://73c014fe.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev |
| Branch Preview URL: | https://feat-adder-stages.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The tutorial now reaches arithmetic. Stage 4 is where binary is taught, and stage 5 builds on its part, as the later adder, counter and stopwatch stages will. Since these stages ask to read outputs as binary digits, their tables are written in 1 and 0.
tableNotation). From stage 4 on, every table on the stage page uses 1 and 0, including the side panel's info popover, with "In the tables, 1 is ON and 0 is OFF." under the goal table. Stages 1 to 3 and the free mode keep ON and OFF. A test pins down that the switch happens at the stage that teaches binary.defineStageno longer assumes two switches and one lamp, and both adder stages share one check (addingCheck).Not in this PR
Testing
npx vitest run(196 tests),npx tsc -p .andnpx biome check srcpass. New tests cover:🤖 Generated with Claude Code