Sharing a first BASIC session
Teacher notes · Companion to learner workbook v0.1 · 17 October 2026
Help learners make a prediction, test one deliberate change and explain the result. These notes contain hints and answers; keep them separate from the pupil booklet.
Prepare on the actual computers
- Open code198x.com/try/spectrum-basic/ and follow its linked lesson to Run an editable listing.
- Check editing, Run this code, Back to the listing, Listing options → Download tape and reopening a saved text listing after reloading the lesson. Test the school network and download restrictions before the session.
- Print one learner booklet per learner or pair, A4 at actual size. It works in black and white. Provide paper or another way to record explanations.
- Try larger text and keyboard controls on the devices you will use. Ask what helps each learner read, type or compare results.
No account, original Spectrum or local installation is needed for this activity. A browser that can run the embedded tools and an internet connection are needed for live testing. Paper tracing remains available if those are blocked.
What to look for
- A prediction before running.
- A deliberate edit to one quoted message, with the other instructions preserved.
- An explanation pointing to the instruction responsible.
- A kept copy, checked by reopening if the tools are available.
Organise the group
Pair an editor/operator with a predictor/checker and swap roles after the first change. Invite experienced learners to explore line ordering without supplying everyone else’s answers. Use the first changed greeting as a stopping point; extend only when useful. No fixed completion time is promised.
Hints and expected results
The maintained starting listing is:
10 PRINT "Welcome"
15 PRINT "to you"
20 PRINT "from the Spectrum"With no changes, its output is:
Welcome to you from the Spectrum
Changing only the quoted message in line 10 changes only the first output line. The learner’s chosen words need not match the example on the booklet’s first page.
Offer a hint before the answer
Ask “Which instruction contains those words?” or “What stayed the same?” Point to one line if needed. Keep quotation marks and the remaining instructions intact.
Optional renumbering experiment
In the text listing, replacing line number 15 with 25 produces running order 10, 20, 25. The output is the learner’s greeting, then from the Spectrum, then to you.
This straight-line program follows increasing line numbers, not the order in which the lines were edited. Do not generalise that statement to programs with jumps or other control flow.
Direct Spectrum entry behaves differently: entering 25 PRINT "to you" adds line 25; it does not remove line 15. In a direct session, a line number entered alone deletes that stored line. The workbook uses the complete text editor so learners change the existing source line.
When something differs
- Syntax error: check quotation marks and spelling against the listing. Treat the error location as a clue.
- Old output: confirm that the edited listing was run and the expected greeting was changed.
- Unexpected order or extra message: inspect all stored line numbers and distinguish direct keyboard entry from replacing the text listing.
Ask learners to retain both their prediction and observation. A changed explanation after an unexpected result is useful evidence of understanding.
Save, follow up and reuse
Keep the complete readable listing in a saved plain text file. Reload the lesson, replace the whole editable listing with the saved source, then choose Run this code. Check that the learner’s chosen words reappear. This establishes recovery of their kept source, not merely a successful save report.
Listing options → Download tape also retains the edited listing as a .tap program for an emulator with tape-loading controls. The current editable browser panel has no tape file picker; its recovery path is to paste saved source into the listing.
Typing BASIC SAVE into this browser Spectrum is a different workflow. No recorder is attached to retain that signal. Use the listing controls to download a tape image.
A useful closing conversation
- “Show me the instruction you changed.”
- “What made that instruction different from its result?”
- “How would you check a kept program tomorrow?”
Accept explanations in words, drawings or code. A copied program that runs is not, by itself, evidence that its author understands it. Offer pauses and help, and avoid turning the activity into a scored gate.
Where to go next
BASIC activity and next lesson · First-session companion · Broader teaching guide
Assembly remains an independent option at code198x.com/try/spectrum-assembly/. This BASIC booklet is not a prerequisite.
Source and reuse
Adapted from Code Like It's 198x, Make the Spectrum answer, Make a greeting with Spectrum BASIC and Sharing a first Code198x session. This adaptation adds paper response space, paired activity prompts and separate expected results. Version 0.1, 17 October 2026.
Original and adapted prose: Creative Commons Attribution 4.0 International. Credit Code Like It's 198x, link the source and licence, and indicate further changes. Code samples: MIT, with the accompanying code licence notice. This prose licence does not cover third-party assets or project marks.
The sample comes from meet-basic/opening/unit-01/steps/step-04.bas. The accompanying source record gives the full repository path, revision and hash. Sinclair behaviour is described in Steven Vickers, edited by Robin Bradbeer, ZX Spectrum BASIC Programming, second edition (Sinclair Research, 1983), chapter 2 and introductory editing notes, cited in the online lesson.