Build a runnable simulation to learn how a technical system works
A small, commented program you can run to see a protocol or system in action, with experiments to try.
The prompt
Build a small simulation I can run to understand how a technical system or protocol works by watching it in action.
What I want to understand: [e.g. "how CAN bus messages and arbitration work in a car ECU", "how TCP handshakes work", "how a thermostat PID loop works"]
My current level: [beginner / know the theory / work near it]
Language: [e.g. Python, standard library only if possible]
Where I'll run it: [laptop terminal, Jupyter, browser]
Requirements:
- One file I can run immediately, with any install steps listed up front.
- Model the core mechanics faithfully but simply. For a protocol, show the actual message structure (fields, IDs, checksums) and timing; for a control system, show inputs, state, and outputs.
- Print clear, step-by-step output so I can follow what happens and why (e.g. "Node B loses arbitration: its ID 0x200 has a recessive bit where 0x100 is dominant").
- Include at least one realistic failure or edge case (error frame, collision, packet loss, sensor noise) and show how the system handles it.
- Comment the code to explain concepts, not just syntax.
- Keep it under ~200 lines unless more is truly needed.
Return:
1. A plain-language explanation of the system in under 150 words.
2. The code.
3. Sample output with notes on what each part shows.
4. Three experiments I can try by changing parameters, and what I should expect to see.
5. Where the simulation simplifies reality, so I don't learn anything wrong.
Highlighted [brackets] are blanks to replace with your own details.
Fill in the blanks and use this promptMore Learning & Teaching prompts
What to fill in
- beginner / know the theory / work near it
- e.g. Python, standard library only if possible
- laptop terminal, Jupyter, browser
How this prompt is built
This prompt follows the Few-Shot structure (Few-shot prompting). A few-shot prompt includes one or more worked examples of the input and the output you want, so the model can copy the pattern instead of guessing it.
Related prompts
- Choose a beginner coding project and the language to build it inThree starter project ideas that match your goals, a recommended language and tools, and a small first version.
- Turn a long work document into a step-by-step learning pathConverts a policy, manual, playbook, or spec into short, sequenced lessons with practice and checks.
- Give me work problems to solve before showing the answerRealistic practice problems one at a time, with hints only when you ask and the full solution after your attempt.
- Break a new skill into sub-skills and decide what to learn firstA map of the parts of a skill, the few that matter most for your goal, and a benchmark to measure progress.