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

Find, then apply

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

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. Select the object

Softanza
o1 = new stzList([ "tea", "rice", "tea", "fish", "rice", "tea" ])
? o1.NumberOfItems()
#--> 6
Output of this run
6

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. Ask the containment question

Softanza
? o1.ContainsDuplicates()
#--> TRUE
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 3 · 3. Ask the count question

Softanza
? o1.NumberOfDuplicates()
#--> 3
Output of this run
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. Ask for the positions

Softanza
? @@( o1.FindDuplicates() )
#--> [ 3, 5, 6 ]
Output of this run
[ 3, 5, 6 ]

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. Act on the positions

Softanza
o1.RemoveItemsAtPositions( o1.FindDuplicates() )
? @@( o1.Content() )
#--> [ "tea", "rice", "fish" ]
Output of this run
[ "tea", "rice", "fish" ]

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 6 · 5. Act on the positions

Softanza
? @@( StzListQ([ "tea", "rice", "tea" ]).DuplicatesRemoved() )
#--> [ "tea", "rice" ]
Output of this run
[ "tea", "rice" ]

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 7 · 6. The same questions, on your workplace

Softanza
o2 = new stzList( EduWorldObjects("requested") )
? EduWorldName()
? o2.ContainsDuplicates()
? o2.NumberOfDuplicates()
? @@( o2.DuplicatesRemoved() )
Output of this run
bella-cucina (restaurant)
1
3
[ "margherita", "tiramisu", "lasagna" ]

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 8 · 7. Say it in your own words

Softanza
? @@( Naturally("Create a list with [ 5, 3, 5, 1 ] and remove its duplicates").Result() )
#--> [ 5, 3, 1 ]
Output of this run
[ 5, 3, 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)

The exercises

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

ex-01-01 · Exercise 1.1 · The kitchen's list

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

01-prints-the-orders.ring refused · 02-sorts-first.ring refused · 03-calls-a-missing-method.ring refused · 01-the-shortcut.ring accepted · 02-find-then-apply.ring accepted

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