Repository navigation
feat(tutorial): add the decimal digit stage - #106
Merged
Merged
Conversation
Stage 8 counts 0 to 9 while Up is ON and carries back to 0. It starts with the counter of stage 7, made to add 0001 only while Up is ON with a Const, a Broadcast and an And, and with Count split into digits. The player makes Carry from the eights and ones digits and Up, and goes back to 0000 with Not Carry spread by a Broadcast and joined with S by an And. The goal tells how Check switches Up over the time steps, so a failure can be replayed, and Up stays OFF while Count is 1001 to catch a Carry that ignores Up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e layouts apart - The adder sits below the FlipFlop, so the wire from Count to A no longer looks like S already going into the FlipFlop. - The steps say to change the 1 in the width box to 4, and to take Not's input from the And that drives Carry, as Carry itself has no output. - The goal says that 1001 is 9, that Carry turns ON, and that Check switches Up. - The solution's Ands no longer overlap, and a test now checks that no stage places a node over another, before or after it is solved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Const box shows "4 bits" in stage 7, and in stage 8 the box for the width of a Broadcast's pin and the notice on a refused wire speak of bit widths. Stage 7 now says that a digit of a binary number is called a bit, and stage 8 says that the box is the bit width, the number of bits of the output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…onst as asked Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The wire from the FlipFlop back to the adder ran over both of them and the adder's name, and the wire from the Const to the And grazed the Const. The FlipFlop now sits left of the adder, so every wire placed runs left to right, and the Decompose sits below on the left, where its wire passes clear of the adder. A test now checks, for every stage, that no wire it starts with runs over a node or the name above it. The path of a wire moves out of the renderer, so that the test follows the same curve the editor draws. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r sizes with the editor The overlap check now covers the name above each node, which moves an And of the stage 8 solution clear of the Const. The checks take the height of a name and the straight part of a wire from the editor's own constants, and the path of a wire gets a test of its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stage 8 and the Broadcast summary spoke of digits for the width of a value, and one step mixed bits and digits. They now say bits for widths, and keep digits and places for the positions in a number. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…idths in bits Part summaries and the message on a pin of the wrong width show the same text in every stage, so the word bit cannot wait for stage 7. Stage 4 now says that a digit of a binary number is called a bit, and Decompose, Aggregate, the width message and the Const step write widths in bits. Digits and places stay for the positions in a number and for how many digits a number has. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ummaries Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee with
|
| Latest commit: |
ab986de
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://14942008.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev |
| Branch Preview URL: | https://feat-decimal-digit-stage.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
Stage 8 makes one decimal digit of the stopwatch: it counts 0 to 9 while Up is ON and carries back to 0.
Testing
npx vitest run(247 tests),npx tsc -p .andnpx biome check srcpass. New tests cover:🤖 Generated with Claude Code