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

When code meets cells

This chapter has 5 cells and writes 9 promises. In each of its four editions its cells were run in one fresh process on 2026-10-08 20:15: English, 5 cells ran, 9 promises kept; Français, 5 cells ran, 9 promises kept; العربية, 5 cells ran, 9 promises kept; Hausa, 5 cells ran, 9 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 when-code-meets-cells

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. Build the table, and look at it

Softanza
oT = new stzTable([
	[ :DISH, :PRICE, :ORDERS ],
	[ "tea",  200, 6 ],
	[ "rice", 500, 3 ],
	[ "fish", 900, 2 ]
])
oT.Show()
Output of this run
╭──────┬───────┬────────╮
│ Dish │ Price │ Orders │
├──────┼───────┼────────┤
│ tea  │   200 │      6 │
│ rice │   500 │      3 │
│ fish │   900 │      2 │
╰──────┴───────┴────────╯

ran: this cell writes no promise

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. Its shape

Softanza
? oT.NumberOfRows()
#--> 3
? oT.NumberOfCols()
#--> 3
? @@( oT.ColNames() )
#--> [ "dish", "price", "orders" ]
Output of this run
3
3
[ "dish", "price", "orders" ]

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 column, a row

Softanza
? @@( oT.Col(:PRICE) )
#--> [ 200, 500, 900 ]
? @@( oT.Row(2) )
#--> [ "rice", 500, 3 ]
Output of this run
[ 200, 500, 900 ]
[ "rice", 500, 3 ]

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 cell, and where a value is

Softanza
? oT.Cell(:PRICE, 3)
#--> 900
? @@( oT.FindInCol(:DISH, "fish") )
#--> [ 3 ]
Output of this run
900
[ 3 ]

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 5 · 5. A column is a list: ask it the list questions

Softanza
? StzListQ(oT.Col(:ORDERS)).Sum()
#--> 11
? @@( StzListQ(oT.Col(:PRICE)).FindW("{ @item > 400 }") )
#--> [ 2, 3 ]
Output of this run
11
[ 2, 3 ]

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-10-01 · Exercise 10.1 · The menu

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

01-the-whole-row.ring refused · 02-rows-not-orders.ring refused · 01-cell-and-sum.ring accepted · 02-by-position.ring accepted

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