Skip to content

docs: enhance FSM page with state transition table, state labels, Moore vs Mealy comparison and quiz#771

Open
VaibhavJindal7 wants to merge 6 commits intoCircuitVerse:masterfrom
VaibhavJindal7:feat/enhance-fsm-documentation
Open

docs: enhance FSM page with state transition table, state labels, Moore vs Mealy comparison and quiz#771
VaibhavJindal7 wants to merge 6 commits intoCircuitVerse:masterfrom
VaibhavJindal7:feat/enhance-fsm-documentation

Conversation

@VaibhavJindal7
Copy link

@VaibhavJindal7 VaibhavJindal7 commented Mar 22, 2026

Fixes #769
Fixes #770

Changes done:

  • Added Moore vs Mealy comparison table
  • Added state transition table for vending machine
  • Added state labels explanation (M0, W5, W10 etc.)
  • Added binary arrow labels explanation (00, 01, 10)
  • Added Experiment section heading
  • Added quiz with 5 questions
  • Added status messages during Wait states
    (Processing coin, Returning change, Enjoy your soda)

Screenshots

No UI changes for documentation.
JS fix adds status messages during processing states
so users understand what the machine is doing.

Preview Link(s):

✅️ By submitting this PR, I have verified the following

  • Checked to see if a similar PR has already been opened 🤔️
  • Reviewed the contributing guidelines 🔍️
  • Sample preview link added
  • Tried Squashing the commits into one

Summary by CodeRabbit

  • Documentation

    • Added instructional material comparing Moore vs Mealy machines, a mnemonic, a detailed state transition table, explanations of state labels, an experiment section, and a five-question quiz.
  • User Experience

    • Interactive soda machine now shows contextual status messages for inserting coins, processing, returning change, and dispensing soda. Removed the prior delayed re-enable behavior for coin input.

@coderabbitai
Copy link

coderabbitai bot commented Mar 22, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1d687e71-3dff-4871-b381-1f3c887c95f0

📥 Commits

Reviewing files that changed from the base of the PR and between 3475319 and 0303aa5.

📒 Files selected for processing (1)
  • docs/seq-design/fsm.md
✅ Files skipped from review due to trivial changes (1)
  • docs/seq-design/fsm.md

Walkthrough

Updated docs/seq-design/fsm.md with a Moore vs Mealy comparison table and mnemonic, a state transition table for the soda vending FSM, an explanation of state-label symbols and binary transition-arrow labels, a note about the diagram’s internal “20” value, an “Experiment” section, and a five-question Quiz. Modified assets/js/interactive_soda_machine.js to add a statusText UI element, set state-specific status messages and UI calls (including enableButtons(), dropSoda(), and dropChange()), make dropCoin() set “Processing coin...”, and remove the previous delayed re-enable gating logic. No declarations of exported/public entities were changed.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes to the documentation: it mentions the state transition table, state labels, Moore vs Mealy comparison, and quiz additions.
Linked Issues check ✅ Passed The PR addresses all coding requirements from #769 (state label explanation, binary arrow labels, state transition table, Moore vs Mealy comparison) and #770 (button disable logic during wait states, user feedback messages).
Out of Scope Changes check ✅ Passed All changes directly relate to the linked issues: documentation enhancements address #769 requirements, and interactive JS changes address #770 button/feedback issues. No unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 26de1b87-d95f-4141-8a34-93fe15aaa609

📥 Commits

Reviewing files that changed from the base of the PR and between ac91c0a and c6320b2.

📒 Files selected for processing (1)
  • docs/seq-design/fsm.md

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 05df2d73-08fd-465a-b3b1-3ae30f7db15c

📥 Commits

Reviewing files that changed from the base of the PR and between c6320b2 and 6ec73f6.

📒 Files selected for processing (1)
  • assets/js/interactive_soda_machine.js

@VaibhavJindal7
Copy link
Author

Addressed all CodeRabbit review comments:

  1. Fixed spelling: "labeled" → "labelled"
  2. Fixed Mealy output timing description
  3. Fixed grammar: "Lets" → "Let's"
  4. Fixed status message logic in enableButtons function

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b8903096-8da2-4c28-8169-08b57efcf55a

📥 Commits

Reviewing files that changed from the base of the PR and between 6ec73f6 and d734a32.

📒 Files selected for processing (2)
  • assets/js/interactive_soda_machine.js
  • docs/seq-design/fsm.md

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
docs/seq-design/fsm.md (1)

173-175: ⚠️ Potential issue | 🟡 Minor

Hyphenate compound adjective "above-mentioned".

Static analysis correctly flags that "above mentioned" should be hyphenated when used as a compound adjective before a noun.

📝 Proposed fix
 Let's try the soda can vending machine and look for 
 the corresponding state changes in the FSM diagram 
-for each of the above mentioned possibilities.
+for each of the above-mentioned possibilities.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 64839491-0298-4200-9344-072a0a8c2308

📥 Commits

Reviewing files that changed from the base of the PR and between d734a32 and 3475319.

📒 Files selected for processing (2)
  • assets/js/interactive_soda_machine.js
  • docs/seq-design/fsm.md

Comment on lines +194 to +200
3. A Mealy machine has 3 states and one binary input.
The minimum number of rows in its state
transition table will be:
1. 3
2. 6
3. 8
4. 9
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix formatting in question 3.

Line 194 has a double space after "3." (3. A Mealy), and the answer options at lines 197-200 have inconsistent indentation (3 spaces vs expected 0). This may cause rendering issues with the quiz component.

📝 Proposed fix
-3.  A Mealy machine has 3 states and one binary input.
-   The minimum number of rows in its state
-   transition table will be:
-   1. 3
-   2. 6
-   3. 8
-   4. 9
+3. A Mealy machine has 3 states and one binary input.
+   The minimum number of rows in its state
+   transition table will be:
+   1. 3
+   2. 6
+   3. 8
+   4. 9
🧰 Tools
🪛 markdownlint-cli2 (0.21.0)

[warning] 197-197: Inconsistent indentation for list items at the same level
Expected: 0; Actual: 3

(MD005, list-indent)


[warning] 198-198: Inconsistent indentation for list items at the same level
Expected: 0; Actual: 3

(MD005, list-indent)


[warning] 199-199: Inconsistent indentation for list items at the same level
Expected: 0; Actual: 3

(MD005, list-indent)


[warning] 200-200: Inconsistent indentation for list items at the same level
Expected: 0; Actual: 3

(MD005, list-indent)

@VaibhavJindal7
Copy link
Author

Addressed all CodeRabbit review comments:

  1. Fixed button re-enable logic - moved enableButtons() call to case 2 and case 4 in switch statement and removed the fixed 4s timeout.
  2. Renamed "Coin Input" column to "Input / Condition" in state transition table .
  3. Fixed state name W5 -> W0 to match the diagram.
  4. Fixed quiz question 3 wording to "one binary input".

@VaibhavJindal7
Copy link
Author

Addressed remaining CodeRabbit review comments:

  1. Fixed hyphenation: "above mentioned" → "above-mentioned"
  2. Fixed double space after "3." in quiz question 3

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

Labels

None yet

Projects

None yet

1 participant