Softanza
StartFrançais
Softanza
The book · Chapter 15 · The proof of each chapter

Write a narration

This chapter has 4 cells and writes 8 promises. In each of its four editions its cells were run in one fresh process on 2026-10-08 20:15: English, 4 cells ran, 8 promises kept; Français, 4 cells ran, 8 promises kept; العربية, 4 cells ran, 8 promises kept; Hausa, 4 cells ran, 8 promises kept. The four editions make the same promises, cell for cell. No edition stores any output.

The guard

The course's guard is course_narrated.ring(opens in a new tab): it runs every chapter in all four languages, compares the promises from one edition to the next, and has every exercise prove itself on its wrong and right answers. This page asked the same questions of the same objects, in one process inside the library, at commit 0e72e2e2c. To prove this chapter alone, from your copy of the repository:

cd libraries/stzlib/base/test/education
# run course_narrated with the repository's runtime, for this chapter:
#   course_narrated write-a-narration

run on 2026-10-08 20:15 inside the library at commit 4a184e6f0, in 246.4 s for the whole book · The four editions of the chapter: English(opens in a new tab) · Français(opens in a new tab) · العربية(opens in a new tab) · Hausa(opens in a new tab)

The reader stores no output, by the course's own law; this page is the record of a run, made for it.

The cells, run

Cell 1 · 1. A narration is a text file with promises

Softanza
cDoc = "# Mini" + char(10) + "```ring" + char(10) + "? 1 + 1" + char(10) + "#--> 2" + char(10) + "```" + char(10)
cMini = "t_mini_" + ProcessId() + ".en.md"
write(cMini, cDoc)
oCh = StzChapterQ(cMini, "en")
oCh.Run("")
? oCh.NumberOfCells()
#--> 1
? oCh.AllPromisesKept()
#--> TRUE
Output of this run
1
1

ran: the promise is kept · in all four editions

This cell in the chapter: English(opens in a new tab) · Français(opens in a new tab) · العربية(opens in a new tab) · Hausa(opens in a new tab)

Cell 2 · 2. A broken promise is caught, not hidden

Softanza
cBroken = "# Mini" + char(10) + "```ring" + char(10) + "? 1 + 1" + char(10) + "#--> 3" + char(10) + "```" + char(10)
cMini2 = "t_mini2_" + ProcessId() + ".en.md"
write(cMini2, cBroken)
oCh2 = StzChapterQ(cMini2, "en")
oCh2.Run("")
? oCh2.AllPromisesKept()
#--> FALSE
? oCh2.CellKept(1)
#--> FALSE
Output of this run
0
0

ran: the promise is kept · in all four editions

This cell in the chapter: English(opens in a new tab) · Français(opens in a new tab) · العربية(opens in a new tab) · Hausa(opens in a new tab)

Cell 3 · 3. A guard has a positive case and a negative case

Softanza
? oCh.AllPromisesKept() = 1 and oCh2.AllPromisesKept() = 0
#--> TRUE
remove(cMini)
remove(cMini2)
Output of this run
1

ran: the promise is kept · in all four editions

This cell in the chapter: English(opens in a new tab) · Français(opens in a new tab) · العربية(opens in a new tab) · Hausa(opens in a new tab)

Cell 4 · 4. A verdict explains itself

Softanza
oNo = new stzExerciseCheck("demo", [ "3" ], "? 42", [])
? oNo.Passed()
#--> FALSE
? oNo.Why()
#--> Your program ran, but what it printed is not yet what the task asks. It printed: 42
oYes = new stzExerciseCheck("demo", [ "3" ], "? 1 + 2", [])
? oYes.Why()
#--> Every promise of the exercise was kept when your program ran.
Output of this run
0
Your program ran, but what it printed is not yet what the task asks. It printed: 42
Every promise of the exercise was kept when your program ran.

ran: the promise is kept · in all four editions

This cell in the chapter: English(opens in a new tab) · Français(opens in a new tab) · العربية(opens in a new tab) · Hausa(opens in a new tab)

The exercises

Every exercise proves itself: its wrong answers are refused and its right answers accepted.

ex-15-01 · Exercise 15.1 · Your first narration

2 of 2 wrong answers refused, 2 of 2 right answers accepted

01-a-wrong-promise.ring refused · 02-asks-before-running.ring refused · 01-write-and-run.ring accepted · 02-another-cell.ring accepted

The exercise's folder(opens in a new tab)

ex-15-02 · Exercise 15.2 · A positive and a negative case

2 of 2 wrong answers refused, 2 of 2 right answers accepted

01-only-the-positive-case.ring refused · 02-two-good-documents.ring refused · 01-both-cases.ring accepted · 02-cell-verdicts.ring accepted

The exercise's folder(opens in a new tab)

ex-15-03 · Exercise 15.3 · Why did it say no?

2 of 2 wrong answers refused, 2 of 2 right answers accepted

01-prints-the-verdict.ring refused · 02-a-check-that-passed.ring refused · 01-why.ring accepted · 02-why-in-english.ring accepted

The exercise's folder(opens in a new tab)