← Softanza · Learn · Softanza · Apprendre

Softanza · elementary-introduction

Find, then apply

S0 · Explorer · this chapter belongs to this rung, earned when chapters 1 to 4 and project-s0 have passed: A five-cell narration over a list of your own, where every cell runs. The ladder

Proof · 8 cells ran, 7 promises kept, in each of the four editions · the proof of this chapter

Elementary Introduction · Chapter 1 · Skill EX-03: "Where is it, and what do I do there?"

Every workplace receives requests. A restaurant receives orders and a bank receives tickets, and the same request often arrives more than once. This chapter deals with repeated requests the Softanza way. First you select the object. Then you ask whether it contains what you are looking for, count it, and find it. Only then do you act.

1. Select the object

A list of requests is a stzList.

Runs on the desktop with SoftanzaProof of this cell
o1 = new stzList([ "tea", "rice", "tea", "fish", "rice", "tea" ])
? o1.NumberOfItems()
#--> 6
This page stores no output. Run the cell to see what it prints.

2. Ask the containment question

Before acting, ask whether there is anything to act on.

Runs on the desktop with SoftanzaProof of this cell
? o1.ContainsDuplicates()
#--> TRUE
This page stores no output. Run the cell to see what it prints.

3. Ask the count question

Runs on the desktop with SoftanzaProof of this cell
? o1.NumberOfDuplicates()
#--> 3
This page stores no output. Run the cell to see what it prints.

4. Ask for the positions

Runs on the desktop with SoftanzaProof of this cell
? @@( o1.FindDuplicates() )
#--> [ 3, 5, 6 ]
This page stores no output. Run the cell to see what it prints.

5. Act on the positions

You know where the repeated requests are, so you can remove them.

Runs on the desktop with SoftanzaProof of this cell
o1.RemoveItemsAtPositions( o1.FindDuplicates() )
? @@( o1.Content() )
#--> [ "tea", "rice", "fish" ]
This page stores no output. Run the cell to see what it prints.

Softanza also has one word for the whole move. Read it as a sentence: the list, with its duplicates removed.

Runs on the desktop with SoftanzaProof of this cell
? @@( StzListQ([ "tea", "rice", "tea" ]).DuplicatesRemoved() )
#--> [ "tea", "rice" ]
This page stores no output. Run the cell to see what it prints.

6. The same questions, on your workplace

This cell reads the requests that your workplace received today. What it prints depends on the world this course runs over, so the page never shows an output: run it.

Runs on the desktop with SoftanzaProof of this cell
o2 = new stzList( EduWorldObjects("requested") )
? EduWorldName()
? o2.ContainsDuplicates()
? o2.NumberOfDuplicates()
? @@( o2.DuplicatesRemoved() )
This page stores no output. Run the cell to see what it prints.

7. Say it in your own words

Softanza also understands the same request written as a sentence.

Runs on the desktop with SoftanzaProof of this cell
? @@( Naturally("Create a list with [ 5, 3, 5, 1 ] and remove its duplicates").Result() )
#--> [ 5, 3, 1 ]
This page stores no output. Run the cell to see what it prints.

Recap

Traduction provisoire : pas encore relue par un locuteur natif.

Trouver, puis agir

S0 · Explorateur · ce chapitre appartient à ce barreau, gagné quand les chapitres 1 à 4 et project-s0 sont réussis : Une narration de cinq cellules sur une liste à vous, où chaque cellule s'exécute. L'échelle

Preuve · 8 cellules exécutées, 7 promesses tenues, dans chacune des quatre éditions · la preuve de ce chapitre

Introduction élémentaire · Chapitre 1 · Compétence EX-03 : « Où est-ce, et qu'est-ce que j'en fais ? »

Traduction provisoire, en attente de relecture par un locuteur natif.

Tout lieu de travail reçoit des demandes : un restaurant reçoit des commandes, une banque reçoit des tickets, et la même demande arrive souvent plusieurs fois. Ce chapitre traite les demandes répétées à la manière de Softanza. D'abord on choisit l'objet. Ensuite on demande s'il contient ce que l'on cherche, on le compte, on le trouve. Et seulement alors on agit.

1. Choisir l'objet

Une liste de demandes est une stzList.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
o1 = new stzList([ "tea", "rice", "tea", "fish", "rice", "tea" ])
? o1.NumberOfItems()
#--> 6
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

2. Poser la question de la présence

Avant d'agir, demandez s'il y a quelque chose sur quoi agir.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? o1.ContainsDuplicates()
#--> TRUE
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

3. Poser la question du nombre

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? o1.NumberOfDuplicates()
#--> 3
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

4. Demander les positions

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? @@( o1.FindDuplicates() )
#--> [ 3, 5, 6 ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

5. Agir sur les positions

Vous savez où se trouvent les demandes répétées : vous pouvez les retirer.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
o1.RemoveItemsAtPositions( o1.FindDuplicates() )
? @@( o1.Content() )
#--> [ "tea", "rice", "fish" ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

Softanza a aussi un seul mot pour tout le geste. Lisez-le comme une phrase : la liste, doublons retirés.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? @@( StzListQ([ "tea", "rice", "tea" ]).DuplicatesRemoved() )
#--> [ "tea", "rice" ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

6. Les mêmes questions, sur votre lieu de travail

Cette cellule lit les demandes que votre lieu de travail a reçues aujourd'hui. Ce qu'elle affiche dépend du monde sur lequel ce cours s'exécute : la page n'affiche donc jamais de résultat. Exécutez-la.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
o2 = new stzList( EduWorldObjects("requested") )
? EduWorldName()
? o2.ContainsDuplicates()
? o2.NumberOfDuplicates()
? @@( o2.DuplicatesRemoved() )
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

7. Le dire avec vos propres mots

Softanza comprend aussi la même demande écrite en français.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? @@( NaturallyIn("fr", "Crée une liste avec [ 5, 3, 5, 1 ] et enlève les doublons").Result() )
#--> [ 5, 3, 1 ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

Récapitulatif

ترجمة أولية: لم يراجعها بعدُ ناطق أصلي بالعربية.

ابحث، ثم طبّق

S0 · 1 – 4 · project-s0 · سرد من خمس خلايا على قائمة من عندك، تعمل فيه كل خلية. S0 – S4

course_narrated · 7/8 · ↗

مدخل أساسي · الفصل 1 · المهارة EX-03: «أين هو، وماذا أفعل هناك؟»

ترجمة أولية، في انتظار مراجعة متحدث أصلي.

كل مكان عمل يتلقى طلبات: المطعم يتلقى طلبيات، والبنك يتلقى تذاكر، وكثيرًا ما يصل الطلب نفسه أكثر من مرة. يعالج هذا الفصل الطلبات المكررة بطريقة سوفتانزا. أولًا نختار الكائن. ثم نسأل هل يحتوي على ما نبحث عنه، ونعدّه، ونجده. وبعد ذلك فقط نتصرّف.

1. اختر الكائن

قائمة الطلبات هي stzList.

تعمل على الحاسوب مع سوفتانزا↗ 1/8
o1 = new stzList([ "tea", "rice", "tea", "fish", "rice", "tea" ])
? o1.NumberOfItems()
#--> 6
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

2. اطرح سؤال الاحتواء

قبل أن تتصرّف، اسأل هل هناك ما يستحق التصرّف.

تعمل على الحاسوب مع سوفتانزا↗ 2/8
? o1.ContainsDuplicates()
#--> TRUE
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

3. اطرح سؤال العدد

تعمل على الحاسوب مع سوفتانزا↗ 3/8
? o1.NumberOfDuplicates()
#--> 3
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

4. اسأل عن المواضع

تعمل على الحاسوب مع سوفتانزا↗ 4/8
? @@( o1.FindDuplicates() )
#--> [ 3, 5, 6 ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

5. تصرّف في المواضع

أنت تعرف أين توجد الطلبات المكررة، فتستطيع إزالتها.

تعمل على الحاسوب مع سوفتانزا↗ 5/8
o1.RemoveItemsAtPositions( o1.FindDuplicates() )
? @@( o1.Content() )
#--> [ "tea", "rice", "fish" ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

ولسوفتانزا كلمة واحدة للحركة كلها. اقرأها كجملة: القائمة، وقد أزيلت منها التكرارات.

تعمل على الحاسوب مع سوفتانزا↗ 6/8
? @@( StzListQ([ "tea", "rice", "tea" ]).DuplicatesRemoved() )
#--> [ "tea", "rice" ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

6. الأسئلة نفسها، على مكان عملك

تقرأ هذه الخلية الطلبات التي تلقاها مكان عملك اليوم. ما تطبعه يتوقف على العالم الذي يجري عليه هذا الدرس، ولذلك لا تعرض الصفحة أي نتيجة أبدًا: شغّلها.

تعمل على الحاسوب مع سوفتانزا↗ 7/8
o2 = new stzList( EduWorldObjects("requested") )
? EduWorldName()
? o2.ContainsDuplicates()
? o2.NumberOfDuplicates()
? @@( o2.DuplicatesRemoved() )
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

7. قلها بكلماتك

تفهم سوفتانزا الطلب نفسه مكتوبًا بالعربية أيضًا.

تعمل على الحاسوب مع سوفتانزا↗ 8/8
? @@( NaturallyIn("ar", "أنشئ قائمة مع [ 5, 3, 5, 1 ] أزل التكرارات").Result() )
#--> [ 5, 3, 1 ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

الخلاصة

Fassara ta farko: wani ɗan asalin harshen Hausa bai riga ya duba ta ba tukuna.

Nemo, sannan ka aiwatar

S0 · 1 – 4 · project-s0 · Labari mai ɗakuna biyar a kan jerin naka, inda kowane ɗaki yake gudana. S0 – S4

course_narrated · 7/8 · ↗

Gabatarwa ta Farko · Babi na 1 · Fasaha EX-03: "Ina yake, kuma me zan yi a can?"

Fassarar farko ce, tana jiran bita daga mai magana da Hausa a matsayin harshen uwa.

Kowane wurin aiki yana karɓar buƙatu: gidan abinci yana karɓar oda, banki yana karɓar tikiti, kuma buƙata ɗaya takan zo fiye da sau ɗaya. Wannan babin yana maganin buƙatun da aka maimaita ta hanyar Softanza. Da farko ka zaɓi abin. Sannan ka tambaya ko yana ɗauke da abin da kake nema, ka ƙidaya shi, ka nemo shi. Sai bayan haka ka aiwatar.

1. Zaɓi abin

Jerin buƙatu stzList ne.

Tana gudana a kwamfuta tare da Softanza↗ 1/8
o1 = new stzList([ "tea", "rice", "tea", "fish", "rice", "tea" ])
? o1.NumberOfItems()
#--> 6
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

2. Yi tambayar "ko yana ɗauke"

Kafin ka aiwatar, ka tambaya ko akwai abin da za a yi wa aiki.

Tana gudana a kwamfuta tare da Softanza↗ 2/8
? o1.ContainsDuplicates()
#--> TRUE
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

3. Yi tambayar "guda nawa"

Tana gudana a kwamfuta tare da Softanza↗ 3/8
? o1.NumberOfDuplicates()
#--> 3
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

4. Tambayi wurare

Tana gudana a kwamfuta tare da Softanza↗ 4/8
? @@( o1.FindDuplicates() )
#--> [ 3, 5, 6 ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

5. Aiwatar a wuraren

Ka san inda buƙatun da aka maimaita suke, don haka za ka iya cire su.

Tana gudana a kwamfuta tare da Softanza↗ 5/8
o1.RemoveItemsAtPositions( o1.FindDuplicates() )
? @@( o1.Content() )
#--> [ "tea", "rice", "fish" ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

Softanza kuma tana da kalma ɗaya don dukan aikin. Karanta ta kamar jimla: jerin, an cire maimaitattu.

Tana gudana a kwamfuta tare da Softanza↗ 6/8
? @@( StzListQ([ "tea", "rice", "tea" ]).DuplicatesRemoved() )
#--> [ "tea", "rice" ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

6. Tambayoyi iri ɗaya, a wurin aikinka

Wannan ɗakin yana karanta buƙatun da wurin aikinka ya karɓa yau. Abin da yake bugawa ya dogara da duniyar da wannan darasi yake gudana a kai, don haka shafin ba ya nuna sakamako ko kaɗan: ka gudanar da shi.

Tana gudana a kwamfuta tare da Softanza↗ 7/8
o2 = new stzList( EduWorldObjects("requested") )
? EduWorldName()
? o2.ContainsDuplicates()
? o2.NumberOfDuplicates()
? @@( o2.DuplicatesRemoved() )
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

7. Faɗe shi da kalmominka

Softanza tana fahimtar buƙata ɗaya idan an rubuta ta da Hausa.

Tana gudana a kwamfuta tare da Softanza↗ 8/8
? @@( NaturallyIn("ha", "Yi jeri dauke [ 5, 3, 5, 1 ] cire maimaitattu").Result() )
#--> [ 5, 3, 1 ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

Taƙaitawa

A first sentence

S0 · Explorer · this chapter belongs to this rung, earned when chapters 1 to 4 and project-s0 have passed: A five-cell narration over a list of your own, where every cell runs. The ladder

Proof · 5 cells ran, 6 promises kept, in each of the four editions · the proof of this chapter

Elementary Introduction · Chapter 2 · Skills FO-01 "What am I really asking?" and EX-01 "Which object holds my data?"

In chapter 1 the requests came as a list. Today they come as a sentence: a customer's complaint. Before any code, the mental model asks you to say the problem in words and pull out its keywords, because the keywords name the object you will select.

1. Say the problem

"Does this complaint repeat a word, and which one?"

Three keywords. Complaint is a text, so the object is a stzString. Word is something a string can give you. Repeat is a question about duplicates, and duplicates live in a list.

2. Select the object

Runs on the desktop with SoftanzaProof of this cell
o1 = new stzString("the bread was cold and the tea was cold")
? o1.NumberOfWords()
#--> 9
This page stores no output. Run the cell to see what it prints.

3. Ask the string for its words

Runs on the desktop with SoftanzaProof of this cell
? @@( o1.Words() )
#--> [ "the", "bread", "was", "cold", "and", "the", "tea", "was", "cold" ]
This page stores no output. Run the cell to see what it prints.

4. The keyword "repeat" belongs to a list

The words are a list now, so the questions of chapter 1 apply to them unchanged.

Runs on the desktop with SoftanzaProof of this cell
oW = new stzList( o1.Words() )
? oW.ContainsDuplicates()
#--> TRUE
? oW.NumberOfDuplicates()
#--> 3
This page stores no output. Run the cell to see what it prints.

5. Find, then apply

Runs on the desktop with SoftanzaProof of this cell
? @@( oW.FindDuplicates() )
#--> [ 6, 8, 9 ]
? @@( oW.DuplicatesRemoved() )
#--> [ "the", "bread", "was", "cold", "and", "tea" ]
This page stores no output. Run the cell to see what it prints.

6. Your workplace, as a sentence

The requests your workplace received today, joined into one sentence. What it prints depends on the world this course runs over, so run it.

Runs on the desktop with SoftanzaProof of this cell
aReq = EduWorldObjects("requested")
? Q(aReq).Joined(", ")
? Q( Q(aReq).Joined(" ") ).NumberOfWords()
This page stores no output. Run the cell to see what it prints.

Recap

Traduction provisoire : pas encore relue par un locuteur natif.

Une première phrase

S0 · Explorateur · ce chapitre appartient à ce barreau, gagné quand les chapitres 1 à 4 et project-s0 sont réussis : Une narration de cinq cellules sur une liste à vous, où chaque cellule s'exécute. L'échelle

Preuve · 5 cellules exécutées, 6 promesses tenues, dans chacune des quatre éditions · la preuve de ce chapitre

Introduction élémentaire · Chapitre 2 · Compétences FO-01 « Qu'est-ce que je demande vraiment ? » et EX-01 « Quel objet porte mes données ? »

Traduction provisoire, en attente de relecture par un locuteur natif.

Au chapitre 1, les demandes arrivaient sous forme de liste. Aujourd'hui elles arrivent sous forme de phrase : la réclamation d'un client. Avant tout code, le modèle mental vous demande de dire le problème en mots et d'en extraire les mots-clés, parce que ce sont eux qui nomment l'objet que vous choisirez.

1. Dire le problème

« Cette réclamation répète-t-elle un mot, et lequel ? »

Trois mots-clés. Réclamation est un texte : l'objet est donc une stzString. Mot est une chose qu'une chaîne peut vous donner. Répéter est une question sur les doublons, et les doublons vivent dans une liste.

2. Choisir l'objet

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
o1 = new stzString("the bread was cold and the tea was cold")
? o1.NumberOfWords()
#--> 9
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

3. Demander ses mots à la chaîne

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? @@( o1.Words() )
#--> [ "the", "bread", "was", "cold", "and", "the", "tea", "was", "cold" ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

4. Le mot-clé « répéter » appartient à une liste

Les mots sont maintenant une liste : les questions du chapitre 1 s'y appliquent telles quelles.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oW = new stzList( o1.Words() )
? oW.ContainsDuplicates()
#--> TRUE
? oW.NumberOfDuplicates()
#--> 3
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

5. Trouver, puis agir

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? @@( oW.FindDuplicates() )
#--> [ 6, 8, 9 ]
? @@( oW.DuplicatesRemoved() )
#--> [ "the", "bread", "was", "cold", "and", "tea" ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

6. Votre lieu de travail, en une phrase

Les demandes que votre lieu de travail a reçues aujourd'hui, réunies en une seule phrase. Ce qui s'affiche dépend du monde sur lequel ce cours s'exécute : exécutez la cellule.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
aReq = EduWorldObjects("requested")
? Q(aReq).Joined(", ")
? Q( Q(aReq).Joined(" ") ).NumberOfWords()
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

Récapitulatif

ترجمة أولية: لم يراجعها بعدُ ناطق أصلي بالعربية.

جملة أولى

S0 · 1 – 4 · project-s0 · سرد من خمس خلايا على قائمة من عندك، تعمل فيه كل خلية. S0 – S4

course_narrated · 4/5 · ↗

مدخل أساسي · الفصل 2 · المهارتان FO-01 «ما الذي أسأل عنه حقًا؟» وEX-01 «أيّ كائن يحمل بياناتي؟»

ترجمة أولية، في انتظار مراجعة متحدث أصلي.

في الفصل الأول جاءت الطلبات قائمةً. اليوم تأتي جملةً: شكوى زبون. قبل أي شفرة، يطلب منك النموذج الذهني أن تقول المشكلة بالكلمات وتستخرج كلماتها المفتاحية، لأن الكلمات المفتاحية هي التي تسمّي الكائن الذي ستختاره.

1. قل المشكلة

«هل تكرر هذه الشكوى كلمة، وأيّ كلمة؟»

ثلاث كلمات مفتاحية. الشكوى نص، فالكائن إذن stzString. الكلمة شيء يستطيع النص أن يعطيك إياه. التكرار سؤال عن التكرارات، والتكرارات تسكن في قائمة.

2. اختر الكائن

تعمل على الحاسوب مع سوفتانزا↗ 1/5
o1 = new stzString("the bread was cold and the tea was cold")
? o1.NumberOfWords()
#--> 9
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

3. اسأل النص عن كلماته

تعمل على الحاسوب مع سوفتانزا↗ 2/5
? @@( o1.Words() )
#--> [ "the", "bread", "was", "cold", "and", "the", "tea", "was", "cold" ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

4. الكلمة المفتاحية «تكرار» تنتمي إلى قائمة

صارت الكلمات قائمة الآن، فتنطبق عليها أسئلة الفصل الأول دون تغيير.

تعمل على الحاسوب مع سوفتانزا↗ 3/5
oW = new stzList( o1.Words() )
? oW.ContainsDuplicates()
#--> TRUE
? oW.NumberOfDuplicates()
#--> 3
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

5. ابحث، ثم طبّق

تعمل على الحاسوب مع سوفتانزا↗ 4/5
? @@( oW.FindDuplicates() )
#--> [ 6, 8, 9 ]
? @@( oW.DuplicatesRemoved() )
#--> [ "the", "bread", "was", "cold", "and", "tea" ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

6. مكان عملك، في جملة

الطلبات التي تلقاها مكان عملك اليوم، مجموعةً في جملة واحدة. ما يُطبع يتوقف على العالم الذي يجري عليه هذا الدرس: شغّل الخلية.

تعمل على الحاسوب مع سوفتانزا↗ 5/5
aReq = EduWorldObjects("requested")
? Q(aReq).Joined(", ")
? Q( Q(aReq).Joined(" ") ).NumberOfWords()
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

الخلاصة

Fassara ta farko: wani ɗan asalin harshen Hausa bai riga ya duba ta ba tukuna.

Jimla ta farko

S0 · 1 – 4 · project-s0 · Labari mai ɗakuna biyar a kan jerin naka, inda kowane ɗaki yake gudana. S0 – S4

course_narrated · 4/5 · ↗

Gabatarwa ta Farko · Babi na 2 · Fasahohi FO-01 "Me nake tambaya da gaske?" da EX-01 "Wane abu ne ya riƙe bayanaina?"

Fassarar farko ce, tana jiran bita daga mai magana da Hausa a matsayin harshen uwa.

A babi na 1 buƙatun sun zo a matsayin jeri. Yau suna zuwa a matsayin jimla: ƙorafin abokin ciniki. Kafin kowace lamba, tsarin tunani yana roƙonka ka faɗi matsalar da kalmomi ka fitar da manyan kalmominta, domin manyan kalmomin ne suke sunan abin da za ka zaɓa.

1. Faɗi matsalar

"Shin wannan ƙorafin yana maimaita kalma, kuma wacce?"

Manyan kalmomi uku. Ƙorafi rubutu ne, saboda haka abin stzString ne. Kalma abu ne da rubutu zai iya ba ka. Maimaitawa tambaya ce game da maimaitattu, kuma maimaitattu suna zaune a cikin jeri.

2. Zaɓi abin

Tana gudana a kwamfuta tare da Softanza↗ 1/5
o1 = new stzString("the bread was cold and the tea was cold")
? o1.NumberOfWords()
#--> 9
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

3. Tambayi rubutun kalmominsa

Tana gudana a kwamfuta tare da Softanza↗ 2/5
? @@( o1.Words() )
#--> [ "the", "bread", "was", "cold", "and", "the", "tea", "was", "cold" ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

4. Babbar kalmar "maimaitawa" ta jeri ce

Kalmomin jeri ne yanzu, saboda haka tambayoyin babi na 1 suna aiki a kansu ba tare da canji ba.

Tana gudana a kwamfuta tare da Softanza↗ 3/5
oW = new stzList( o1.Words() )
? oW.ContainsDuplicates()
#--> TRUE
? oW.NumberOfDuplicates()
#--> 3
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

5. Nemo, sannan ka aiwatar

Tana gudana a kwamfuta tare da Softanza↗ 4/5
? @@( oW.FindDuplicates() )
#--> [ 6, 8, 9 ]
? @@( oW.DuplicatesRemoved() )
#--> [ "the", "bread", "was", "cold", "and", "tea" ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

6. Wurin aikinka, a matsayin jimla

Buƙatun da wurin aikinka ya karɓa yau, an haɗa su cikin jimla ɗaya. Abin da yake bugawa ya dogara da duniyar da wannan darasi yake gudana a kai: ka gudanar da ɗakin.

Tana gudana a kwamfuta tare da Softanza↗ 5/5
aReq = EduWorldObjects("requested")
? Q(aReq).Joined(", ")
? Q( Q(aReq).Joined(" ") ).NumberOfWords()
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

Taƙaitawa

Read the name as a sentence

S0 · Explorer · this chapter belongs to this rung, earned when chapters 1 to 4 and project-s0 have passed: A five-cell narration over a list of your own, where every cell runs. The ladder

Proof · 7 cells ran, 10 promises kept, in each of the four editions · the proof of this chapter

Elementary Introduction · Chapter 3 · Skill EX-04: "Does this name change the object, give me a copy, or continue the sentence?"

A Softanza method name is a sentence spoken to an object. Its grammar tells you what will happen before you run it. This chapter teaches the three forms you will meet on every page: the active, the passive and the fluent.

1. The active form changes the object

RemoveAll is an order. The object obeys and is changed.

Runs on the desktop with SoftanzaProof of this cell
o1 = new stzString("HAxxRxO")
o1.RemoveAll("x")
? o1.Content()
#--> HARO
This page stores no output. Run the cell to see what it prints.

2. The passive form gives you a copy

Removed is a past participle: the string, with x removed. It answers with a new value and leaves the object as it was.

Runs on the desktop with SoftanzaProof of this cell
o1 = new stzString("HAxxRxO")
? o1.Removed("x")
#--> HARO
? o1.Content()
#--> HAxxRxO
This page stores no output. Run the cell to see what it prints.

3. The fluent form continues the sentence

A Q at the end of a name means and then. The sentence goes on until a passive closes it.

Runs on the desktop with SoftanzaProof of this cell
? Q("haxxrxo").RemoveQ("x").UppercaseQ().Spacified()
#--> H A R O
This page stores no output. Run the cell to see what it prints.

4. A fluent sentence on an object changes it

Runs on the desktop with SoftanzaProof of this cell
o1 = new stzString("haxxrxo")
? o1.RemoveQ("x").Uppercased()
#--> HARO
? o1.Content()
#--> haro
This page stores no output. Run the cell to see what it prints.

5. Say "on a copy" with QC

QC means and then, on a copy. The original is untouched.

Runs on the desktop with SoftanzaProof of this cell
o1 = new stzString("haxxrxo")
? o1.RemoveQC("x").Uppercased()
#--> HARO
? o1.Content()
#--> haxxrxo
This page stores no output. Run the cell to see what it prints.

6. A named parameter reads as prose

Runs on the desktop with SoftanzaProof of this cell
? Q("tea, rice, tea").Replaced("tea", :With = "coffee")
#--> coffee, rice, coffee
This page stores no output. Run the cell to see what it prints.

7. A question is a name that starts with Is

Runs on the desktop with SoftanzaProof of this cell
? Q("bread").IsLowercase()
#--> TRUE
This page stores no output. Run the cell to see what it prints.

Recap

Traduction provisoire : pas encore relue par un locuteur natif.

Lire le nom comme une phrase

S0 · Explorateur · ce chapitre appartient à ce barreau, gagné quand les chapitres 1 à 4 et project-s0 sont réussis : Une narration de cinq cellules sur une liste à vous, où chaque cellule s'exécute. L'échelle

Preuve · 7 cellules exécutées, 10 promesses tenues, dans chacune des quatre éditions · la preuve de ce chapitre

Introduction élémentaire · Chapitre 3 · Compétence EX-04 : « Ce nom change-t-il l'objet, me donne-t-il une copie, ou continue-t-il la phrase ? »

Traduction provisoire, en attente de relecture par un locuteur natif.

Un nom de méthode Softanza est une phrase adressée à un objet. Sa grammaire vous dit ce qui va se passer avant même de l'exécuter. Ce chapitre enseigne les trois formes que vous rencontrerez à chaque page : la forme active, la forme passive et la forme fluide.

1. La forme active change l'objet

RemoveAll est un ordre. L'objet obéit et il est modifié.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
o1 = new stzString("HAxxRxO")
o1.RemoveAll("x")
? o1.Content()
#--> HARO
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

2. La forme passive vous donne une copie

Removed est un participe passé : la chaîne, les x retirés. Elle répond par une nouvelle valeur et laisse l'objet tel qu'il était.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
o1 = new stzString("HAxxRxO")
? o1.Removed("x")
#--> HARO
? o1.Content()
#--> HAxxRxO
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

3. La forme fluide continue la phrase

Un Q à la fin d'un nom signifie et puis. La phrase continue jusqu'à ce qu'un passif la ferme.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? Q("haxxrxo").RemoveQ("x").UppercaseQ().Spacified()
#--> H A R O
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

4. Une phrase fluide sur un objet le modifie

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
o1 = new stzString("haxxrxo")
? o1.RemoveQ("x").Uppercased()
#--> HARO
? o1.Content()
#--> haro
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

5. Dire « sur une copie » avec QC

QC signifie et puis, sur une copie. L'original n'est pas touché.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
o1 = new stzString("haxxrxo")
? o1.RemoveQC("x").Uppercased()
#--> HARO
? o1.Content()
#--> haxxrxo
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

6. Un paramètre nommé se lit comme de la prose

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? Q("tea, rice, tea").Replaced("tea", :With = "coffee")
#--> coffee, rice, coffee
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

7. Une question est un nom qui commence par Is

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? Q("bread").IsLowercase()
#--> TRUE
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

Récapitulatif

ترجمة أولية: لم يراجعها بعدُ ناطق أصلي بالعربية.

اقرأ الاسم كجملة

S0 · 1 – 4 · project-s0 · سرد من خمس خلايا على قائمة من عندك، تعمل فيه كل خلية. S0 – S4

course_narrated · 7/7 · ↗

مدخل أساسي · الفصل 3 · المهارة EX-04: «هل يغيّر هذا الاسم الكائن، أم يعطيني نسخة، أم يكمل الجملة؟»

ترجمة أولية، في انتظار مراجعة متحدث أصلي.

اسم الدالة في سوفتانزا جملة تُقال لكائن. وقواعده تخبرك بما سيحدث قبل أن تشغّله. يعلّمك هذا الفصل الصيغ الثلاث التي ستلقاها في كل صفحة: الفاعلة، والمفعولة، والمتصلة.

1. الصيغة الفاعلة تغيّر الكائن

RemoveAll أمر. يطيعه الكائن ويتغيّر.

تعمل على الحاسوب مع سوفتانزا↗ 1/7
o1 = new stzString("HAxxRxO")
o1.RemoveAll("x")
? o1.Content()
#--> HARO
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

2. الصيغة المفعولة تعطيك نسخة

Removed اسم مفعول: النص، وقد أزيلت منه x. تجيب بقيمة جديدة وتترك الكائن كما كان.

تعمل على الحاسوب مع سوفتانزا↗ 2/7
o1 = new stzString("HAxxRxO")
? o1.Removed("x")
#--> HARO
? o1.Content()
#--> HAxxRxO
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

3. الصيغة المتصلة تكمل الجملة

حرف Q في آخر الاسم يعني ثم. تستمر الجملة حتى تغلقها صيغة مفعولة.

تعمل على الحاسوب مع سوفتانزا↗ 3/7
? Q("haxxrxo").RemoveQ("x").UppercaseQ().Spacified()
#--> H A R O
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

4. الجملة المتصلة على كائن تغيّره

تعمل على الحاسوب مع سوفتانزا↗ 4/7
o1 = new stzString("haxxrxo")
? o1.RemoveQ("x").Uppercased()
#--> HARO
? o1.Content()
#--> haro
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

5. قل «على نسخة» بـ QC

QC تعني ثم، على نسخة. الأصل لا يُمسّ.

تعمل على الحاسوب مع سوفتانزا↗ 5/7
o1 = new stzString("haxxrxo")
? o1.RemoveQC("x").Uppercased()
#--> HARO
? o1.Content()
#--> haxxrxo
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

6. المعامل المسمّى يُقرأ كنثر

تعمل على الحاسوب مع سوفتانزا↗ 6/7
? Q("tea, rice, tea").Replaced("tea", :With = "coffee")
#--> coffee, rice, coffee
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

7. السؤال اسم يبدأ بـ Is

تعمل على الحاسوب مع سوفتانزا↗ 7/7
? Q("bread").IsLowercase()
#--> TRUE
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

الخلاصة

Fassara ta farko: wani ɗan asalin harshen Hausa bai riga ya duba ta ba tukuna.

Karanta sunan kamar jimla

S0 · 1 – 4 · project-s0 · Labari mai ɗakuna biyar a kan jerin naka, inda kowane ɗaki yake gudana. S0 – S4

course_narrated · 7/7 · ↗

Gabatarwa ta Farko · Babi na 3 · Fasaha EX-04: "Shin wannan sunan yana canza abin, yana ba ni kwafi, ko yana ci gaba da jimlar?"

Fassarar farko ce, tana jiran bita daga mai magana da Hausa a matsayin harshen uwa.

Sunan hanya na Softanza jimla ce da aka yi wa abu. Nahawunsa yana faɗa maka abin da zai faru kafin ka gudanar da shi. Wannan babin yana koyar da sigogi uku da za ka haɗu da su a kowane shafi: siga ta aiki, siga ta abin da aka yi, da siga mai gudana.

1. Sigar aiki tana canza abin

RemoveAll umarni ne. Abin yana bi, kuma an canza shi.

Tana gudana a kwamfuta tare da Softanza↗ 1/7
o1 = new stzString("HAxxRxO")
o1.RemoveAll("x")
? o1.Content()
#--> HARO
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

2. Sigar abin da aka yi tana ba ka kwafi

Removed siga ce ta abin da ya wuce: rubutun, an cire x. Tana amsawa da sabuwar daraja ta bar abin kamar yadda yake.

Tana gudana a kwamfuta tare da Softanza↗ 2/7
o1 = new stzString("HAxxRxO")
? o1.Removed("x")
#--> HARO
? o1.Content()
#--> HAxxRxO
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

3. Siga mai gudana tana ci gaba da jimlar

Q a ƙarshen suna yana nufin sannan. Jimlar tana ci gaba har sai sigar abin da aka yi ta rufe ta.

Tana gudana a kwamfuta tare da Softanza↗ 3/7
? Q("haxxrxo").RemoveQ("x").UppercaseQ().Spacified()
#--> H A R O
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

4. Jimla mai gudana a kan abu tana canza shi

Tana gudana a kwamfuta tare da Softanza↗ 4/7
o1 = new stzString("haxxrxo")
? o1.RemoveQ("x").Uppercased()
#--> HARO
? o1.Content()
#--> haro
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

5. Faɗi "a kan kwafi" da QC

QC yana nufin sannan, a kan kwafi. Ba a taɓa na asali ba.

Tana gudana a kwamfuta tare da Softanza↗ 5/7
o1 = new stzString("haxxrxo")
? o1.RemoveQC("x").Uppercased()
#--> HARO
? o1.Content()
#--> haxxrxo
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

6. Sigar da aka sa wa suna tana karantuwa kamar magana

Tana gudana a kwamfuta tare da Softanza↗ 6/7
? Q("tea, rice, tea").Replaced("tea", :With = "coffee")
#--> coffee, rice, coffee
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

7. Tambaya suna ne da yake farawa da Is

Tana gudana a kwamfuta tare da Softanza↗ 7/7
? Q("bread").IsLowercase()
#--> TRUE
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

Taƙaitawa

Say it in your language

S0 · Explorer · this chapter belongs to this rung, earned when chapters 1 to 4 and project-s0 have passed: A five-cell narration over a list of your own, where every cell runs. The ladder

Proof · 6 cells ran, 10 promises kept, in each of the four editions · the proof of this chapter

Elementary Introduction · Chapter 4 · Skill EX-05: "Can I say this program in my own language and have it run?"

Softanza understands a program written as a sentence, in more than one human language. This is not a translation of the page: the sentence itself is the program, and it runs. Every cell below runs in every edition of this chapter, whatever language you are reading it in.

1. The languages Softanza speaks today

Runs on the desktop with SoftanzaProof of this cell
? @@( StzNaturalLanguages() )
#--> [ "en", "ha", "fr", "ar", "tr" ]
This page stores no output. Run the cell to see what it prints.

2. English

Understood() says back what Softanza took the sentence to mean, so you can check it before you trust the result.

Runs on the desktop with SoftanzaProof of this cell
oN = Naturally("Create a list with [ 4, 4, 9 ] and remove its duplicates")
? @@( oN.Result() )
#--> [ 4, 9 ]
? oN.Understood()
#--> create a list with [ 4, 4, 9 ] -> remove duplicates
This page stores no output. Run the cell to see what it prints.

3. French

Runs on the desktop with SoftanzaProof of this cell
oF = NaturallyIn("fr", "Crée une liste avec [ 4, 4, 9 ] et enlève les doublons")
? @@( oF.Result() )
#--> [ 4, 9 ]
? oF.Understood()
#--> crée liste avec [ 4, 4, 9 ] -> enlève les doublons
This page stores no output. Run the cell to see what it prints.

4. Arabic

Runs on the desktop with SoftanzaProof of this cell
oA = NaturallyIn("ar", "أنشئ قائمة مع [ 4, 4, 9 ] أزل التكرارات")
? @@( oA.Result() )
#--> [ 4, 9 ]
? oA.Understood()
#--> أنشئ قائمة بـ [ 4, 4, 9 ] -> أزل التكرارات
This page stores no output. Run the cell to see what it prints.

5. Hausa

Runs on the desktop with SoftanzaProof of this cell
oH = NaturallyIn("ha", "Yi jeri dauke [ 4, 4, 9 ] cire maimaitattu")
? @@( oH.Result() )
#--> [ 4, 9 ]
? oH.Understood()
#--> yi jeri dauke [ 4, 4, 9 ] -> cire maimaitattu
This page stores no output. Run the cell to see what it prints.

6. When it does not understand, it says which word

Softanza never guesses. A sentence it cannot resolve is reported word by word, with the nearest word it does know.

Runs on the desktop with SoftanzaProof of this cell
? @@( StzNaturalLintIn("fr", "Crée une liste avec [ 4, 4, 9 ] et danse la salsa") )
#--> [ [ "understood", 0 ], [ "unresolved", [ [ "danse", "" ], [ "salsa", "sans" ] ] ] ]
This page stores no output. Run the cell to see what it prints.

Recap

Traduction provisoire : pas encore relue par un locuteur natif.

Le dire dans votre langue

S0 · Explorateur · ce chapitre appartient à ce barreau, gagné quand les chapitres 1 à 4 et project-s0 sont réussis : Une narration de cinq cellules sur une liste à vous, où chaque cellule s'exécute. L'échelle

Preuve · 6 cellules exécutées, 10 promesses tenues, dans chacune des quatre éditions · la preuve de ce chapitre

Introduction élémentaire · Chapitre 4 · Compétence EX-05 : « Puis-je dire ce programme dans ma langue et le faire tourner ? »

Traduction provisoire, en attente de relecture par un locuteur natif.

Softanza comprend un programme écrit comme une phrase, dans plusieurs langues humaines. Ce n'est pas une traduction de la page : la phrase elle-même est le programme, et elle s'exécute. Chaque cellule ci-dessous s'exécute dans chaque édition de ce chapitre, quelle que soit la langue dans laquelle vous le lisez.

1. Les langues que Softanza parle aujourd'hui

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? @@( StzNaturalLanguages() )
#--> [ "en", "ha", "fr", "ar", "tr" ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

2. Anglais

Understood() redit ce que Softanza a compris de la phrase, pour que vous puissiez le vérifier avant de faire confiance au résultat.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oN = Naturally("Create a list with [ 4, 4, 9 ] and remove its duplicates")
? @@( oN.Result() )
#--> [ 4, 9 ]
? oN.Understood()
#--> create a list with [ 4, 4, 9 ] -> remove duplicates
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

3. Français

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oF = NaturallyIn("fr", "Crée une liste avec [ 4, 4, 9 ] et enlève les doublons")
? @@( oF.Result() )
#--> [ 4, 9 ]
? oF.Understood()
#--> crée liste avec [ 4, 4, 9 ] -> enlève les doublons
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

4. Arabe

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oA = NaturallyIn("ar", "أنشئ قائمة مع [ 4, 4, 9 ] أزل التكرارات")
? @@( oA.Result() )
#--> [ 4, 9 ]
? oA.Understood()
#--> أنشئ قائمة بـ [ 4, 4, 9 ] -> أزل التكرارات
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

5. Haoussa

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oH = NaturallyIn("ha", "Yi jeri dauke [ 4, 4, 9 ] cire maimaitattu")
? @@( oH.Result() )
#--> [ 4, 9 ]
? oH.Understood()
#--> yi jeri dauke [ 4, 4, 9 ] -> cire maimaitattu
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

6. Quand il ne comprend pas, il dit quel mot

Softanza ne devine jamais. Une phrase qu'il ne peut pas résoudre est signalée mot par mot, avec le mot le plus proche qu'il connaît.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? @@( StzNaturalLintIn("fr", "Crée une liste avec [ 4, 4, 9 ] et danse la salsa") )
#--> [ [ "understood", 0 ], [ "unresolved", [ [ "danse", "" ], [ "salsa", "sans" ] ] ] ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

Récapitulatif

ترجمة أولية: لم يراجعها بعدُ ناطق أصلي بالعربية.

قلها بلغتك

S0 · 1 – 4 · project-s0 · سرد من خمس خلايا على قائمة من عندك، تعمل فيه كل خلية. S0 – S4

course_narrated · 6/6 · ↗

مدخل أساسي · الفصل 4 · المهارة EX-05: «هل أستطيع أن أقول هذا البرنامج بلغتي فيعمل؟»

ترجمة أولية، في انتظار مراجعة متحدث أصلي.

تفهم سوفتانزا برنامجًا مكتوبًا في صورة جملة، بأكثر من لغة بشرية. ليست هذه ترجمة للصفحة: الجملة نفسها هي البرنامج، وهي تعمل. كل خلية أدناه تعمل في كل طبعة من هذا الفصل، أيًّا كانت اللغة التي تقرؤه بها.

1. اللغات التي تتكلمها سوفتانزا اليوم

تعمل على الحاسوب مع سوفتانزا↗ 1/6
? @@( StzNaturalLanguages() )
#--> [ "en", "ha", "fr", "ar", "tr" ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

2. الإنجليزية

Understood() تعيد قول ما فهمته سوفتانزا من الجملة، لتتحقق منه قبل أن تثق بالنتيجة.

تعمل على الحاسوب مع سوفتانزا↗ 2/6
oN = Naturally("Create a list with [ 4, 4, 9 ] and remove its duplicates")
? @@( oN.Result() )
#--> [ 4, 9 ]
? oN.Understood()
#--> create a list with [ 4, 4, 9 ] -> remove duplicates
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

3. الفرنسية

تعمل على الحاسوب مع سوفتانزا↗ 3/6
oF = NaturallyIn("fr", "Crée une liste avec [ 4, 4, 9 ] et enlève les doublons")
? @@( oF.Result() )
#--> [ 4, 9 ]
? oF.Understood()
#--> crée liste avec [ 4, 4, 9 ] -> enlève les doublons
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

4. العربية

تعمل على الحاسوب مع سوفتانزا↗ 4/6
oA = NaturallyIn("ar", "أنشئ قائمة مع [ 4, 4, 9 ] أزل التكرارات")
? @@( oA.Result() )
#--> [ 4, 9 ]
? oA.Understood()
#--> أنشئ قائمة بـ [ 4, 4, 9 ] -> أزل التكرارات
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

5. الهوسا

تعمل على الحاسوب مع سوفتانزا↗ 5/6
oH = NaturallyIn("ha", "Yi jeri dauke [ 4, 4, 9 ] cire maimaitattu")
? @@( oH.Result() )
#--> [ 4, 9 ]
? oH.Understood()
#--> yi jeri dauke [ 4, 4, 9 ] -> cire maimaitattu
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

6. حين لا تفهم، تقول أيّ كلمة

سوفتانزا لا تخمّن أبدًا. الجملة التي لا تستطيع حلّها تُبلَّغ كلمةً كلمة، مع أقرب كلمة تعرفها.

تعمل على الحاسوب مع سوفتانزا↗ 6/6
? @@( StzNaturalLintIn("fr", "Crée une liste avec [ 4, 4, 9 ] et danse la salsa") )
#--> [ [ "understood", 0 ], [ "unresolved", [ [ "danse", "" ], [ "salsa", "sans" ] ] ] ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

الخلاصة

Fassara ta farko: wani ɗan asalin harshen Hausa bai riga ya duba ta ba tukuna.

Faɗe shi da harshenka

S0 · 1 – 4 · project-s0 · Labari mai ɗakuna biyar a kan jerin naka, inda kowane ɗaki yake gudana. S0 – S4

course_narrated · 6/6 · ↗

Gabatarwa ta Farko · Babi na 4 · Fasaha EX-05: "Zan iya faɗin wannan shirin da harshena ya gudana?"

Fassarar farko ce, tana jiran bita daga mai magana da Hausa a matsayin harshen uwa.

Softanza tana fahimtar shirin da aka rubuta a matsayin jimla, da harsunan ɗan adam fiye da ɗaya. Wannan ba fassarar shafin ba ce: jimlar da kanta ita ce shirin, kuma tana gudana. Kowane ɗaki a ƙasa yana gudana a kowane bugu na wannan babin, ko da wane harshe kake karanta shi.

1. Harsunan da Softanza take magana yau

Tana gudana a kwamfuta tare da Softanza↗ 1/6
? @@( StzNaturalLanguages() )
#--> [ "en", "ha", "fr", "ar", "tr" ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

2. Turanci

Understood() yana sake faɗin abin da Softanza ta ɗauki jimlar tana nufi, domin ka duba shi kafin ka amince da sakamakon.

Tana gudana a kwamfuta tare da Softanza↗ 2/6
oN = Naturally("Create a list with [ 4, 4, 9 ] and remove its duplicates")
? @@( oN.Result() )
#--> [ 4, 9 ]
? oN.Understood()
#--> create a list with [ 4, 4, 9 ] -> remove duplicates
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

3. Faransanci

Tana gudana a kwamfuta tare da Softanza↗ 3/6
oF = NaturallyIn("fr", "Crée une liste avec [ 4, 4, 9 ] et enlève les doublons")
? @@( oF.Result() )
#--> [ 4, 9 ]
? oF.Understood()
#--> crée liste avec [ 4, 4, 9 ] -> enlève les doublons
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

4. Larabci

Tana gudana a kwamfuta tare da Softanza↗ 4/6
oA = NaturallyIn("ar", "أنشئ قائمة مع [ 4, 4, 9 ] أزل التكرارات")
? @@( oA.Result() )
#--> [ 4, 9 ]
? oA.Understood()
#--> أنشئ قائمة بـ [ 4, 4, 9 ] -> أزل التكرارات
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

5. Hausa

Tana gudana a kwamfuta tare da Softanza↗ 5/6
oH = NaturallyIn("ha", "Yi jeri dauke [ 4, 4, 9 ] cire maimaitattu")
? @@( oH.Result() )
#--> [ 4, 9 ]
? oH.Understood()
#--> yi jeri dauke [ 4, 4, 9 ] -> cire maimaitattu
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

6. Idan ba ta fahimta ba, tana faɗin wace kalma

Softanza ba ta taɓa zato ba. Jimlar da ba za ta iya warwarewa ba ana ruwaito ta kalma bayan kalma, tare da kalma mafi kusa da ta sani.

Tana gudana a kwamfuta tare da Softanza↗ 6/6
? @@( StzNaturalLintIn("fr", "Crée une liste avec [ 4, 4, 9 ] et danse la salsa") )
#--> [ [ "understood", 0 ], [ "unresolved", [ [ "danse", "" ], [ "salsa", "sans" ] ] ] ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

Taƙaitawa

One object, any structure

S1 · Builder · this chapter belongs to this rung, earned when chapters 1 to 7 and project-s1 have passed: A small tool over your workplace, its conditions declared as data. The ladder

Proof · 6 cells ran, 12 promises kept, in each of the four editions · the proof of this chapter

Elementary Introduction · Chapter 5 · Skill FO-03: "Is this the same question I asked of a list, now asked of a string?"

Chapter 1 asked three questions of a list: does it contain, how many, and where. This chapter asks the same three questions of a string, with the same words. The structure changes; the thinking does not.

1. The three questions, asked of a string

Runs on the desktop with SoftanzaProof of this cell
oS = new stzString("tea rice tea fish")
? oS.Contains("tea")
#--> TRUE
? oS.NumberOfOccurrence("tea")
#--> 2
? @@( oS.FindAll("tea") )
#--> [ 1, 10 ]
This page stores no output. Run the cell to see what it prints.

2. The same three questions, asked of a list

Runs on the desktop with SoftanzaProof of this cell
oL = new stzList([ "tea", "rice", "tea", "fish" ])
? oL.Contains("tea")
#--> TRUE
? oL.NumberOfOccurrence("tea")
#--> 2
? @@( oL.FindAll("tea") )
#--> [ 1, 3 ]
This page stores no output. Run the cell to see what it prints.

3. Same words, different units

A position in a string counts characters; a position in a list counts items. The question is the same, the ruler is not.

Runs on the desktop with SoftanzaProof of this cell
? StzLen("tea rice tea fish")
#--> 17
? oL.NumberOfItems()
#--> 4
This page stores no output. Run the cell to see what it prints.

4. One function for both

StzFind takes the thing you look for first, then wherever you look for it.

Runs on the desktop with SoftanzaProof of this cell
? @@( StzFind("tea", "tea rice tea fish") )
#--> [ 1, 10 ]
? @@( StzFind("tea", [ "tea", "rice", "tea", "fish" ]) )
#--> [ 1, 3 ]
This page stores no output. Run the cell to see what it prints.

5. Act the same way, and read the result carefully

Removing a word from a string leaves the spaces that surrounded it. Removing an item from a list leaves nothing behind. The same verb, an honest difference.

Runs on the desktop with SoftanzaProof of this cell
? @@( oS.Removed("tea") )
#--> " rice  fish"
oL.RemoveAll("tea")
? @@( oL.Content() )
#--> [ "rice", "fish" ]
This page stores no output. Run the cell to see what it prints.

6. Your workplace, both ways

The most requested thing at your workplace, counted in the list of requests and in the same requests joined into one sentence. Run it: the answer depends on the world.

Runs on the desktop with SoftanzaProof of this cell
aReq = EduWorldObjects("requested")
? StzListQ(aReq).NumberOfOccurrence(aReq[1])
? Q( Q(aReq).Joined(" ") ).NumberOfOccurrence(aReq[1])
This page stores no output. Run the cell to see what it prints.

Recap

Traduction provisoire : pas encore relue par un locuteur natif.

Un objet, toute structure

S1 · Bâtisseur · ce chapitre appartient à ce barreau, gagné quand les chapitres 1 à 7 et project-s1 sont réussis : Un petit outil sur votre lieu de travail, ses conditions déclarées comme des données. L'échelle

Preuve · 6 cellules exécutées, 12 promesses tenues, dans chacune des quatre éditions · la preuve de ce chapitre

Introduction élémentaire · Chapitre 5 · Compétence FO-03 : « Est-ce la même question que j'ai posée à une liste, posée maintenant à une chaîne ? »

Traduction provisoire, en attente de relecture par un locuteur natif.

Le chapitre 1 posait trois questions à une liste : contient-elle, combien, et où. Ce chapitre pose les trois mêmes questions à une chaîne, avec les mêmes mots. La structure change ; la pensée, non.

1. Les trois questions, posées à une chaîne

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oS = new stzString("tea rice tea fish")
? oS.Contains("tea")
#--> TRUE
? oS.NumberOfOccurrence("tea")
#--> 2
? @@( oS.FindAll("tea") )
#--> [ 1, 10 ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

2. Les trois mêmes questions, posées à une liste

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oL = new stzList([ "tea", "rice", "tea", "fish" ])
? oL.Contains("tea")
#--> TRUE
? oL.NumberOfOccurrence("tea")
#--> 2
? @@( oL.FindAll("tea") )
#--> [ 1, 3 ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

3. Mêmes mots, unités différentes

Une position dans une chaîne compte des caractères ; une position dans une liste compte des éléments. La question est la même, la règle graduée ne l'est pas.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? StzLen("tea rice tea fish")
#--> 17
? oL.NumberOfItems()
#--> 4
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

4. Une seule fonction pour les deux

StzFind prend d'abord ce que vous cherchez, puis l'endroit où vous le cherchez.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? @@( StzFind("tea", "tea rice tea fish") )
#--> [ 1, 10 ]
? @@( StzFind("tea", [ "tea", "rice", "tea", "fish" ]) )
#--> [ 1, 3 ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

5. Agir de la même façon, et lire le résultat avec soin

Retirer un mot d'une chaîne laisse les espaces qui l'entouraient. Retirer un élément d'une liste ne laisse rien. Le même verbe, une différence honnête.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? @@( oS.Removed("tea") )
#--> " rice  fish"
oL.RemoveAll("tea")
? @@( oL.Content() )
#--> [ "rice", "fish" ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

6. Votre lieu de travail, des deux façons

La chose la plus demandée sur votre lieu de travail, comptée dans la liste des demandes et dans ces mêmes demandes réunies en une phrase. Exécutez la cellule : la réponse dépend du monde.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
aReq = EduWorldObjects("requested")
? StzListQ(aReq).NumberOfOccurrence(aReq[1])
? Q( Q(aReq).Joined(" ") ).NumberOfOccurrence(aReq[1])
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

Récapitulatif

ترجمة أولية: لم يراجعها بعدُ ناطق أصلي بالعربية.

كائن واحد، أي بنية

S1 · 1 – 7 · project-s1 · أداة صغيرة على مكان عملك، شروطها مصرَّح بها كبيانات. S0 – S4

course_narrated · 5/6 · ↗

مدخل أساسي · الفصل 5 · المهارة FO-03: «هل هذا هو السؤال نفسه الذي طرحته على قائمة، وأطرحه الآن على نص؟»

ترجمة أولية، في انتظار مراجعة متحدث أصلي.

طرح الفصل الأول ثلاثة أسئلة على قائمة: هل تحتوي، وكم، وأين. يطرح هذا الفصل الأسئلة الثلاثة نفسها على نص، بالكلمات نفسها. تتغير البنية؛ ولا يتغير التفكير.

1. الأسئلة الثلاثة، مطروحة على نص

تعمل على الحاسوب مع سوفتانزا↗ 1/6
oS = new stzString("tea rice tea fish")
? oS.Contains("tea")
#--> TRUE
? oS.NumberOfOccurrence("tea")
#--> 2
? @@( oS.FindAll("tea") )
#--> [ 1, 10 ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

2. الأسئلة الثلاثة نفسها، مطروحة على قائمة

تعمل على الحاسوب مع سوفتانزا↗ 2/6
oL = new stzList([ "tea", "rice", "tea", "fish" ])
? oL.Contains("tea")
#--> TRUE
? oL.NumberOfOccurrence("tea")
#--> 2
? @@( oL.FindAll("tea") )
#--> [ 1, 3 ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

3. الكلمات نفسها، والوحدات مختلفة

الموضع في النص يعدّ الحروف؛ والموضع في القائمة يعدّ العناصر. السؤال واحد، والمسطرة ليست واحدة.

تعمل على الحاسوب مع سوفتانزا↗ 3/6
? StzLen("tea rice tea fish")
#--> 17
? oL.NumberOfItems()
#--> 4
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

4. دالة واحدة لكليهما

StzFind تأخذ أولًا ما تبحث عنه، ثم المكان الذي تبحث فيه.

تعمل على الحاسوب مع سوفتانزا↗ 4/6
? @@( StzFind("tea", "tea rice tea fish") )
#--> [ 1, 10 ]
? @@( StzFind("tea", [ "tea", "rice", "tea", "fish" ]) )
#--> [ 1, 3 ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

5. تصرّف بالطريقة نفسها، واقرأ النتيجة بعناية

إزالة كلمة من نص تترك المسافات التي كانت تحيط بها. وإزالة عنصر من قائمة لا تترك شيئًا. الفعل نفسه، وفرق صادق.

تعمل على الحاسوب مع سوفتانزا↗ 5/6
? @@( oS.Removed("tea") )
#--> " rice  fish"
oL.RemoveAll("tea")
? @@( oL.Content() )
#--> [ "rice", "fish" ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

6. مكان عملك، بالطريقتين

أكثر شيء مطلوب في مكان عملك، معدودًا في قائمة الطلبات وفي الطلبات نفسها مجموعةً في جملة واحدة. شغّل الخلية: الجواب يتوقف على العالم.

تعمل على الحاسوب مع سوفتانزا↗ 6/6
aReq = EduWorldObjects("requested")
? StzListQ(aReq).NumberOfOccurrence(aReq[1])
? Q( Q(aReq).Joined(" ") ).NumberOfOccurrence(aReq[1])
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

الخلاصة

Fassara ta farko: wani ɗan asalin harshen Hausa bai riga ya duba ta ba tukuna.

Abu ɗaya, kowane tsari

S1 · 1 – 7 · project-s1 · Ƙaramin kayan aiki a kan wurin aikinka, sharuɗɗansa an bayyana su a matsayin bayanai. S0 – S4

course_narrated · 5/6 · ↗

Gabatarwa ta Farko · Babi na 5 · Fasaha FO-03: "Shin wannan tambayar da na yi wa jeri ce, yanzu na yi wa rubutu?"

Fassarar farko ce, tana jiran bita daga mai magana da Hausa a matsayin harshen uwa.

Babi na 1 ya yi wa jeri tambayoyi uku: yana ɗauke, nawa, kuma ina. Wannan babin yana yi wa rubutu tambayoyi uku ɗin nan, da kalmomi iri ɗaya. Tsarin yana canzawa; tunanin ba ya canzawa.

1. Tambayoyi uku, an yi wa rubutu

Tana gudana a kwamfuta tare da Softanza↗ 1/6
oS = new stzString("tea rice tea fish")
? oS.Contains("tea")
#--> TRUE
? oS.NumberOfOccurrence("tea")
#--> 2
? @@( oS.FindAll("tea") )
#--> [ 1, 10 ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

2. Tambayoyi uku ɗin nan, an yi wa jeri

Tana gudana a kwamfuta tare da Softanza↗ 2/6
oL = new stzList([ "tea", "rice", "tea", "fish" ])
? oL.Contains("tea")
#--> TRUE
? oL.NumberOfOccurrence("tea")
#--> 2
? @@( oL.FindAll("tea") )
#--> [ 1, 3 ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

3. Kalmomi iri ɗaya, ma'auni daban

Wuri a cikin rubutu yana ƙidaya haruffa; wuri a cikin jeri yana ƙidaya abubuwa. Tambayar ɗaya ce, ma'aunin ba ɗaya ba ne.

Tana gudana a kwamfuta tare da Softanza↗ 3/6
? StzLen("tea rice tea fish")
#--> 17
? oL.NumberOfItems()
#--> 4
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

4. Aiki ɗaya ga duka biyun

StzFind yana ɗaukar abin da kake nema da farko, sannan duk inda kake nemansa.

Tana gudana a kwamfuta tare da Softanza↗ 4/6
? @@( StzFind("tea", "tea rice tea fish") )
#--> [ 1, 10 ]
? @@( StzFind("tea", [ "tea", "rice", "tea", "fish" ]) )
#--> [ 1, 3 ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

5. Aiwatar ta hanya ɗaya, ka karanta sakamakon da kyau

Cire kalma daga rubutu yana barin sararin da ya kewaye ta. Cire abu daga jeri ba ya barin komai a baya. Aikatau ɗaya, bambanci na gaskiya.

Tana gudana a kwamfuta tare da Softanza↗ 5/6
? @@( oS.Removed("tea") )
#--> " rice  fish"
oL.RemoveAll("tea")
? @@( oL.Content() )
#--> [ "rice", "fish" ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

6. Wurin aikinka, ta hanyoyi biyu

Abin da aka fi buƙata a wurin aikinka, an ƙidaya shi a cikin jerin buƙatu da kuma a cikin buƙatun da aka haɗa cikin jimla ɗaya. Ka gudanar da shi: amsar ta dogara da duniyar.

Tana gudana a kwamfuta tare da Softanza↗ 6/6
aReq = EduWorldObjects("requested")
? StzListQ(aReq).NumberOfOccurrence(aReq[1])
? Q( Q(aReq).Joined(" ") ).NumberOfOccurrence(aReq[1])
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

Taƙaitawa

Walk, ask, produce, act

S1 · Builder · this chapter belongs to this rung, earned when chapters 1 to 7 and project-s1 have passed: A small tool over your workplace, its conditions declared as data. The ladder

Proof · 6 cells ran, 10 promises kept, in each of the four editions · the proof of this chapter

Elementary Introduction · Chapter 6 · Skill FO-02: "Which of the four moves is this step?"

Every program is made of four moves. It walks through positions, it asks questions, it produces new values, and it acts on the data. Softanza names each move, so a task decomposes into them instead of into loops.

1. Walk: the positions, then what is there

The kitchen checks every third order. First the positions, then the orders at those positions.

Runs on the desktop with SoftanzaProof of this cell
aOrders = [ "tea", "rice", "tea", "fish", "rice", "tea", "soup", "tea", "rice" ]
? @@( StzListQ([ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]).FindW("@item % 3 = 1") )
#--> [ 1, 4, 7 ]
? @@( StzListQ(aOrders).ItemsAtPositions([ 1, 4, 7 ]) )
#--> [ "tea", "fish", "soup" ]
This page stores no output. Run the cell to see what it prints.

2. Ask: a question answers TRUE or FALSE

Runs on the desktop with SoftanzaProof of this cell
? StzListQ(aOrders).Contains("soup")
#--> TRUE
? Q("cold").IsLowercase()
#--> TRUE
This page stores no output. Run the cell to see what it prints.

3. Produce: a yielder makes new values from old ones

The day's takings, with a refund written as a negative number. A yielder filters, maps and reduces without one loop being written.

Runs on the desktop with SoftanzaProof of this cell
oY = new stzYielder([ 12, 0, 30, -5, 18 ])
? @@( oY.Filter(:IsPositive) )
#--> [ 12, 30, 18 ]
? @@( oY.Map(:Double) )
#--> [ 24, 0, 60, -10, 36 ]
? oY.Reduce(:Sum)
#--> 55
This page stores no output. Run the cell to see what it prints.

4. The moves chain

Filter, then reduce: the total of the real sales.

Runs on the desktop with SoftanzaProof of this cell
? oY.FilterQ(:IsPositive).Reduce(:Sum)
#--> 60
This page stores no output. Run the cell to see what it prints.

5. Act: a verb changes the data

Runs on the desktop with SoftanzaProof of this cell
oL = new stzList(aOrders)
oL.RemoveAll("tea")
? @@( oL.Content() )
#--> [ "rice", "fish", "rice", "soup", "rice" ]
This page stores no output. Run the cell to see what it prints.

6. A condition can be handed over as data

ItemsW takes the question itself as its argument. The next chapter is about this.

Runs on the desktop with SoftanzaProof of this cell
? @@( StzListQ([ 12, 0, 30, -5, 18 ]).ItemsW("@item > 0") )
#--> [ 12, 30, 18 ]
This page stores no output. Run the cell to see what it prints.

Softanza also has a dedicated walker object, stzWalker, with steps, directions and a history. It lives in the library's max tier, which this course does not load, so it is not shown here.

Recap

Traduction provisoire : pas encore relue par un locuteur natif.

Marcher, demander, produire, agir

S1 · Bâtisseur · ce chapitre appartient à ce barreau, gagné quand les chapitres 1 à 7 et project-s1 sont réussis : Un petit outil sur votre lieu de travail, ses conditions déclarées comme des données. L'échelle

Preuve · 6 cellules exécutées, 10 promesses tenues, dans chacune des quatre éditions · la preuve de ce chapitre

Introduction élémentaire · Chapitre 6 · Compétence FO-02 : « Laquelle des quatre actions est cette étape ? »

Traduction provisoire, en attente de relecture par un locuteur natif.

Tout programme est fait de quatre gestes. Il marche à travers des positions, il demande en posant des questions, il produit de nouvelles valeurs, et il agit sur les données. Softanza nomme chaque geste, si bien qu'une tâche se décompose en gestes et non en boucles.

1. Marcher : les positions, puis ce qui s'y trouve

La cuisine vérifie une commande sur trois. D'abord les positions, puis les commandes à ces positions.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
aOrders = [ "tea", "rice", "tea", "fish", "rice", "tea", "soup", "tea", "rice" ]
? @@( StzListQ([ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]).FindW("@item % 3 = 1") )
#--> [ 1, 4, 7 ]
? @@( StzListQ(aOrders).ItemsAtPositions([ 1, 4, 7 ]) )
#--> [ "tea", "fish", "soup" ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

2. Demander : une question répond TRUE ou FALSE

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? StzListQ(aOrders).Contains("soup")
#--> TRUE
? Q("cold").IsLowercase()
#--> TRUE
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

3. Produire : un producteur fabrique de nouvelles valeurs à partir des anciennes

La recette du jour, un remboursement écrit en nombre négatif. Un producteur filtre, transforme et réduit sans qu'une seule boucle soit écrite.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oY = new stzYielder([ 12, 0, 30, -5, 18 ])
? @@( oY.Filter(:IsPositive) )
#--> [ 12, 30, 18 ]
? @@( oY.Map(:Double) )
#--> [ 24, 0, 60, -10, 36 ]
? oY.Reduce(:Sum)
#--> 55
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

4. Les gestes s'enchaînent

Filtrer, puis réduire : le total des vraies ventes.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? oY.FilterQ(:IsPositive).Reduce(:Sum)
#--> 60
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

5. Agir : un verbe change les données

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oL = new stzList(aOrders)
oL.RemoveAll("tea")
? @@( oL.Content() )
#--> [ "rice", "fish", "rice", "soup", "rice" ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

6. Une condition peut être transmise comme une donnée

ItemsW prend la question elle-même comme argument. Le chapitre suivant porte là-dessus.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? @@( StzListQ([ 12, 0, 30, -5, 18 ]).ItemsW("@item > 0") )
#--> [ 12, 30, 18 ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

Softanza possède aussi un objet marcheur dédié, stzWalker, avec des pas, des directions et un historique. Il vit dans le niveau max de la bibliothèque, que ce cours ne charge pas ; il n'est donc pas montré ici.

Récapitulatif

ترجمة أولية: لم يراجعها بعدُ ناطق أصلي بالعربية.

سِر، اسأل، أنتِج، افعل

S1 · 1 – 7 · project-s1 · أداة صغيرة على مكان عملك، شروطها مصرَّح بها كبيانات. S0 – S4

course_narrated · 6/6 · ↗

مدخل أساسي · الفصل 6 · المهارة FO-02: «أيّ الحركات الأربع هذه الخطوة؟»

ترجمة أولية، في انتظار مراجعة متحدث أصلي.

كل برنامج مكوّن من أربع حركات. فهو يسير عبر المواضع، ويسأل أسئلة، وينتج قيمًا جديدة، ويفعل في البيانات. تسمّي سوفتانزا كل حركة، فتتفكك المهمة إلى حركات لا إلى حلقات.

1. السير: المواضع، ثم ما فيها

يفحص المطبخ كل طلبية ثالثة. أولًا المواضع، ثم الطلبيات في تلك المواضع.

تعمل على الحاسوب مع سوفتانزا↗ 1/6
aOrders = [ "tea", "rice", "tea", "fish", "rice", "tea", "soup", "tea", "rice" ]
? @@( StzListQ([ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]).FindW("@item % 3 = 1") )
#--> [ 1, 4, 7 ]
? @@( StzListQ(aOrders).ItemsAtPositions([ 1, 4, 7 ]) )
#--> [ "tea", "fish", "soup" ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

2. السؤال: يجيب السؤال بـ TRUE أو FALSE

تعمل على الحاسوب مع سوفتانزا↗ 2/6
? StzListQ(aOrders).Contains("soup")
#--> TRUE
? Q("cold").IsLowercase()
#--> TRUE
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

3. الإنتاج: المنتِج يصنع قيمًا جديدة من القديمة

إيراد اليوم، وقد كُتب الاسترداد رقمًا سالبًا. المنتِج يرشّح ويحوّل ويختزل دون كتابة حلقة واحدة.

تعمل على الحاسوب مع سوفتانزا↗ 3/6
oY = new stzYielder([ 12, 0, 30, -5, 18 ])
? @@( oY.Filter(:IsPositive) )
#--> [ 12, 30, 18 ]
? @@( oY.Map(:Double) )
#--> [ 24, 0, 60, -10, 36 ]
? oY.Reduce(:Sum)
#--> 55
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

4. الحركات تتسلسل

رشّح، ثم اختزل: مجموع المبيعات الحقيقية.

تعمل على الحاسوب مع سوفتانزا↗ 4/6
? oY.FilterQ(:IsPositive).Reduce(:Sum)
#--> 60
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

5. الفعل: الفعل يغيّر البيانات

تعمل على الحاسوب مع سوفتانزا↗ 5/6
oL = new stzList(aOrders)
oL.RemoveAll("tea")
? @@( oL.Content() )
#--> [ "rice", "fish", "rice", "soup", "rice" ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

6. يمكن تسليم الشرط كبيانات

ItemsW تأخذ السؤال نفسه معاملًا لها. الفصل التالي عن هذا.

تعمل على الحاسوب مع سوفتانزا↗ 6/6
? @@( StzListQ([ 12, 0, 30, -5, 18 ]).ItemsW("@item > 0") )
#--> [ 12, 30, 18 ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

لسوفتانزا أيضًا كائن سائر مخصص، stzWalker، له خطوات واتجاهات وتاريخ. يسكن في طبقة max من المكتبة، التي لا يحمّلها هذا الدرس، فلا يُعرض هنا.

الخلاصة

Fassara ta farko: wani ɗan asalin harshen Hausa bai riga ya duba ta ba tukuna.

Tafiya, tambaya, samarwa, aiki

S1 · 1 – 7 · project-s1 · Ƙaramin kayan aiki a kan wurin aikinka, sharuɗɗansa an bayyana su a matsayin bayanai. S0 – S4

course_narrated · 6/6 · ↗

Gabatarwa ta Farko · Babi na 6 · Fasaha FO-02: "Wanne daga cikin motsi huɗu ne wannan matakin?"

Fassarar farko ce, tana jiran bita daga mai magana da Hausa a matsayin harshen uwa.

Kowane shiri motsi huɗu ne ya ƙunsa. Yana tafiya ta cikin wurare, yana tambaya tambayoyi, yana samar da sababbin daraja, kuma yana aiki a kan bayanai. Softanza tana sa wa kowane motsi suna, don haka aiki yana rarrabuwa zuwa motsi, ba madauki ba.

1. Tafiya: wurare, sannan abin da ke can

Kicin yana duba kowace oda ta uku. Da farko wuraren, sannan ododin da ke waɗannan wuraren.

Tana gudana a kwamfuta tare da Softanza↗ 1/6
aOrders = [ "tea", "rice", "tea", "fish", "rice", "tea", "soup", "tea", "rice" ]
? @@( StzListQ([ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]).FindW("@item % 3 = 1") )
#--> [ 1, 4, 7 ]
? @@( StzListQ(aOrders).ItemsAtPositions([ 1, 4, 7 ]) )
#--> [ "tea", "fish", "soup" ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

2. Tambaya: tambaya tana amsa TRUE ko FALSE

Tana gudana a kwamfuta tare da Softanza↗ 2/6
? StzListQ(aOrders).Contains("soup")
#--> TRUE
? Q("cold").IsLowercase()
#--> TRUE
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

3. Samarwa: mai samarwa yana yin sababbin daraja daga tsofaffi

Kuɗin shigar rana, an rubuta mayar da kuɗi a matsayin lamba mara kyau. Mai samarwa yana tacewa, yana canzawa, yana rage ba tare da an rubuta madauki ɗaya ba.

Tana gudana a kwamfuta tare da Softanza↗ 3/6
oY = new stzYielder([ 12, 0, 30, -5, 18 ])
? @@( oY.Filter(:IsPositive) )
#--> [ 12, 30, 18 ]
? @@( oY.Map(:Double) )
#--> [ 24, 0, 60, -10, 36 ]
? oY.Reduce(:Sum)
#--> 55
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

4. Motsin suna haɗuwa

Tace, sannan ka rage: jimillar tallace-tallace na gaske.

Tana gudana a kwamfuta tare da Softanza↗ 4/6
? oY.FilterQ(:IsPositive).Reduce(:Sum)
#--> 60
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

5. Aiki: aikatau yana canza bayanai

Tana gudana a kwamfuta tare da Softanza↗ 5/6
oL = new stzList(aOrders)
oL.RemoveAll("tea")
? @@( oL.Content() )
#--> [ "rice", "fish", "rice", "soup", "rice" ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

6. Ana iya miƙa sharaɗi a matsayin bayanai

ItemsW yana ɗaukar tambayar da kanta a matsayin hujjarsa. Babi na gaba game da wannan ne.

Tana gudana a kwamfuta tare da Softanza↗ 6/6
? @@( StzListQ([ 12, 0, 30, -5, 18 ]).ItemsW("@item > 0") )
#--> [ 12, 30, 18 ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

Softanza kuma tana da abu mai tafiya na musamman, stzWalker, mai matakai, hanyoyi da tarihi. Yana zaune a matakin max na ɗakin karatu, wanda wannan darasin ba ya ɗauka, saboda haka ba a nuna shi a nan ba.

Taƙaitawa

Declare what, not how

S1 · Builder · this chapter belongs to this rung, earned when chapters 1 to 7 and project-s1 have passed: A small tool over your workplace, its conditions declared as data. The ladder

Proof · 5 cells ran, 11 promises kept, in each of the four editions · the proof of this chapter

Elementary Introduction · Chapter 7 · Skills FO-04 "Can I say what I want and let the engine decide how?" and PA-03 "Can I hand the condition over instead of writing the branch?"

Until now you named a fixed thing: "tea", the duplicates, position 4. This chapter names a condition, and hands it over as data. You say what qualifies; the engine decides how to walk the list, test each item and collect the answer. The W at the end of a name means where.

1. Find where a condition holds

@item stands for each item in turn. The condition is a piece of text between braces.

Runs on the desktop with SoftanzaProof of this cell
o = new stzList([ 4, 7, 10, 3, 8 ])
? @@( o.FindW("{ @item > 5 }") )
#--> [ 2, 3, 5 ]
? @@( o.ItemsW("{ @item > 5 }") )
#--> [ 7, 10, 8 ]
? o.CountW("{ @item > 5 }")
#--> 3
This page stores no output. Run the cell to see what it prints.

2. Any question can be the condition

Runs on the desktop with SoftanzaProof of this cell
? @@( o.FindW("{ IsEven(@item) }") )
#--> [ 1, 3, 5 ]
? o.CheckW("{ isNumber(@item) }")
#--> TRUE
This page stores no output. Run the cell to see what it prints.

3. A rule is data: keep it, and apply it anywhere

The rule lives in a variable. Two lists, one rule, and the rule never knew which list it would meet.

Runs on the desktop with SoftanzaProof of this cell
cRule = "{ @item > 20 }"
oA = new stzList([ 12, 0, 30, -5, 18, 25 ])
oB = new stzList([ 3, 40, 9 ])
? oA.CountW(cRule)
#--> 2
? oB.CountW(cRule)
#--> 1
This page stores no output. Run the cell to see what it prints.

4. Act where the rule holds

Runs on the desktop with SoftanzaProof of this cell
? @@( oA.ItemsW(cRule) )
#--> [ 30, 25 ]
oA.RemoveW(cRule)
? @@( oA.Content() )
#--> [ 12, 0, -5, 18 ]
This page stores no output. Run the cell to see what it prints.

5. The same word on words

Runs on the desktop with SoftanzaProof of this cell
oS = new stzList([ "haro", "PHP", "C#", "ruby", "GO" ])
? @@( oS.FindW("{ IsUppercase(@item) }") )
#--> [ 2, 3, 5 ]
? @@( oS.ItemsW("{ Q(@item).IsLowercase() }") )
#--> [ "haro", "ruby" ]
This page stores no output. Run the cell to see what it prints.

Recap

Traduction provisoire : pas encore relue par un locuteur natif.

Déclarer le quoi, pas le comment

S1 · Bâtisseur · ce chapitre appartient à ce barreau, gagné quand les chapitres 1 à 7 et project-s1 sont réussis : Un petit outil sur votre lieu de travail, ses conditions déclarées comme des données. L'échelle

Preuve · 5 cellules exécutées, 11 promesses tenues, dans chacune des quatre éditions · la preuve de ce chapitre

Introduction élémentaire · Chapitre 7 · Compétences FO-04 « Puis-je dire ce que je veux et laisser le moteur décider comment ? » et PA-03 « Puis-je transmettre la condition au lieu d'écrire le branchement ? »

Traduction provisoire, en attente de relecture par un locuteur natif.

Jusqu'ici vous nommiez une chose fixe : « tea », les doublons, la position 4. Ce chapitre nomme une condition, et la transmet comme une donnée. Vous dites ce qui compte ; le moteur décide comment parcourir la liste, tester chaque élément et rassembler la réponse. Le W à la fin d'un nom signifie where, « où ».

1. Trouver où une condition est vraie

@item désigne chaque élément à son tour. La condition est un morceau de texte entre accolades.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
o = new stzList([ 4, 7, 10, 3, 8 ])
? @@( o.FindW("{ @item > 5 }") )
#--> [ 2, 3, 5 ]
? @@( o.ItemsW("{ @item > 5 }") )
#--> [ 7, 10, 8 ]
? o.CountW("{ @item > 5 }")
#--> 3
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

2. N'importe quelle question peut être la condition

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? @@( o.FindW("{ IsEven(@item) }") )
#--> [ 1, 3, 5 ]
? o.CheckW("{ isNumber(@item) }")
#--> TRUE
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

3. Une règle est une donnée : gardez-la, appliquez-la partout

La règle vit dans une variable. Deux listes, une règle, et la règle n'a jamais su quelle liste elle rencontrerait.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
cRule = "{ @item > 20 }"
oA = new stzList([ 12, 0, 30, -5, 18, 25 ])
oB = new stzList([ 3, 40, 9 ])
? oA.CountW(cRule)
#--> 2
? oB.CountW(cRule)
#--> 1
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

4. Agir là où la règle est vraie

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? @@( oA.ItemsW(cRule) )
#--> [ 30, 25 ]
oA.RemoveW(cRule)
? @@( oA.Content() )
#--> [ 12, 0, -5, 18 ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

5. Le même mot sur des mots

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oS = new stzList([ "haro", "PHP", "C#", "ruby", "GO" ])
? @@( oS.FindW("{ IsUppercase(@item) }") )
#--> [ 2, 3, 5 ]
? @@( oS.ItemsW("{ Q(@item).IsLowercase() }") )
#--> [ "haro", "ruby" ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

Récapitulatif

ترجمة أولية: لم يراجعها بعدُ ناطق أصلي بالعربية.

صرّح بما لا بكيف

S1 · 1 – 7 · project-s1 · أداة صغيرة على مكان عملك، شروطها مصرَّح بها كبيانات. S0 – S4

course_narrated · 5/5 · ↗

مدخل أساسي · الفصل 7 · المهارتان FO-04 «هل أستطيع أن أقول ما أريد وأترك المحرك يقرر كيف؟» وPA-03 «هل أستطيع تسليم الشرط بدلًا من كتابة التفريع؟»

ترجمة أولية، في انتظار مراجعة متحدث أصلي.

إلى الآن كنت تسمّي شيئًا ثابتًا: «tea»، التكرارات، الموضع 4. يسمّي هذا الفصل شرطًا، ويسلّمه كبيانات. أنت تقول ما الذي يُقبل؛ والمحرك يقرر كيف يسير في القائمة ويختبر كل عنصر ويجمع الجواب. حرف W في آخر الاسم يعني where، «حيث».

1. ابحث حيث يصدق الشرط

@item يمثّل كل عنصر بدوره. الشرط قطعة نص بين قوسين معقوفين.

تعمل على الحاسوب مع سوفتانزا↗ 1/5
o = new stzList([ 4, 7, 10, 3, 8 ])
? @@( o.FindW("{ @item > 5 }") )
#--> [ 2, 3, 5 ]
? @@( o.ItemsW("{ @item > 5 }") )
#--> [ 7, 10, 8 ]
? o.CountW("{ @item > 5 }")
#--> 3
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

2. أيّ سؤال يصلح شرطًا

تعمل على الحاسوب مع سوفتانزا↗ 2/5
? @@( o.FindW("{ IsEven(@item) }") )
#--> [ 1, 3, 5 ]
? o.CheckW("{ isNumber(@item) }")
#--> TRUE
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

3. القاعدة بيانات: احفظها، وطبّقها في أي مكان

تسكن القاعدة في متغير. قائمتان، وقاعدة واحدة، ولم تعرف القاعدة قط أيّ قائمة ستلقى.

تعمل على الحاسوب مع سوفتانزا↗ 3/5
cRule = "{ @item > 20 }"
oA = new stzList([ 12, 0, 30, -5, 18, 25 ])
oB = new stzList([ 3, 40, 9 ])
? oA.CountW(cRule)
#--> 2
? oB.CountW(cRule)
#--> 1
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

4. تصرّف حيث تصدق القاعدة

تعمل على الحاسوب مع سوفتانزا↗ 4/5
? @@( oA.ItemsW(cRule) )
#--> [ 30, 25 ]
oA.RemoveW(cRule)
? @@( oA.Content() )
#--> [ 12, 0, -5, 18 ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

5. الكلمة نفسها على كلمات

تعمل على الحاسوب مع سوفتانزا↗ 5/5
oS = new stzList([ "haro", "PHP", "C#", "ruby", "GO" ])
? @@( oS.FindW("{ IsUppercase(@item) }") )
#--> [ 2, 3, 5 ]
? @@( oS.ItemsW("{ Q(@item).IsLowercase() }") )
#--> [ "haro", "ruby" ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

الخلاصة

Fassara ta farko: wani ɗan asalin harshen Hausa bai riga ya duba ta ba tukuna.

Bayyana me, ba yadda ba

S1 · 1 – 7 · project-s1 · Ƙaramin kayan aiki a kan wurin aikinka, sharuɗɗansa an bayyana su a matsayin bayanai. S0 – S4

course_narrated · 5/5 · ↗

Gabatarwa ta Farko · Babi na 7 · Fasahohi FO-04 "Zan iya faɗin abin da nake so in bar injin ya yanke yadda?" da PA-03 "Zan iya miƙa sharaɗin maimakon in rubuta reshen?"

Fassarar farko ce, tana jiran bita daga mai magana da Hausa a matsayin harshen uwa.

Har zuwa yanzu kana sa wa abu tabbatacce suna: "tea", maimaitattu, wuri na 4. Wannan babin yana sa wa sharaɗi suna, ya miƙa shi a matsayin bayanai. Kai kana faɗin abin da ya cancanta; injin yana yanke yadda zai bi jerin, ya gwada kowane abu ya tattara amsar. W a ƙarshen suna yana nufin where, "inda".

1. Nemo inda sharaɗi yake gaskiya

@item yana tsaya wa kowane abu bi da bi. Sharaɗin ɗan rubutu ne tsakanin manyan baka.

Tana gudana a kwamfuta tare da Softanza↗ 1/5
o = new stzList([ 4, 7, 10, 3, 8 ])
? @@( o.FindW("{ @item > 5 }") )
#--> [ 2, 3, 5 ]
? @@( o.ItemsW("{ @item > 5 }") )
#--> [ 7, 10, 8 ]
? o.CountW("{ @item > 5 }")
#--> 3
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

2. Kowace tambaya na iya zama sharaɗin

Tana gudana a kwamfuta tare da Softanza↗ 2/5
? @@( o.FindW("{ IsEven(@item) }") )
#--> [ 1, 3, 5 ]
? o.CheckW("{ isNumber(@item) }")
#--> TRUE
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

3. Doka bayanai ce: ajiye ta, ka yi amfani da ita a ko'ina

Dokar tana zaune a cikin canji. Jerin biyu, doka ɗaya, kuma dokar ba ta taɓa sanin wane jeri za ta haɗu da shi ba.

Tana gudana a kwamfuta tare da Softanza↗ 3/5
cRule = "{ @item > 20 }"
oA = new stzList([ 12, 0, 30, -5, 18, 25 ])
oB = new stzList([ 3, 40, 9 ])
? oA.CountW(cRule)
#--> 2
? oB.CountW(cRule)
#--> 1
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

4. Aiwatar inda dokar take gaskiya

Tana gudana a kwamfuta tare da Softanza↗ 4/5
? @@( oA.ItemsW(cRule) )
#--> [ 30, 25 ]
oA.RemoveW(cRule)
? @@( oA.Content() )
#--> [ 12, 0, -5, 18 ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

5. Kalma ɗaya a kan kalmomi

Tana gudana a kwamfuta tare da Softanza↗ 5/5
oS = new stzList([ "haro", "PHP", "C#", "ruby", "GO" ])
? @@( oS.FindW("{ IsUppercase(@item) }") )
#--> [ 2, 3, 5 ]
? @@( oS.ItemsW("{ Q(@item).IsLowercase() }") )
#--> [ "haro", "ruby" ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

Taƙaitawa

Patterns in text

S2 · Craftsperson · this chapter belongs to this rung, earned when chapters 1 to 11 and project-s2 have passed: A report over a real data file, with patterns, a table and a picture. The ladder

Proof · 4 cells ran, 9 promises kept, in each of the four editions · the proof of this chapter

Elementary Introduction · Chapter 8 · Skill PA-01: "What is the shape of the text I am looking for?"

Chapter 7 handed over a condition on numbers. Text has conditions too, but they are about shape: four digits, a dash, two digits. A pattern writes that shape down, and rx() tests any text against it. Read a pattern left to right, one piece at a time, and it says what it matches.

1. A date has a shape

[0-9] is one digit; {4} says four of them. Read the whole pattern as four digits, a dash, two digits, a dash, two digits.

Runs on the desktop with SoftanzaProof of this cell
? rx("[0-9]{4}-[0-9]{2}-[0-9]{2}").Match("2026-09-24")
#--> TRUE
? rx("[0-9]{4}-[0-9]{2}-[0-9]{2}").Match("24/09/2026")
#--> FALSE
This page stores no output. Run the cell to see what it prints.

2. Somewhere in the text, or the whole text

Match asks whether the whole text has the shape. MatchFirst asks whether the shape appears somewhere.

Runs on the desktop with SoftanzaProof of this cell
? rx("[0-9]+").Match("24/09/2026")
#--> FALSE
? rx("[0-9]+").MatchFirst("24/09/2026")
#--> TRUE
? @@( Q("tea 12, rice 30").Numbers() )
#--> [ "12", "30" ]
This page stores no output. Run the cell to see what it prints.

3. A phone number in Niger

^ and $ pin the pattern to the start and the end, and \+ means a real plus sign.

Runs on the desktop with SoftanzaProof of this cell
cPhone = "^\+227 [0-9]{2} [0-9]{2} [0-9]{2} [0-9]{2}$"
? rx(cPhone).Match("+227 90 12 34 56")
#--> TRUE
? rx(cPhone).Match("90 12 34 56")
#--> FALSE
This page stores no output. Run the cell to see what it prints.

4. A word said twice

A pattern can name a piece of what it saw and ask for it again. (?P<word>\w+) remembers a word, and (?P=word) demands the same word.

Runs on the desktop with SoftanzaProof of this cell
cTwice = "\b(?P<word>\w+)[\s]*(?P=word)\b"
? rx(cTwice).Match("the the")
#--> TRUE
? rx(cTwice).Match("the that")
#--> FALSE
This page stores no output. Run the cell to see what it prints.

Softanza also has a builder that writes patterns from words, stzRegexMaker. It is not shown in this edition of the course, because on the build the course was checked against, its examples do not run.

Recap

Traduction provisoire : pas encore relue par un locuteur natif.

Les motifs dans le texte

S2 · Artisan · ce chapitre appartient à ce barreau, gagné quand les chapitres 1 à 11 et project-s2 sont réussis : Un rapport sur un vrai fichier de données, avec des motifs, une table et une image. L'échelle

Preuve · 4 cellules exécutées, 9 promesses tenues, dans chacune des quatre éditions · la preuve de ce chapitre

Introduction élémentaire · Chapitre 8 · Compétence PA-01 : « Quelle est la forme du texte que je cherche ? »

Traduction provisoire, en attente de relecture par un locuteur natif.

Le chapitre 7 transmettait une condition sur des nombres. Le texte a aussi des conditions, mais elles portent sur la forme : quatre chiffres, un tiret, deux chiffres. Un motif écrit cette forme, et rx() teste n'importe quel texte contre elle. Lisez un motif de gauche à droite, un morceau à la fois, et il dit ce qu'il reconnaît.

1. Une date a une forme

[0-9] est un chiffre ; {4} en demande quatre. Lisez le motif entier comme quatre chiffres, un tiret, deux chiffres, un tiret, deux chiffres.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? rx("[0-9]{4}-[0-9]{2}-[0-9]{2}").Match("2026-09-24")
#--> TRUE
? rx("[0-9]{4}-[0-9]{2}-[0-9]{2}").Match("24/09/2026")
#--> FALSE
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

2. Quelque part dans le texte, ou le texte entier

Match demande si le texte entier a la forme. MatchFirst demande si la forme apparaît quelque part.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? rx("[0-9]+").Match("24/09/2026")
#--> FALSE
? rx("[0-9]+").MatchFirst("24/09/2026")
#--> TRUE
? @@( Q("tea 12, rice 30").Numbers() )
#--> [ "12", "30" ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

3. Un numéro de téléphone au Niger

^ et $ fixent le motif au début et à la fin, et \+ désigne un vrai signe plus.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
cPhone = "^\+227 [0-9]{2} [0-9]{2} [0-9]{2} [0-9]{2}$"
? rx(cPhone).Match("+227 90 12 34 56")
#--> TRUE
? rx(cPhone).Match("90 12 34 56")
#--> FALSE
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

4. Un mot dit deux fois

Un motif peut nommer un morceau de ce qu'il a vu et le redemander. (?P<word>\w+) retient un mot, et (?P=word) exige le même mot.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
cTwice = "\b(?P<word>\w+)[\s]*(?P=word)\b"
? rx(cTwice).Match("the the")
#--> TRUE
? rx(cTwice).Match("the that")
#--> FALSE
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

Softanza possède aussi un constructeur qui écrit des motifs à partir de mots, stzRegexMaker. Il n'est pas montré dans cette édition du cours, parce que sur la version contre laquelle le cours a été vérifié, ses exemples ne s'exécutent pas.

Récapitulatif

ترجمة أولية: لم يراجعها بعدُ ناطق أصلي بالعربية.

الأنماط في النص

S2 · 1 – 11 · project-s2 · تقرير على ملف بيانات حقيقي، بأنماط وجدول وصورة. S0 – S4

course_narrated · 4/4 · ↗

مدخل أساسي · الفصل 8 · المهارة PA-01: «ما شكل النص الذي أبحث عنه؟»

ترجمة أولية، في انتظار مراجعة متحدث أصلي.

سلّم الفصل 7 شرطًا على الأرقام. وللنص شروط أيضًا، لكنها عن الشكل: أربعة أرقام، وشرطة، ورقمان. النمط يكتب ذلك الشكل، وrx() يختبر أي نص مقابله. اقرأ النمط من اليسار إلى اليمين، قطعةً قطعة، فيقول لك ما يطابقه.

1. للتاريخ شكل

[0-9] رقم واحد؛ و{4} تطلب أربعة منه. اقرأ النمط كله: أربعة أرقام، شرطة، رقمان، شرطة، رقمان.

تعمل على الحاسوب مع سوفتانزا↗ 1/4
? rx("[0-9]{4}-[0-9]{2}-[0-9]{2}").Match("2026-09-24")
#--> TRUE
? rx("[0-9]{4}-[0-9]{2}-[0-9]{2}").Match("24/09/2026")
#--> FALSE
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

2. في مكان ما من النص، أم النص كله

Match تسأل هل للنص كله هذا الشكل. وMatchFirst تسأل هل يظهر الشكل في مكان ما.

تعمل على الحاسوب مع سوفتانزا↗ 2/4
? rx("[0-9]+").Match("24/09/2026")
#--> FALSE
? rx("[0-9]+").MatchFirst("24/09/2026")
#--> TRUE
? @@( Q("tea 12, rice 30").Numbers() )
#--> [ "12", "30" ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

3. رقم هاتف في النيجر

^ و$ تثبّتان النمط في البداية والنهاية، و\+ تعني علامة زائد حقيقية.

تعمل على الحاسوب مع سوفتانزا↗ 3/4
cPhone = "^\+227 [0-9]{2} [0-9]{2} [0-9]{2} [0-9]{2}$"
? rx(cPhone).Match("+227 90 12 34 56")
#--> TRUE
? rx(cPhone).Match("90 12 34 56")
#--> FALSE
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

4. كلمة قيلت مرتين

يستطيع النمط أن يسمّي قطعة مما رآه ويطلبها من جديد. (?P<word>\w+) تحفظ كلمة، و(?P=word) تطلب الكلمة نفسها.

تعمل على الحاسوب مع سوفتانزا↗ 4/4
cTwice = "\b(?P<word>\w+)[\s]*(?P=word)\b"
? rx(cTwice).Match("the the")
#--> TRUE
? rx(cTwice).Match("the that")
#--> FALSE
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

ولسوفتانزا أيضًا بانٍ يكتب الأنماط من الكلمات، stzRegexMaker. لا يُعرض في هذه الطبعة من الدرس، لأن أمثلته لا تعمل على البناء الذي رُوجع الدرس عليه.

الخلاصة

Fassara ta farko: wani ɗan asalin harshen Hausa bai riga ya duba ta ba tukuna.

Siffofi a cikin rubutu

S2 · 1 – 11 · project-s2 · Rahoto a kan fayil na bayanai na gaske, mai siffofi, tebur da hoto. S0 – S4

course_narrated · 4/4 · ↗

Gabatarwa ta Farko · Babi na 8 · Fasaha PA-01: "Menene siffar rubutun da nake nema?"

Fassarar farko ce, tana jiran bita daga mai magana da Hausa a matsayin harshen uwa.

Babi na 7 ya miƙa sharaɗi a kan lambobi. Rubutu ma yana da sharuɗɗa, amma nasa game da siffa ne: lambobi huɗu, ɗan sanda, lambobi biyu. Siffa tana rubuta wannan siffar, kuma rx() yana gwada kowane rubutu a kanta. Karanta siffa daga hagu zuwa dama, guntu bayan guntu, kuma tana faɗin abin da take dacewa.

1. Kwanan wata yana da siffa

[0-9] lamba ɗaya ce; {4} yana cewa huɗu daga cikinta. Karanta dukan siffar kamar lambobi huɗu, ɗan sanda, lambobi biyu, ɗan sanda, lambobi biyu.

Tana gudana a kwamfuta tare da Softanza↗ 1/4
? rx("[0-9]{4}-[0-9]{2}-[0-9]{2}").Match("2026-09-24")
#--> TRUE
? rx("[0-9]{4}-[0-9]{2}-[0-9]{2}").Match("24/09/2026")
#--> FALSE
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

2. Wani wuri a cikin rubutun, ko dukan rubutun

Match yana tambaya ko dukan rubutun yana da siffar. MatchFirst yana tambaya ko siffar ta bayyana a wani wuri.

Tana gudana a kwamfuta tare da Softanza↗ 2/4
? rx("[0-9]+").Match("24/09/2026")
#--> FALSE
? rx("[0-9]+").MatchFirst("24/09/2026")
#--> TRUE
? @@( Q("tea 12, rice 30").Numbers() )
#--> [ "12", "30" ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

3. Lambar waya a Nijar

^ da $ suna kafa siffar a farko da ƙarshe, kuma \+ yana nufin alamar ƙari ta gaske.

Tana gudana a kwamfuta tare da Softanza↗ 3/4
cPhone = "^\+227 [0-9]{2} [0-9]{2} [0-9]{2} [0-9]{2}$"
? rx(cPhone).Match("+227 90 12 34 56")
#--> TRUE
? rx(cPhone).Match("90 12 34 56")
#--> FALSE
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

4. Kalmar da aka faɗa sau biyu

Siffa na iya sa wa guntun abin da ta gani suna ta sake neman sa. (?P<word>\w+) yana tuna kalma, kuma (?P=word) yana buƙatar kalma ɗaya.

Tana gudana a kwamfuta tare da Softanza↗ 4/4
cTwice = "\b(?P<word>\w+)[\s]*(?P=word)\b"
? rx(cTwice).Match("the the")
#--> TRUE
? rx(cTwice).Match("the that")
#--> FALSE
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

Softanza kuma tana da mai ginawa da yake rubuta siffofi daga kalmomi, stzRegexMaker. Ba a nuna shi a wannan bugun darasin ba, domin a kan ginin da aka duba darasin a kai, misalansa ba sa gudana.

Taƙaitawa

Patterns in structure

S2 · Craftsperson · this chapter belongs to this rung, earned when chapters 1 to 11 and project-s2 have passed: A report over a real data file, with patterns, a table and a picture. The ladder

Proof · 5 cells ran, 11 promises kept, in each of the four editions · the proof of this chapter

Elementary Introduction · Chapter 9 · Skill PA-02: "What is the shape of this list or these numbers?"

A list has a shape: a number, then a text. A number has a shape: four digits, or prime, or a multiple of five. Softanza writes those shapes as patterns too, with Lx() for lists and stzNumbrex for numbers, and tests data against them the way chapter 8 tested text.

1. The shape of a list

@N is a number, @S is a text. An order line is a number of portions, then a dish.

Runs on the desktop with SoftanzaProof of this cell
? Lx("[@N, @S]").Match([ 42, "hello" ])
#--> TRUE
? Lx("[@N, @S]").Match([ "hello", 42 ])
#--> FALSE
This page stores no output. Run the cell to see what it prints.

2. How many of each

@N1-3 means one to three numbers.

Runs on the desktop with SoftanzaProof of this cell
? Lx("[@N1-3, @S]").Match([ 1, 2, "end" ])
#--> TRUE
? Lx("[@N1-3, @S]").Match([ 4, 5, 6, 7, "extra" ])
#--> FALSE
This page stores no output. Run the cell to see what it prints.

3. A shape inside a shape

Runs on the desktop with SoftanzaProof of this cell
? Lx("[@N, [@N2], @N]").Match([ 1, [ 2, 3 ], 4 ])
#--> TRUE
This page stores no output. Run the cell to see what it prints.

4. The shape of a number

A number pattern names a property. Prime is one; 17 has it and 18 does not.

Runs on the desktop with SoftanzaProof of this cell
oNx = new stzNumbrex("{@Property(Prime)}")
? oNx.Match(17)
#--> TRUE
? oNx.Match(18)
#--> FALSE
This page stores no output. Run the cell to see what it prints.

5. Multiples, and digit counts

Runs on the desktop with SoftanzaProof of this cell
oNx5 = new stzNumbrex("{@Relation(Mod:5=0)}")
? oNx5.Match(10)
#--> TRUE
? oNx5.Match(13)
#--> FALSE
oNx4 = new stzNumbrex("{@Digit4}")
? oNx4.Match(1234)
#--> TRUE
? oNx4.Match(123)
#--> FALSE
This page stores no output. Run the cell to see what it prints.

Recap

Traduction provisoire : pas encore relue par un locuteur natif.

Les motifs dans la structure

S2 · Artisan · ce chapitre appartient à ce barreau, gagné quand les chapitres 1 à 11 et project-s2 sont réussis : Un rapport sur un vrai fichier de données, avec des motifs, une table et une image. L'échelle

Preuve · 5 cellules exécutées, 11 promesses tenues, dans chacune des quatre éditions · la preuve de ce chapitre

Introduction élémentaire · Chapitre 9 · Compétence PA-02 : « Quelle est la forme de cette liste ou de ces nombres ? »

Traduction provisoire, en attente de relecture par un locuteur natif.

Une liste a une forme : un nombre, puis un texte. Un nombre a une forme : quatre chiffres, ou premier, ou multiple de cinq. Softanza écrit ces formes aussi comme des motifs, avec Lx() pour les listes et stzNumbrex pour les nombres, et teste les données contre elles comme le chapitre 8 testait le texte.

1. La forme d'une liste

@N est un nombre, @S est un texte. Une ligne de commande est un nombre de portions, puis un plat.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? Lx("[@N, @S]").Match([ 42, "hello" ])
#--> TRUE
? Lx("[@N, @S]").Match([ "hello", 42 ])
#--> FALSE
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

2. Combien de chaque

@N1-3 signifie un à trois nombres.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? Lx("[@N1-3, @S]").Match([ 1, 2, "end" ])
#--> TRUE
? Lx("[@N1-3, @S]").Match([ 4, 5, 6, 7, "extra" ])
#--> FALSE
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

3. Une forme dans une forme

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? Lx("[@N, [@N2], @N]").Match([ 1, [ 2, 3 ], 4 ])
#--> TRUE
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

4. La forme d'un nombre

Un motif de nombre nomme une propriété. Prime en est une ; 17 l'a et 18 ne l'a pas.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oNx = new stzNumbrex("{@Property(Prime)}")
? oNx.Match(17)
#--> TRUE
? oNx.Match(18)
#--> FALSE
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

5. Multiples, et nombre de chiffres

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oNx5 = new stzNumbrex("{@Relation(Mod:5=0)}")
? oNx5.Match(10)
#--> TRUE
? oNx5.Match(13)
#--> FALSE
oNx4 = new stzNumbrex("{@Digit4}")
? oNx4.Match(1234)
#--> TRUE
? oNx4.Match(123)
#--> FALSE
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

Récapitulatif

ترجمة أولية: لم يراجعها بعدُ ناطق أصلي بالعربية.

الأنماط في البنية

S2 · 1 – 11 · project-s2 · تقرير على ملف بيانات حقيقي، بأنماط وجدول وصورة. S0 – S4

course_narrated · 5/5 · ↗

مدخل أساسي · الفصل 9 · المهارة PA-02: «ما شكل هذه القائمة أو هذه الأرقام؟»

ترجمة أولية، في انتظار مراجعة متحدث أصلي.

للقائمة شكل: رقم، ثم نص. وللرقم شكل: أربعة أرقام، أو أولي، أو من مضاعفات الخمسة. تكتب سوفتانزا هذه الأشكال أنماطًا أيضًا، بـ Lx() للقوائم وstzNumbrex للأرقام، وتختبر البيانات مقابلها كما اختبر الفصل 8 النص.

1. شكل القائمة

@N رقم، و@S نص. سطر الطلبية عدد حصص ثم طبق.

تعمل على الحاسوب مع سوفتانزا↗ 1/5
? Lx("[@N, @S]").Match([ 42, "hello" ])
#--> TRUE
? Lx("[@N, @S]").Match([ "hello", 42 ])
#--> FALSE
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

2. كم من كل نوع

@N1-3 تعني من رقم إلى ثلاثة أرقام.

تعمل على الحاسوب مع سوفتانزا↗ 2/5
? Lx("[@N1-3, @S]").Match([ 1, 2, "end" ])
#--> TRUE
? Lx("[@N1-3, @S]").Match([ 4, 5, 6, 7, "extra" ])
#--> FALSE
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

3. شكل داخل شكل

تعمل على الحاسوب مع سوفتانزا↗ 3/5
? Lx("[@N, [@N2], @N]").Match([ 1, [ 2, 3 ], 4 ])
#--> TRUE
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

4. شكل الرقم

نمط الرقم يسمّي خاصية. Prime واحدة منها؛ لدى 17 هذه الخاصية وليست لدى 18.

تعمل على الحاسوب مع سوفتانزا↗ 4/5
oNx = new stzNumbrex("{@Property(Prime)}")
? oNx.Match(17)
#--> TRUE
? oNx.Match(18)
#--> FALSE
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

5. المضاعفات، وعدد الأرقام

تعمل على الحاسوب مع سوفتانزا↗ 5/5
oNx5 = new stzNumbrex("{@Relation(Mod:5=0)}")
? oNx5.Match(10)
#--> TRUE
? oNx5.Match(13)
#--> FALSE
oNx4 = new stzNumbrex("{@Digit4}")
? oNx4.Match(1234)
#--> TRUE
? oNx4.Match(123)
#--> FALSE
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

الخلاصة

Fassara ta farko: wani ɗan asalin harshen Hausa bai riga ya duba ta ba tukuna.

Siffofi a cikin tsari

S2 · 1 – 11 · project-s2 · Rahoto a kan fayil na bayanai na gaske, mai siffofi, tebur da hoto. S0 – S4

course_narrated · 5/5 · ↗

Gabatarwa ta Farko · Babi na 9 · Fasaha PA-02: "Menene siffar wannan jerin ko waɗannan lambobin?"

Fassarar farko ce, tana jiran bita daga mai magana da Hausa a matsayin harshen uwa.

Jeri yana da siffa: lamba, sannan rubutu. Lamba tana da siffa: lambobi huɗu, ko firamare, ko ninkin biyar. Softanza tana rubuta waɗannan siffofin a matsayin siffofi su ma, da Lx() ga jeri da stzNumbrex ga lambobi, kuma tana gwada bayanai a kansu kamar yadda babi na 8 ya gwada rubutu.

1. Siffar jeri

@N lamba ce, @S rubutu ne. Layin oda adadin rabo ne, sannan abinci.

Tana gudana a kwamfuta tare da Softanza↗ 1/5
? Lx("[@N, @S]").Match([ 42, "hello" ])
#--> TRUE
? Lx("[@N, @S]").Match([ "hello", 42 ])
#--> FALSE
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

2. Nawa na kowanne

@N1-3 yana nufin lambobi ɗaya zuwa uku.

Tana gudana a kwamfuta tare da Softanza↗ 2/5
? Lx("[@N1-3, @S]").Match([ 1, 2, "end" ])
#--> TRUE
? Lx("[@N1-3, @S]").Match([ 4, 5, 6, 7, "extra" ])
#--> FALSE
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

3. Siffa a cikin siffa

Tana gudana a kwamfuta tare da Softanza↗ 3/5
? Lx("[@N, [@N2], @N]").Match([ 1, [ 2, 3 ], 4 ])
#--> TRUE
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

4. Siffar lamba

Siffar lamba tana sa wa hali suna. Prime ɗaya ce; 17 tana da shi, 18 ba ta da shi.

Tana gudana a kwamfuta tare da Softanza↗ 4/5
oNx = new stzNumbrex("{@Property(Prime)}")
? oNx.Match(17)
#--> TRUE
? oNx.Match(18)
#--> FALSE
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

5. Ninki, da adadin lambobi

Tana gudana a kwamfuta tare da Softanza↗ 5/5
oNx5 = new stzNumbrex("{@Relation(Mod:5=0)}")
? oNx5.Match(10)
#--> TRUE
? oNx5.Match(13)
#--> FALSE
oNx4 = new stzNumbrex("{@Digit4}")
? oNx4.Match(1234)
#--> TRUE
? oNx4.Match(123)
#--> FALSE
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

Taƙaitawa

When code meets cells

S2 · Craftsperson · this chapter belongs to this rung, earned when chapters 1 to 11 and project-s2 have passed: A report over a real data file, with patterns, a table and a picture. The ladder

Proof · 5 cells ran, 9 promises kept, in each of the four editions · the proof of this chapter

Elementary Introduction · Chapter 10 · Skill PA-04: "Which cells answer my question?"

A restaurant's menu is a table: one row per dish, one column per fact about it. stzTable holds it, draws it, and answers questions by column, by row and by cell. And a column is a list, so everything you asked a list in the first chapters can be asked of a column.

1. Build the table, and look at it

The first row names the columns. Run the cell to see the table drawn.

Runs on the desktop with SoftanzaProof of this cell
oT = new stzTable([
	[ :DISH, :PRICE, :ORDERS ],
	[ "tea",  200, 6 ],
	[ "rice", 500, 3 ],
	[ "fish", 900, 2 ]
])
oT.Show()
This page stores no output. Run the cell to see what it prints.

2. Its shape

Runs on the desktop with SoftanzaProof of this cell
? oT.NumberOfRows()
#--> 3
? oT.NumberOfCols()
#--> 3
? @@( oT.ColNames() )
#--> [ "dish", "price", "orders" ]
This page stores no output. Run the cell to see what it prints.

3. A column, a row

Runs on the desktop with SoftanzaProof of this cell
? @@( oT.Col(:PRICE) )
#--> [ 200, 500, 900 ]
? @@( oT.Row(2) )
#--> [ "rice", 500, 3 ]
This page stores no output. Run the cell to see what it prints.

4. A cell, and where a value is

Runs on the desktop with SoftanzaProof of this cell
? oT.Cell(:PRICE, 3)
#--> 900
? @@( oT.FindInCol(:DISH, "fish") )
#--> [ 3 ]
This page stores no output. Run the cell to see what it prints.

5. A column is a list: ask it the list questions

Runs on the desktop with SoftanzaProof of this cell
? StzListQ(oT.Col(:ORDERS)).Sum()
#--> 11
? @@( StzListQ(oT.Col(:PRICE)).FindW("{ @item > 400 }") )
#--> [ 2, 3 ]
This page stores no output. Run the cell to see what it prints.

Recap

Traduction provisoire : pas encore relue par un locuteur natif.

Quand le code rencontre les cellules

S2 · Artisan · ce chapitre appartient à ce barreau, gagné quand les chapitres 1 à 11 et project-s2 sont réussis : Un rapport sur un vrai fichier de données, avec des motifs, une table et une image. L'échelle

Preuve · 5 cellules exécutées, 9 promesses tenues, dans chacune des quatre éditions · la preuve de ce chapitre

Introduction élémentaire · Chapitre 10 · Compétence PA-04 : « Quelles cellules répondent à ma question ? »

Traduction provisoire, en attente de relecture par un locuteur natif.

Le menu d'un restaurant est une table : une ligne par plat, une colonne par information sur lui. stzTable la porte, la dessine, et répond aux questions par colonne, par ligne et par cellule. Et une colonne est une liste : tout ce que vous avez demandé à une liste dans les premiers chapitres peut être demandé à une colonne.

1. Construire la table, et la regarder

La première ligne nomme les colonnes. Exécutez la cellule pour voir la table dessinée.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oT = new stzTable([
	[ :DISH, :PRICE, :ORDERS ],
	[ "tea",  200, 6 ],
	[ "rice", 500, 3 ],
	[ "fish", 900, 2 ]
])
oT.Show()
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

2. Sa forme

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? oT.NumberOfRows()
#--> 3
? oT.NumberOfCols()
#--> 3
? @@( oT.ColNames() )
#--> [ "dish", "price", "orders" ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

3. Une colonne, une ligne

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? @@( oT.Col(:PRICE) )
#--> [ 200, 500, 900 ]
? @@( oT.Row(2) )
#--> [ "rice", 500, 3 ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

4. Une cellule, et où se trouve une valeur

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? oT.Cell(:PRICE, 3)
#--> 900
? @@( oT.FindInCol(:DISH, "fish") )
#--> [ 3 ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

5. Une colonne est une liste : posez-lui les questions des listes

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? StzListQ(oT.Col(:ORDERS)).Sum()
#--> 11
? @@( StzListQ(oT.Col(:PRICE)).FindW("{ @item > 400 }") )
#--> [ 2, 3 ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

Récapitulatif

ترجمة أولية: لم يراجعها بعدُ ناطق أصلي بالعربية.

حين يلتقي الكود بالخلايا

S2 · 1 – 11 · project-s2 · تقرير على ملف بيانات حقيقي، بأنماط وجدول وصورة. S0 – S4

course_narrated · 4/5 · ↗

مدخل أساسي · الفصل 10 · المهارة PA-04: «أيّ الخلايا تجيب عن سؤالي؟»

ترجمة أولية، في انتظار مراجعة متحدث أصلي.

قائمة طعام المطعم جدول: صف لكل طبق، وعمود لكل معلومة عنه. stzTable يحمله ويرسمه ويجيب عن الأسئلة بالعمود والصف والخلية. والعمود قائمة، فكل ما سألته قائمةً في الفصول الأولى تستطيع أن تسأله عمودًا.

1. ابنِ الجدول، وانظر إليه

الصف الأول يسمّي الأعمدة. شغّل الخلية لترى الجدول مرسومًا.

تعمل على الحاسوب مع سوفتانزا↗ 1/5
oT = new stzTable([
	[ :DISH, :PRICE, :ORDERS ],
	[ "tea",  200, 6 ],
	[ "rice", 500, 3 ],
	[ "fish", 900, 2 ]
])
oT.Show()
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

2. شكله

تعمل على الحاسوب مع سوفتانزا↗ 2/5
? oT.NumberOfRows()
#--> 3
? oT.NumberOfCols()
#--> 3
? @@( oT.ColNames() )
#--> [ "dish", "price", "orders" ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

3. عمود، وصف

تعمل على الحاسوب مع سوفتانزا↗ 3/5
? @@( oT.Col(:PRICE) )
#--> [ 200, 500, 900 ]
? @@( oT.Row(2) )
#--> [ "rice", 500, 3 ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

4. خلية، وأين قيمة ما

تعمل على الحاسوب مع سوفتانزا↗ 4/5
? oT.Cell(:PRICE, 3)
#--> 900
? @@( oT.FindInCol(:DISH, "fish") )
#--> [ 3 ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

5. العمود قائمة: اسأله أسئلة القوائم

تعمل على الحاسوب مع سوفتانزا↗ 5/5
? StzListQ(oT.Col(:ORDERS)).Sum()
#--> 11
? @@( StzListQ(oT.Col(:PRICE)).FindW("{ @item > 400 }") )
#--> [ 2, 3 ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

الخلاصة

Fassara ta farko: wani ɗan asalin harshen Hausa bai riga ya duba ta ba tukuna.

Lokacin da lamba ta haɗu da ɗakuna

S2 · 1 – 11 · project-s2 · Rahoto a kan fayil na bayanai na gaske, mai siffofi, tebur da hoto. S0 – S4

course_narrated · 4/5 · ↗

Gabatarwa ta Farko · Babi na 10 · Fasaha PA-04: "Waɗanne ɗakuna ne suke amsa tambayata?"

Fassarar farko ce, tana jiran bita daga mai magana da Hausa a matsayin harshen uwa.

Menu na gidan abinci tebur ne: layi ɗaya ga kowane abinci, shafi ɗaya ga kowane bayani game da shi. stzTable yana riƙe shi, yana zana shi, kuma yana amsa tambayoyi ta shafi, ta layi da ta ɗaki. Kuma shafi jeri ne, saboda haka duk abin da ka tambayi jeri a babi na farko ana iya tambayar shafi.

1. Gina teburin, ka dube shi

Layin farko yana sa wa shafuka suna. Gudanar da ɗakin ka ga teburin an zana.

Tana gudana a kwamfuta tare da Softanza↗ 1/5
oT = new stzTable([
	[ :DISH, :PRICE, :ORDERS ],
	[ "tea",  200, 6 ],
	[ "rice", 500, 3 ],
	[ "fish", 900, 2 ]
])
oT.Show()
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

2. Siffarsa

Tana gudana a kwamfuta tare da Softanza↗ 2/5
? oT.NumberOfRows()
#--> 3
? oT.NumberOfCols()
#--> 3
? @@( oT.ColNames() )
#--> [ "dish", "price", "orders" ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

3. Shafi, layi

Tana gudana a kwamfuta tare da Softanza↗ 3/5
? @@( oT.Col(:PRICE) )
#--> [ 200, 500, 900 ]
? @@( oT.Row(2) )
#--> [ "rice", 500, 3 ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

4. Ɗaki, da inda daraja take

Tana gudana a kwamfuta tare da Softanza↗ 4/5
? oT.Cell(:PRICE, 3)
#--> 900
? @@( oT.FindInCol(:DISH, "fish") )
#--> [ 3 ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

5. Shafi jeri ne: yi masa tambayoyin jeri

Tana gudana a kwamfuta tare da Softanza↗ 5/5
? StzListQ(oT.Col(:ORDERS)).Sum()
#--> 11
? @@( StzListQ(oT.Col(:PRICE)).FindW("{ @item > 400 }") )
#--> [ 2, 3 ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

Taƙaitawa

Draw the answer

S2 · Craftsperson · this chapter belongs to this rung, earned when chapters 1 to 11 and project-s2 have passed: A report over a real data file, with patterns, a table and a picture. The ladder

Proof · 5 cells ran, 13 promises kept, in each of the four editions · the proof of this chapter

Elementary Introduction · Chapter 11 · Skills SE-01 "Would a picture answer this faster than a number?" and SE-02 "Where, and how much?"

[ 3, 9, 15 ] is a correct answer to "where is haro?". It is not a quick one. A picture puts the answer where the eye already is. Softanza draws answers in text, so a drawing is something a program can print, a page can hold and a guard can check, line by line.

1. Show where, not only which position

Runs on the desktop with SoftanzaProof of this cell
o1 = new stzString("fjharoljharodjharog")
? @@( o1.FindAll("haro") )
#--> [ 3, 9, 15 ]
? o1.vizFind("haro")
#--> fjharoljharodjharog
#--> --^-----^-----^----
This page stores no output. Run the cell to see what it prints.

2. With the numbers under the marks

Runs on the desktop with SoftanzaProof of this cell
? o1.vizFindXT("haro", [ :Numbered = TRUE ])
#--> fjharoljharodjharog
#--> --^-----^-----^----
#--> 3     9     15
This page stores no output. Run the cell to see what it prints.

3. A graph is a picture of relations

An order reaches the kitchen, and the kitchen reaches the table. The graph answers questions, and then draws itself.

Runs on the desktop with SoftanzaProof of this cell
oG = new stzGraph("kitchen")
oG {
	AddNodeXT("order", "Order")
	AddNodeXT("kitchen", "Kitchen")
	AddNodeXT("table", "Table")
	Connect("order", "kitchen")
	Connect("kitchen", "table")
}
? oG.PathExists("order", "table")
#--> TRUE
? @@( oG.Neighbors("kitchen") )
#--> [ "table" ]
oG.Show()
#--> │ Order │
#--> │ Table │
This page stores no output. Run the cell to see what it prints.

4. How much: a bar for each dish

Runs on the desktop with SoftanzaProof of this cell
oP = new stzHBarPlot([ :tea = 6, :rice = 3, :fish = 2 ])
oP.Show()
#--> Tea │ ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇
#--> Fish │ ▇▇▇▇▇▇
This page stores no output. Run the cell to see what it prints.

5. The same bars, standing up

Runs on the desktop with SoftanzaProof of this cell
oP2 = new stzVBarPlot([ :tea = 6, :rice = 3, :fish = 2 ])
oP2.SetHeight(4)
oP2.Show()
#--> Tea Rice Fish
This page stores no output. Run the cell to see what it prints.

Maps belong here too: Softanza draws data on a map of a real place, and picks the projection that does not lie about it. That is the practitioner level of this skill, and a later course.

Recap

Traduction provisoire : pas encore relue par un locuteur natif.

Dessiner la réponse

S2 · Artisan · ce chapitre appartient à ce barreau, gagné quand les chapitres 1 à 11 et project-s2 sont réussis : Un rapport sur un vrai fichier de données, avec des motifs, une table et une image. L'échelle

Preuve · 5 cellules exécutées, 13 promesses tenues, dans chacune des quatre éditions · la preuve de ce chapitre

Introduction élémentaire · Chapitre 11 · Compétences SE-01 « Une image répondrait-elle plus vite qu'un nombre ? » et SE-02 « Où, et combien ? »

Traduction provisoire, en attente de relecture par un locuteur natif.

[ 3, 9, 15 ] est une réponse correcte à « où est haro ? ». Ce n'est pas une réponse rapide. Une image met la réponse là où l'œil est déjà. Softanza dessine ses réponses en texte : un dessin est donc quelque chose qu'un programme peut afficher, qu'une page peut porter et qu'une garde peut vérifier, ligne par ligne.

1. Montrer où, pas seulement quelle position

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
o1 = new stzString("fjharoljharodjharog")
? @@( o1.FindAll("haro") )
#--> [ 3, 9, 15 ]
? o1.vizFind("haro")
#--> fjharoljharodjharog
#--> --^-----^-----^----
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

2. Avec les nombres sous les marques

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? o1.vizFindXT("haro", [ :Numbered = TRUE ])
#--> fjharoljharodjharog
#--> --^-----^-----^----
#--> 3     9     15
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

3. Un graphe est une image de relations

Une commande atteint la cuisine, et la cuisine atteint la table. Le graphe répond aux questions, puis se dessine lui-même.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oG = new stzGraph("kitchen")
oG {
	AddNodeXT("order", "Order")
	AddNodeXT("kitchen", "Kitchen")
	AddNodeXT("table", "Table")
	Connect("order", "kitchen")
	Connect("kitchen", "table")
}
? oG.PathExists("order", "table")
#--> TRUE
? @@( oG.Neighbors("kitchen") )
#--> [ "table" ]
oG.Show()
#--> │ Order │
#--> │ Table │
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

4. Combien : une barre par plat

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oP = new stzHBarPlot([ :tea = 6, :rice = 3, :fish = 2 ])
oP.Show()
#--> Tea │ ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇
#--> Fish │ ▇▇▇▇▇▇
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

5. Les mêmes barres, debout

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oP2 = new stzVBarPlot([ :tea = 6, :rice = 3, :fish = 2 ])
oP2.SetHeight(4)
oP2.Show()
#--> Tea Rice Fish
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

Les cartes ont leur place ici aussi : Softanza dessine des données sur la carte d'un lieu réel, et choisit la projection qui ne ment pas sur elles. C'est le niveau praticien de cette compétence, et un cours ultérieur.

Récapitulatif

ترجمة أولية: لم يراجعها بعدُ ناطق أصلي بالعربية.

ارسم الجواب

S2 · 1 – 11 · project-s2 · تقرير على ملف بيانات حقيقي، بأنماط وجدول وصورة. S0 – S4

course_narrated · 5/5 · ↗

مدخل أساسي · الفصل 11 · المهارتان SE-01 «هل تجيب صورة عن هذا أسرع من رقم؟» وSE-02 «أين، وكم؟»

ترجمة أولية، في انتظار مراجعة متحدث أصلي.

[ 3, 9, 15 ] جواب صحيح عن «أين haro؟». لكنه ليس جوابًا سريعًا. الصورة تضع الجواب حيث العين أصلًا. ترسم سوفتانزا الأجوبة نصًا، فالرسم شيء يستطيع البرنامج طبعه، والصفحة حمله، والحارس التحقق منه سطرًا سطرًا.

1. أظهر أين، لا الموضع فقط

تعمل على الحاسوب مع سوفتانزا↗ 1/5
o1 = new stzString("fjharoljharodjharog")
? @@( o1.FindAll("haro") )
#--> [ 3, 9, 15 ]
? o1.vizFind("haro")
#--> fjharoljharodjharog
#--> --^-----^-----^----
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

2. مع الأرقام تحت العلامات

تعمل على الحاسوب مع سوفتانزا↗ 2/5
? o1.vizFindXT("haro", [ :Numbered = TRUE ])
#--> fjharoljharodjharog
#--> --^-----^-----^----
#--> 3     9     15
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

3. الرسم البياني صورة للعلاقات

الطلبية تصل إلى المطبخ، والمطبخ يصل إلى الطاولة. يجيب الرسم عن الأسئلة، ثم يرسم نفسه.

تعمل على الحاسوب مع سوفتانزا↗ 3/5
oG = new stzGraph("kitchen")
oG {
	AddNodeXT("order", "Order")
	AddNodeXT("kitchen", "Kitchen")
	AddNodeXT("table", "Table")
	Connect("order", "kitchen")
	Connect("kitchen", "table")
}
? oG.PathExists("order", "table")
#--> TRUE
? @@( oG.Neighbors("kitchen") )
#--> [ "table" ]
oG.Show()
#--> │ Order │
#--> │ Table │
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

4. كم: عمود لكل طبق

تعمل على الحاسوب مع سوفتانزا↗ 4/5
oP = new stzHBarPlot([ :tea = 6, :rice = 3, :fish = 2 ])
oP.Show()
#--> Tea │ ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇
#--> Fish │ ▇▇▇▇▇▇
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

5. الأعمدة نفسها، واقفة

تعمل على الحاسوب مع سوفتانزا↗ 5/5
oP2 = new stzVBarPlot([ :tea = 6, :rice = 3, :fish = 2 ])
oP2.SetHeight(4)
oP2.Show()
#--> Tea Rice Fish
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

وللخرائط مكان هنا أيضًا: ترسم سوفتانزا البيانات على خريطة مكان حقيقي، وتختار الإسقاط الذي لا يكذب عليها. ذلك هو مستوى الممارس من هذه المهارة، ودرس لاحق.

الخلاصة

Fassara ta farko: wani ɗan asalin harshen Hausa bai riga ya duba ta ba tukuna.

Zana amsar

S2 · 1 – 11 · project-s2 · Rahoto a kan fayil na bayanai na gaske, mai siffofi, tebur da hoto. S0 – S4

course_narrated · 5/5 · ↗

Gabatarwa ta Farko · Babi na 11 · Fasahohi SE-01 "Shin hoto zai amsa wannan da sauri fiye da lamba?" da SE-02 "Ina, kuma nawa?"

Fassarar farko ce, tana jiran bita daga mai magana da Hausa a matsayin harshen uwa.

[ 3, 9, 15 ] amsa ce daidai ga "ina haro yake?". Ba amsa ce mai sauri ba. Hoto yana sanya amsar inda ido yake tuni. Softanza tana zana amsoshi da rubutu, saboda haka zane abu ne da shiri zai iya bugawa, shafi zai iya riƙewa, kuma mai tsaro zai iya dubawa, layi bayan layi.

1. Nuna ina, ba wuri kawai ba

Tana gudana a kwamfuta tare da Softanza↗ 1/5
o1 = new stzString("fjharoljharodjharog")
? @@( o1.FindAll("haro") )
#--> [ 3, 9, 15 ]
? o1.vizFind("haro")
#--> fjharoljharodjharog
#--> --^-----^-----^----
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

2. Da lambobin a ƙarƙashin alamomin

Tana gudana a kwamfuta tare da Softanza↗ 2/5
? o1.vizFindXT("haro", [ :Numbered = TRUE ])
#--> fjharoljharodjharog
#--> --^-----^-----^----
#--> 3     9     15
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

3. Zane hoton alaƙa ne

Oda tana kaiwa kicin, kuma kicin yana kaiwa tebur. Zanen yana amsa tambayoyi, sannan ya zana kansa.

Tana gudana a kwamfuta tare da Softanza↗ 3/5
oG = new stzGraph("kitchen")
oG {
	AddNodeXT("order", "Order")
	AddNodeXT("kitchen", "Kitchen")
	AddNodeXT("table", "Table")
	Connect("order", "kitchen")
	Connect("kitchen", "table")
}
? oG.PathExists("order", "table")
#--> TRUE
? @@( oG.Neighbors("kitchen") )
#--> [ "table" ]
oG.Show()
#--> │ Order │
#--> │ Table │
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

4. Nawa: sanda ɗaya ga kowane abinci

Tana gudana a kwamfuta tare da Softanza↗ 4/5
oP = new stzHBarPlot([ :tea = 6, :rice = 3, :fish = 2 ])
oP.Show()
#--> Tea │ ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇
#--> Fish │ ▇▇▇▇▇▇
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

5. Sanduna ɗin nan, a tsaye

Tana gudana a kwamfuta tare da Softanza↗ 5/5
oP2 = new stzVBarPlot([ :tea = 6, :rice = 3, :fish = 2 ])
oP2.SetHeight(4)
oP2.Show()
#--> Tea Rice Fish
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

Taswirori suna da wuri a nan su ma: Softanza tana zana bayanai a taswirar wuri na gaske, ta zaɓi tsarin da ba ya yin ƙarya game da su. Wannan matakin ƙwararre ne na wannan fasahar, kuma darasi na gaba.

Taƙaitawa

Teach a world

S3 · Architect · this chapter belongs to this rung, earned when chapters 1 to 14 and project-s3 have passed: A world you taught, questioned by an agent you govern. The ladder

Proof · 5 cells ran, 9 promises kept, in each of the four editions · the proof of this chapter

Elementary Introduction · Chapter 12 · Skills KN-01 "What does my workplace know, and how do I write it down?" and KN-02 "What follows from what I wrote down?"

Softanza knows nothing about your restaurant, your bank or your school until you tell it. A world is what you tell it: facts, written as three words each, and a few laws about the relations between them. Once a world exists, Softanza can answer questions over it, and prove the answers.

1. State facts

A fact is subject, relation, object. Know states what a thing is; KnowRelation states any other relation.

Runs on the desktop with SoftanzaProof of this cell
oKB = new stzKnowledgeGraph("menu")
oKB.Know("margherita", "dish").Know("tiramisu", "dish").Know("pizza", "dish")
oKB.KnowRelation("margherita", "kind-of", "pizza")
oKB.KnowRelation("pizza", "kind-of", "food")
oKB.KnowRelation("margherita", "contains", "tomato")
? @@( oKB.Query([ "?x", "is-a", "dish" ]) )
#--> [ "margherita", "tiramisu", "pizza" ]
? @@( oKB.Query([ "margherita", "contains", "?o" ]) )
#--> [ "tomato" ]
This page stores no output. Run the cell to see what it prints.

2. A query answers from what was recorded

Nobody recorded that a margherita is a kind of food. A query says only what was written.

Runs on the desktop with SoftanzaProof of this cell
? @@( oKB.Query([ "margherita", "kind-of", "?o" ]) )
#--> [ "pizza" ]
This page stores no output. Run the cell to see what it prints.

3. A law makes reasoning possible

kind-of chains: a margherita is a kind of pizza, a pizza is a kind of food. Declare the relation transitive, and Prove follows the chain and shows every step.

Runs on the desktop with SoftanzaProof of this cell
oKB.ConstrainRelation("kind-of", :Transitive)
aProof = oKB.Prove([ "margherita", "kind-of", "food" ])
? aProof[:verdict]
#--> TRUE
? aProof[:narration]
#--> proved: margherita kind-of pizza kind-of food
This page stores no output. Run the cell to see what it prints.

4. A world is a file you can read

Runs on the desktop with SoftanzaProof of this cell
? oKB.ExportToKnow()
#--> knowledge "menu"
#--> margherita | is-a | dish
#--> margherita | contains | tomato
#--> kind-of | transitive
This page stores no output. Run the cell to see what it prints.

5. The world this course runs over

The chapters of this course reason over a world file. Here it is, questioned. What it prints depends on the world, so run it.

Runs on the desktop with SoftanzaProof of this cell
? EduWorldName()
? @@( EduWorld().Query([ "?o", "requested", "?d" ]) )
This page stores no output. Run the cell to see what it prints.

Recap

Traduction provisoire : pas encore relue par un locuteur natif.

Enseigner un monde

S3 · Architecte · ce chapitre appartient à ce barreau, gagné quand les chapitres 1 à 14 et project-s3 sont réussis : Un monde que vous avez enseigné, interrogé par un agent que vous gouvernez. L'échelle

Preuve · 5 cellules exécutées, 9 promesses tenues, dans chacune des quatre éditions · la preuve de ce chapitre

Introduction élémentaire · Chapitre 12 · Compétences KN-01 « Que sait mon lieu de travail, et comment l'écrire ? » et KN-02 « Que découle de ce que j'ai écrit ? »

Traduction provisoire, en attente de relecture par un locuteur natif.

Softanza ne sait rien de votre restaurant, de votre banque ou de votre école tant que vous ne le lui dites pas. Un monde, c'est ce que vous lui dites : des faits, écrits en trois mots chacun, et quelques lois sur les relations entre eux. Une fois qu'un monde existe, Softanza peut répondre à des questions dessus, et prouver ses réponses.

1. Énoncer des faits

Un fait, c'est sujet, relation, objet. Know dit ce qu'une chose est ; KnowRelation dit toute autre relation.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oKB = new stzKnowledgeGraph("menu")
oKB.Know("margherita", "dish").Know("tiramisu", "dish").Know("pizza", "dish")
oKB.KnowRelation("margherita", "kind-of", "pizza")
oKB.KnowRelation("pizza", "kind-of", "food")
oKB.KnowRelation("margherita", "contains", "tomato")
? @@( oKB.Query([ "?x", "is-a", "dish" ]) )
#--> [ "margherita", "tiramisu", "pizza" ]
? @@( oKB.Query([ "margherita", "contains", "?o" ]) )
#--> [ "tomato" ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

2. Une requête répond d'après ce qui a été enregistré

Personne n'a enregistré qu'une margherita est une sorte d'aliment. Une requête ne dit que ce qui a été écrit.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? @@( oKB.Query([ "margherita", "kind-of", "?o" ]) )
#--> [ "pizza" ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

3. Une loi rend le raisonnement possible

kind-of s'enchaîne : une margherita est une sorte de pizza, une pizza est une sorte d'aliment. Déclarez la relation transitive, et Prove suit la chaîne et montre chaque étape.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oKB.ConstrainRelation("kind-of", :Transitive)
aProof = oKB.Prove([ "margherita", "kind-of", "food" ])
? aProof[:verdict]
#--> TRUE
? aProof[:narration]
#--> proved: margherita kind-of pizza kind-of food
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

4. Un monde est un fichier que vous pouvez lire

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? oKB.ExportToKnow()
#--> knowledge "menu"
#--> margherita | is-a | dish
#--> margherita | contains | tomato
#--> kind-of | transitive
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

5. Le monde sur lequel ce cours s'exécute

Les chapitres de ce cours raisonnent sur un fichier de monde. Le voici, interrogé. Ce qui s'affiche dépend du monde : exécutez la cellule.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? EduWorldName()
? @@( EduWorld().Query([ "?o", "requested", "?d" ]) )
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

Récapitulatif

ترجمة أولية: لم يراجعها بعدُ ناطق أصلي بالعربية.

علّم عالمًا

S3 · 1 – 14 · project-s3 · عالم علّمته، يسأله وكيل تحكمه أنت. S0 – S4

course_narrated · 4/5 · ↗

مدخل أساسي · الفصل 12 · المهارتان KN-01 «ماذا يعرف مكان عملي، وكيف أكتبه؟» وKN-02 «ماذا يترتب على ما كتبته؟»

ترجمة أولية، في انتظار مراجعة متحدث أصلي.

لا تعرف سوفتانزا شيئًا عن مطعمك أو بنكك أو مدرستك حتى تخبرها. العالم هو ما تخبرها به: حقائق، تُكتب كل واحدة في ثلاث كلمات، وبضعة قوانين عن العلاقات بينها. وما إن يوجد عالم حتى تستطيع سوفتانزا أن تجيب عن أسئلة فوقه، وتثبت الأجوبة.

1. صرّح بالحقائق

الحقيقة فاعل، علاقة، مفعول. Know تقول ما الشيء؛ وKnowRelation تقول أي علاقة أخرى.

تعمل على الحاسوب مع سوفتانزا↗ 1/5
oKB = new stzKnowledgeGraph("menu")
oKB.Know("margherita", "dish").Know("tiramisu", "dish").Know("pizza", "dish")
oKB.KnowRelation("margherita", "kind-of", "pizza")
oKB.KnowRelation("pizza", "kind-of", "food")
oKB.KnowRelation("margherita", "contains", "tomato")
? @@( oKB.Query([ "?x", "is-a", "dish" ]) )
#--> [ "margherita", "tiramisu", "pizza" ]
? @@( oKB.Query([ "margherita", "contains", "?o" ]) )
#--> [ "tomato" ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

2. الاستعلام يجيب مما سُجّل

لم يسجّل أحد أن المارغريتا نوع من الطعام. الاستعلام لا يقول إلا ما كُتب.

تعمل على الحاسوب مع سوفتانزا↗ 2/5
? @@( oKB.Query([ "margherita", "kind-of", "?o" ]) )
#--> [ "pizza" ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

3. القانون يجعل الاستدلال ممكنًا

kind-of تتسلسل: المارغريتا نوع من البيتزا، والبيتزا نوع من الطعام. أعلن العلاقة متعدية، فتتبع Prove السلسلة وتُظهر كل خطوة.

تعمل على الحاسوب مع سوفتانزا↗ 3/5
oKB.ConstrainRelation("kind-of", :Transitive)
aProof = oKB.Prove([ "margherita", "kind-of", "food" ])
? aProof[:verdict]
#--> TRUE
? aProof[:narration]
#--> proved: margherita kind-of pizza kind-of food
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

4. العالم ملف تستطيع قراءته

تعمل على الحاسوب مع سوفتانزا↗ 4/5
? oKB.ExportToKnow()
#--> knowledge "menu"
#--> margherita | is-a | dish
#--> margherita | contains | tomato
#--> kind-of | transitive
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

5. العالم الذي يجري عليه هذا الدرس

فصول هذا الدرس تستدل على ملف عالم. ها هو، مسؤولًا. ما يُطبع يتوقف على العالم، فشغّل الخلية.

تعمل على الحاسوب مع سوفتانزا↗ 5/5
? EduWorldName()
? @@( EduWorld().Query([ "?o", "requested", "?d" ]) )
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

الخلاصة

Fassara ta farko: wani ɗan asalin harshen Hausa bai riga ya duba ta ba tukuna.

Koyar da duniya

S3 · 1 – 14 · project-s3 · Duniyar da ka koyar, wanda wakilin da kake mulka yake tambaya. S0 – S4

course_narrated · 4/5 · ↗

Gabatarwa ta Farko · Babi na 12 · Fasahohi KN-01 "Me wurin aikina ya sani, kuma ta yaya zan rubuta shi?" da KN-02 "Me ya biyo bayan abin da na rubuta?"

Fassarar farko ce, tana jiran bita daga mai magana da Hausa a matsayin harshen uwa.

Softanza ba ta san komai game da gidan abincinka, bankinka ko makarantarka ba har sai ka faɗa mata. Duniya ita ce abin da ka faɗa mata: gaskiya, an rubuta kowace da kalmomi uku, da dokoki kaɗan game da alaƙoƙin da ke tsakaninsu. Da zarar duniya ta wanzu, Softanza tana iya amsa tambayoyi a kanta, ta tabbatar da amsoshin.

1. Faɗi gaskiya

Gaskiya ita ce batun, alaƙa, abu. Know yana faɗin abin da wani abu yake; KnowRelation yana faɗin kowace alaƙa.

Tana gudana a kwamfuta tare da Softanza↗ 1/5
oKB = new stzKnowledgeGraph("menu")
oKB.Know("margherita", "dish").Know("tiramisu", "dish").Know("pizza", "dish")
oKB.KnowRelation("margherita", "kind-of", "pizza")
oKB.KnowRelation("pizza", "kind-of", "food")
oKB.KnowRelation("margherita", "contains", "tomato")
? @@( oKB.Query([ "?x", "is-a", "dish" ]) )
#--> [ "margherita", "tiramisu", "pizza" ]
? @@( oKB.Query([ "margherita", "contains", "?o" ]) )
#--> [ "tomato" ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

2. Tambaya tana amsawa daga abin da aka rubuta

Babu wanda ya rubuta cewa margherita iri ce ta abinci. Tambaya tana faɗin abin da aka rubuta kawai.

Tana gudana a kwamfuta tare da Softanza↗ 2/5
? @@( oKB.Query([ "margherita", "kind-of", "?o" ]) )
#--> [ "pizza" ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

3. Doka tana sa tunani ya yiwu

kind-of yana sarƙa: margherita iri ce ta pizza, pizza iri ce ta abinci. Bayyana alaƙar mai wucewa, kuma Prove yana bin sarƙar ya nuna kowane mataki.

Tana gudana a kwamfuta tare da Softanza↗ 3/5
oKB.ConstrainRelation("kind-of", :Transitive)
aProof = oKB.Prove([ "margherita", "kind-of", "food" ])
? aProof[:verdict]
#--> TRUE
? aProof[:narration]
#--> proved: margherita kind-of pizza kind-of food
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

4. Duniya fayil ne da za ka iya karantawa

Tana gudana a kwamfuta tare da Softanza↗ 4/5
? oKB.ExportToKnow()
#--> knowledge "menu"
#--> margherita | is-a | dish
#--> margherita | contains | tomato
#--> kind-of | transitive
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

5. Duniyar da wannan darasin yake gudana a kai

Babukan wannan darasin suna tunani a kan fayil na duniya. Ga shi, an tambaye shi. Abin da yake bugawa ya dogara da duniyar, saboda haka gudanar da shi.

Tana gudana a kwamfuta tare da Softanza↗ 5/5
? EduWorldName()
? @@( EduWorld().Query([ "?o", "requested", "?d" ]) )
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

Taƙaitawa

The gap question

S3 · Architect · this chapter belongs to this rung, earned when chapters 1 to 14 and project-s3 have passed: A world you taught, questioned by an agent you govern. The ladder

Proof · 6 cells ran, 10 promises kept, in each of the four editions · the proof of this chapter

Elementary Introduction · Chapter 13 · Skills KN-03 "What has Softanza asked me, and why?" and KN-04 "What does the library call the thing I mean?"

A vague request gets a guess from most systems. Softanza asks instead. You declare what a complete world must contain, and the gap between that goal and the world becomes the next question, with its reason. This chapter also turns the same idea on the library itself: you ask it what it calls the thing you mean.

1. Declare a goal

Every dish must say what it contains. Two dishes, nothing recorded: two gaps.

Runs on the desktop with SoftanzaProof of this cell
oRest = new stzKnowledgeGraph("restaurant")
oRest.Know("margherita", "dish").Know("tiramisu", "dish")
oRest.AddConversationQ("setup").SetGoal(StzGoalQ().RequireEach("dish", "contains"))
? len( oRest.GapsIn("setup") )
#--> 2
This page stores no output. Run the cell to see what it prints.

2. Softanza asks, and says why

Runs on the desktop with SoftanzaProof of this cell
aQ = oRest.AskInXT("setup")
? aQ[:question]
#--> What does 'margherita' have for 'contains'?  (why: every dish needs 'contains')
This page stores no output. Run the cell to see what it prints.

3. You answer in words, and the world grows

Runs on the desktop with SoftanzaProof of this cell
aV = oRest.ReplyIn("setup", "tomato and mozzarella")
? @@( aV[:admitted] )
#--> [ "tomato", "mozzarella" ]
? @@( oRest.Query([ "margherita", "contains", "?o" ]) )
#--> [ "tomato", "mozzarella" ]
? len( oRest.GapsIn("setup") )
#--> 1
This page stores no output. Run the cell to see what it prints.

4. The next question offers what it already knows

Runs on the desktop with SoftanzaProof of this cell
aQ2 = oRest.AskInXT("setup")
? aQ2[:question]
#--> Which 'contains' does 'tiramisu' have? (1) tomato  (2) mozzarella -- or answer freely.  (why: every dish needs 'contains')
This page stores no output. Run the cell to see what it prints.

5. Ask the library what it calls the thing you mean

The library describes itself. HowTo turns an intent into a call, and says how it got there.

Runs on the desktop with SoftanzaProof of this cell
oDoc = StzSelfDocQ("stzList")
? oDoc.HowTo("remove duplicates")
#--> Q([...]).RemoveDuplicates()   -- composed by grammar (remove duplicates)
? oDoc.HasMethod("DuplicatesRemoved")
#--> TRUE
This page stores no output. Run the cell to see what it prints.

6. Explain a method, and refuse an unknown one

Runs on the desktop with SoftanzaProof of this cell
? StzLeft( oDoc.ExplainMethod("DuplicatesRemoved"), 20 )
#--> DuplicatesRemoved --
? oDoc.ExplainMethod("NoSuchThing")
#--> No method 'NoSuchThing' in stzList.
This page stores no output. Run the cell to see what it prints.

Recap

Traduction provisoire : pas encore relue par un locuteur natif.

La question du manque

S3 · Architecte · ce chapitre appartient à ce barreau, gagné quand les chapitres 1 à 14 et project-s3 sont réussis : Un monde que vous avez enseigné, interrogé par un agent que vous gouvernez. L'échelle

Preuve · 6 cellules exécutées, 10 promesses tenues, dans chacune des quatre éditions · la preuve de ce chapitre

Introduction élémentaire · Chapitre 13 · Compétences KN-03 « Que m'a demandé Softanza, et pourquoi ? » et KN-04 « Comment la bibliothèque appelle-t-elle ce que je veux dire ? »

Traduction provisoire, en attente de relecture par un locuteur natif.

Une demande vague reçoit une supposition de la plupart des systèmes. Softanza, elle, demande. Vous déclarez ce qu'un monde complet doit contenir, et l'écart entre cet objectif et le monde devient la question suivante, avec sa raison. Ce chapitre retourne aussi la même idée vers la bibliothèque elle-même : vous lui demandez comment elle appelle ce que vous voulez dire.

1. Déclarer un objectif

Chaque plat doit dire ce qu'il contient. Deux plats, rien d'enregistré : deux manques.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oRest = new stzKnowledgeGraph("restaurant")
oRest.Know("margherita", "dish").Know("tiramisu", "dish")
oRest.AddConversationQ("setup").SetGoal(StzGoalQ().RequireEach("dish", "contains"))
? len( oRest.GapsIn("setup") )
#--> 2
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

2. Softanza demande, et dit pourquoi

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
aQ = oRest.AskInXT("setup")
? aQ[:question]
#--> What does 'margherita' have for 'contains'?  (why: every dish needs 'contains')
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

3. Vous répondez avec des mots, et le monde grandit

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
aV = oRest.ReplyIn("setup", "tomato and mozzarella")
? @@( aV[:admitted] )
#--> [ "tomato", "mozzarella" ]
? @@( oRest.Query([ "margherita", "contains", "?o" ]) )
#--> [ "tomato", "mozzarella" ]
? len( oRest.GapsIn("setup") )
#--> 1
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

4. La question suivante propose ce qu'elle sait déjà

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
aQ2 = oRest.AskInXT("setup")
? aQ2[:question]
#--> Which 'contains' does 'tiramisu' have? (1) tomato  (2) mozzarella -- or answer freely.  (why: every dish needs 'contains')
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

5. Demander à la bibliothèque comment elle appelle ce que vous voulez dire

La bibliothèque se décrit elle-même. HowTo transforme une intention en appel, et dit comment elle y est arrivée.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oDoc = StzSelfDocQ("stzList")
? oDoc.HowTo("remove duplicates")
#--> Q([...]).RemoveDuplicates()   -- composed by grammar (remove duplicates)
? oDoc.HasMethod("DuplicatesRemoved")
#--> TRUE
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

6. Expliquer une méthode, et refuser une méthode inconnue

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? StzLeft( oDoc.ExplainMethod("DuplicatesRemoved"), 20 )
#--> DuplicatesRemoved --
? oDoc.ExplainMethod("NoSuchThing")
#--> No method 'NoSuchThing' in stzList.
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

Récapitulatif

ترجمة أولية: لم يراجعها بعدُ ناطق أصلي بالعربية.

سؤال الفجوة

S3 · 1 – 14 · project-s3 · عالم علّمته، يسأله وكيل تحكمه أنت. S0 – S4

course_narrated · 6/6 · ↗

مدخل أساسي · الفصل 13 · المهارتان KN-03 «ماذا سألتني سوفتانزا، ولماذا؟» وKN-04 «بماذا تسمّي المكتبة الشيء الذي أقصده؟»

ترجمة أولية، في انتظار مراجعة متحدث أصلي.

الطلب الغامض يلقى تخمينًا من معظم الأنظمة. أما سوفتانزا فتسأل. أنت تعلن ما يجب أن يحتويه عالم مكتمل، فتصير الفجوة بين ذلك الهدف والعالم هي السؤال التالي، مع سببه. ويوجّه هذا الفصل الفكرة نفسها إلى المكتبة ذاتها: تسألها بماذا تسمّي الشيء الذي تقصده.

1. أعلن هدفًا

على كل طبق أن يقول ما يحتويه. طبقان، ولا شيء مسجّل: فجوتان.

تعمل على الحاسوب مع سوفتانزا↗ 1/6
oRest = new stzKnowledgeGraph("restaurant")
oRest.Know("margherita", "dish").Know("tiramisu", "dish")
oRest.AddConversationQ("setup").SetGoal(StzGoalQ().RequireEach("dish", "contains"))
? len( oRest.GapsIn("setup") )
#--> 2
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

2. تسأل سوفتانزا، وتقول لماذا

تعمل على الحاسوب مع سوفتانزا↗ 2/6
aQ = oRest.AskInXT("setup")
? aQ[:question]
#--> What does 'margherita' have for 'contains'?  (why: every dish needs 'contains')
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

3. تجيب بالكلمات، فينمو العالم

تعمل على الحاسوب مع سوفتانزا↗ 3/6
aV = oRest.ReplyIn("setup", "tomato and mozzarella")
? @@( aV[:admitted] )
#--> [ "tomato", "mozzarella" ]
? @@( oRest.Query([ "margherita", "contains", "?o" ]) )
#--> [ "tomato", "mozzarella" ]
? len( oRest.GapsIn("setup") )
#--> 1
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

4. السؤال التالي يعرض ما يعرفه من قبلُ

تعمل على الحاسوب مع سوفتانزا↗ 4/6
aQ2 = oRest.AskInXT("setup")
? aQ2[:question]
#--> Which 'contains' does 'tiramisu' have? (1) tomato  (2) mozzarella -- or answer freely.  (why: every dish needs 'contains')
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

5. اسأل المكتبة بماذا تسمّي ما تقصده

المكتبة تصف نفسها. HowTo تحوّل القصد إلى نداء، وتقول كيف وصلت إليه.

تعمل على الحاسوب مع سوفتانزا↗ 5/6
oDoc = StzSelfDocQ("stzList")
? oDoc.HowTo("remove duplicates")
#--> Q([...]).RemoveDuplicates()   -- composed by grammar (remove duplicates)
? oDoc.HasMethod("DuplicatesRemoved")
#--> TRUE
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

6. اشرح دالة، وارفض دالة مجهولة

تعمل على الحاسوب مع سوفتانزا↗ 6/6
? StzLeft( oDoc.ExplainMethod("DuplicatesRemoved"), 20 )
#--> DuplicatesRemoved --
? oDoc.ExplainMethod("NoSuchThing")
#--> No method 'NoSuchThing' in stzList.
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

الخلاصة

Fassara ta farko: wani ɗan asalin harshen Hausa bai riga ya duba ta ba tukuna.

Tambayar giɓi

S3 · 1 – 14 · project-s3 · Duniyar da ka koyar, wanda wakilin da kake mulka yake tambaya. S0 – S4

course_narrated · 6/6 · ↗

Gabatarwa ta Farko · Babi na 13 · Fasahohi KN-03 "Me Softanza ta tambaye ni, kuma me ya sa?" da KN-04 "Me ɗakin karatu ke kiran abin da nake nufi?"

Fassarar farko ce, tana jiran bita daga mai magana da Hausa a matsayin harshen uwa.

Buƙata mara tsari tana samun zato daga yawancin tsare-tsare. Softanza tana tambaya maimakon haka. Ka bayyana abin da cikakkiyar duniya dole ta ƙunsa, kuma giɓin da ke tsakanin wannan manufar da duniyar yana zama tambaya ta gaba, da dalilinta. Wannan babin kuma yana juya wannan tunanin ga ɗakin karatu da kansa: ka tambaye shi abin da yake kiran abin da kake nufi.

1. Bayyana manufa

Kowane abinci dole ne ya faɗi abin da yake ɗauke da shi. Abinci biyu, babu abin da aka rubuta: giɓi biyu.

Tana gudana a kwamfuta tare da Softanza↗ 1/6
oRest = new stzKnowledgeGraph("restaurant")
oRest.Know("margherita", "dish").Know("tiramisu", "dish")
oRest.AddConversationQ("setup").SetGoal(StzGoalQ().RequireEach("dish", "contains"))
? len( oRest.GapsIn("setup") )
#--> 2
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

2. Softanza tana tambaya, ta faɗi dalili

Tana gudana a kwamfuta tare da Softanza↗ 2/6
aQ = oRest.AskInXT("setup")
? aQ[:question]
#--> What does 'margherita' have for 'contains'?  (why: every dish needs 'contains')
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

3. Ka amsa da kalmomi, duniyar ta girma

Tana gudana a kwamfuta tare da Softanza↗ 3/6
aV = oRest.ReplyIn("setup", "tomato and mozzarella")
? @@( aV[:admitted] )
#--> [ "tomato", "mozzarella" ]
? @@( oRest.Query([ "margherita", "contains", "?o" ]) )
#--> [ "tomato", "mozzarella" ]
? len( oRest.GapsIn("setup") )
#--> 1
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

4. Tambaya ta gaba tana ba da abin da ta riga ta sani

Tana gudana a kwamfuta tare da Softanza↗ 4/6
aQ2 = oRest.AskInXT("setup")
? aQ2[:question]
#--> Which 'contains' does 'tiramisu' have? (1) tomato  (2) mozzarella -- or answer freely.  (why: every dish needs 'contains')
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

5. Tambayi ɗakin karatu abin da yake kiran abin da kake nufi

Ɗakin karatu yana kwatanta kansa. HowTo yana mai da nufi kira, ya faɗi yadda ya kai ga hakan.

Tana gudana a kwamfuta tare da Softanza↗ 5/6
oDoc = StzSelfDocQ("stzList")
? oDoc.HowTo("remove duplicates")
#--> Q([...]).RemoveDuplicates()   -- composed by grammar (remove duplicates)
? oDoc.HasMethod("DuplicatesRemoved")
#--> TRUE
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

6. Bayyana hanya, ka ƙi wadda ba a sani ba

Tana gudana a kwamfuta tare da Softanza↗ 6/6
? StzLeft( oDoc.ExplainMethod("DuplicatesRemoved"), 20 )
#--> DuplicatesRemoved --
? oDoc.ExplainMethod("NoSuchThing")
#--> No method 'NoSuchThing' in stzList.
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

Taƙaitawa

An agent that cannot hurt

S3 · Architect · this chapter belongs to this rung, earned when chapters 1 to 14 and project-s3 have passed: A world you taught, questioned by an agent you govern. The ladder

Proof · 7 cells ran, 14 promises kept, in each of the four editions · the proof of this chapter

Elementary Introduction · Chapter 14 · Skills GO-01 "What does my agent cover, and what can be undone?", GO-02 "Who is allowed to make this real?" and GO-03 "What would it have done?"

An agent is a program that acts on its own. Softanza lets you build one safely, because the safety is not in the agent: it is in the world around it. A court judges the declaration, a gate stands between every proposal and every effect, and a rehearsal room takes the action before reality does.

1. Declare an agent, and let the court judge it

An agent is a text file. It must say what it covers and what class of act it takes, or it is never scheduled.

Runs on the desktop with SoftanzaProof of this cell
cPia = "pia: 1
name: stock-watcher
kind: pi
coverage: checks the kitchen stock every morning and notes what is low
reversibility: reversible
schedule:
  timer: 20
memory:
  - stock level unknown
skills:
  - name: check-stock
    when: always
    does: learn stock level checked
    verify: fact stock level checked
"
oDecl = StzAgentDeclarationQ(cPia)
? oDecl.IsValid()
#--> TRUE
? oDecl.ReversibilityClass()
#--> reversible
This page stores no output. Run the cell to see what it prints.

2. The court refuses what says nothing of its reach

Runs on the desktop with SoftanzaProof of this cell
oBad = StzAgentDeclarationQ( StzReplace(cPia, "coverage: checks the kitchen stock every morning and notes what is low" + char(10), "") )
? oBad.IsValid()
#--> FALSE
? StzLeft( oBad.CiteFindings(), 25 )
#--> [pia-coverage @ coverage]
This page stores no output. Run the cell to see what it prints.

3. Propose, never commit: the shape of a safe system

A language model may propose. Wire it straight to an effect, and the graph of the system is unsound; the violation says why.

Runs on the desktop with SoftanzaProof of this cell
oGBad = new stzAgentGraph("mailer-bad")
oGBad.AddLLMActor("writer")
oGBad.AddEffect("send")
oGBad.Proposes("writer", "send")
? oGBad.IsSound()
#--> FALSE
? oGBad.Violations()[1][:message]
#--> effect 'send' has no guardian edge into it -- every effect passes a pi-gate
This page stores no output. Run the cell to see what it prints.

4. The governed shape

A gate between the proposal and the effect, and a trace after it.

Runs on the desktop with SoftanzaProof of this cell
oGOk = new stzAgentGraph("mailer")
oGOk.AddLLMActor("writer")
oGOk.AddGuardian("gate")
oGOk.AddEffect("send")
oGOk.AddTraceSink("audit")
oGOk.Proposes("writer", "gate")
oGOk.Guards("gate", "send")
oGOk.Feeds("gate", "send")
oGOk.Traces("send", "audit")
? oGOk.IsSound()
#--> TRUE
This page stores no output. Run the cell to see what it prints.

5. Rehearse in a safe world

Give the agent a workbench, and everything it writes lands there. The disk does not move; the only thing that comes out is a plan.

Runs on the desktop with SoftanzaProof of this cell
oAg = oDecl.ToAgent()
oAg.GiveWorkbench()
cHere = StzReplace(currentdir(), char(92), "/")
cNote = cHere + "/t_edu_note_" + ProcessId() + ".txt"
oAg.WorkbenchQ().WriteFile(cNote, "stock is low")
? fexists(cNote)
#--> FALSE
? oAg.WorkbenchQ().ContentOf(cNote)
#--> stock is low
oPlan = oAg.GenerateUpdatePlan()
? oPlan.NumberOfOperations()
#--> 1
This page stores no output. Run the cell to see what it prints.

6. An AI cannot commit the plan

Runs on the desktop with SoftanzaProof of this cell
oPlan.SetExecutor( LLMActor("helper") )
aMay = oPlan.MayCommit()
? aMay[1]
#--> FALSE
? aMay[2]
#--> actor 'helper' cannot commit -- it lacks the 'effectful' capability (required by operation 1)
This page stores no output. Run the cell to see what it prints.

7. Only a committing actor, inside its scope, changes reality

The proposer is creative. The committer is deterministic, holds the capability, and may touch one folder and nothing else. Now, and only now, the file exists.

Runs on the desktop with SoftanzaProof of this cell
oPlan2 = oAg.GenerateUpdatePlan()
oPlan2.SetExecutor( PIActor("committer") )
oScope = new stzCommitScope()
oScope.AllowUnder(cHere)
oPlan2.SetScope(oScope)
aRes = oPlan2.Execute()
? aRes[1][2]
#--> TRUE
? fexists(cNote)
#--> TRUE
remove(cNote)
This page stores no output. Run the cell to see what it prints.

Recap

Traduction provisoire : pas encore relue par un locuteur natif.

Un agent qui ne peut pas nuire

S3 · Architecte · ce chapitre appartient à ce barreau, gagné quand les chapitres 1 à 14 et project-s3 sont réussis : Un monde que vous avez enseigné, interrogé par un agent que vous gouvernez. L'échelle

Preuve · 7 cellules exécutées, 14 promesses tenues, dans chacune des quatre éditions · la preuve de ce chapitre

Introduction élémentaire · Chapitre 14 · Compétences GO-01 « Que couvre mon agent, et que peut-on annuler ? », GO-02 « Qui a le droit de rendre cela réel ? » et GO-03 « Qu'aurait-il fait ? »

Traduction provisoire, en attente de relecture par un locuteur natif.

Un agent est un programme qui agit de lui-même. Softanza vous laisse en construire un sans danger, parce que la sécurité n'est pas dans l'agent : elle est dans le monde qui l'entoure. Une cour juge la déclaration, une porte se dresse entre chaque proposition et chaque effet, et une salle de répétition reçoit l'action avant la réalité.

1. Déclarer un agent, et laisser la cour le juger

Un agent est un fichier texte. Il doit dire ce qu'il couvre et quelle classe d'actes il accomplit, sinon il n'est jamais planifié.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
cPia = "pia: 1
name: stock-watcher
kind: pi
coverage: checks the kitchen stock every morning and notes what is low
reversibility: reversible
schedule:
  timer: 20
memory:
  - stock level unknown
skills:
  - name: check-stock
    when: always
    does: learn stock level checked
    verify: fact stock level checked
"
oDecl = StzAgentDeclarationQ(cPia)
? oDecl.IsValid()
#--> TRUE
? oDecl.ReversibilityClass()
#--> reversible
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

2. La cour refuse ce qui ne dit rien de sa portée

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oBad = StzAgentDeclarationQ( StzReplace(cPia, "coverage: checks the kitchen stock every morning and notes what is low" + char(10), "") )
? oBad.IsValid()
#--> FALSE
? StzLeft( oBad.CiteFindings(), 25 )
#--> [pia-coverage @ coverage]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

3. Proposer, jamais valider : la forme d'un système sûr

Un modèle de langage peut proposer. Reliez-le directement à un effet, et le graphe du système n'est pas sain ; la violation dit pourquoi.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oGBad = new stzAgentGraph("mailer-bad")
oGBad.AddLLMActor("writer")
oGBad.AddEffect("send")
oGBad.Proposes("writer", "send")
? oGBad.IsSound()
#--> FALSE
? oGBad.Violations()[1][:message]
#--> effect 'send' has no guardian edge into it -- every effect passes a pi-gate
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

4. La forme gouvernée

Une porte entre la proposition et l'effet, et une trace après lui.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oGOk = new stzAgentGraph("mailer")
oGOk.AddLLMActor("writer")
oGOk.AddGuardian("gate")
oGOk.AddEffect("send")
oGOk.AddTraceSink("audit")
oGOk.Proposes("writer", "gate")
oGOk.Guards("gate", "send")
oGOk.Feeds("gate", "send")
oGOk.Traces("send", "audit")
? oGOk.IsSound()
#--> TRUE
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

5. Répéter dans un monde sûr

Donnez un atelier à l'agent, et tout ce qu'il écrit y atterrit. Le disque ne bouge pas ; la seule chose qui en sort est un plan.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oAg = oDecl.ToAgent()
oAg.GiveWorkbench()
cHere = StzReplace(currentdir(), char(92), "/")
cNote = cHere + "/t_edu_note_" + ProcessId() + ".txt"
oAg.WorkbenchQ().WriteFile(cNote, "stock is low")
? fexists(cNote)
#--> FALSE
? oAg.WorkbenchQ().ContentOf(cNote)
#--> stock is low
oPlan = oAg.GenerateUpdatePlan()
? oPlan.NumberOfOperations()
#--> 1
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

6. Une IA ne peut pas valider le plan

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oPlan.SetExecutor( LLMActor("helper") )
aMay = oPlan.MayCommit()
? aMay[1]
#--> FALSE
? aMay[2]
#--> actor 'helper' cannot commit -- it lacks the 'effectful' capability (required by operation 1)
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

7. Seul un acteur de validation, dans sa portée, change la réalité

Le proposant est créatif. Le validateur est déterministe, détient la capacité, et peut toucher un dossier et rien d'autre. Maintenant, et seulement maintenant, le fichier existe.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
oPlan2 = oAg.GenerateUpdatePlan()
oPlan2.SetExecutor( PIActor("committer") )
oScope = new stzCommitScope()
oScope.AllowUnder(cHere)
oPlan2.SetScope(oScope)
aRes = oPlan2.Execute()
? aRes[1][2]
#--> TRUE
? fexists(cNote)
#--> TRUE
remove(cNote)
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

Récapitulatif

ترجمة أولية: لم يراجعها بعدُ ناطق أصلي بالعربية.

وكيل لا يستطيع أن يؤذي

S3 · 1 – 14 · project-s3 · عالم علّمته، يسأله وكيل تحكمه أنت. S0 – S4

course_narrated · 7/7 · ↗

مدخل أساسي · الفصل 14 · المهارات GO-01 «ماذا يغطي وكيلي، وما الذي يمكن التراجع عنه؟» وGO-02 «من المسموح له أن يجعل هذا حقيقيًا؟» وGO-03 «ماذا كان سيفعل؟»

ترجمة أولية، في انتظار مراجعة متحدث أصلي.

الوكيل برنامج يتصرّف من تلقاء نفسه. تتيح لك سوفتانزا أن تبني واحدًا بأمان، لأن الأمان ليس في الوكيل: بل في العالم من حوله. محكمة تحكم على التصريح، وبوابة تقف بين كل اقتراح وكل أثر، وغرفة تدريب تتلقى الفعل قبل الواقع.

1. صرّح بوكيل، ودع المحكمة تحكم عليه

الوكيل ملف نصي. عليه أن يقول ما يغطيه وأيّ صنف من الأفعال يقوم به، وإلا فلن يُجدول أبدًا.

تعمل على الحاسوب مع سوفتانزا↗ 1/7
cPia = "pia: 1
name: stock-watcher
kind: pi
coverage: checks the kitchen stock every morning and notes what is low
reversibility: reversible
schedule:
  timer: 20
memory:
  - stock level unknown
skills:
  - name: check-stock
    when: always
    does: learn stock level checked
    verify: fact stock level checked
"
oDecl = StzAgentDeclarationQ(cPia)
? oDecl.IsValid()
#--> TRUE
? oDecl.ReversibilityClass()
#--> reversible
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

2. ترفض المحكمة ما لا يقول شيئًا عن مداه

تعمل على الحاسوب مع سوفتانزا↗ 2/7
oBad = StzAgentDeclarationQ( StzReplace(cPia, "coverage: checks the kitchen stock every morning and notes what is low" + char(10), "") )
? oBad.IsValid()
#--> FALSE
? StzLeft( oBad.CiteFindings(), 25 )
#--> [pia-coverage @ coverage]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

3. اقترح ولا تنفّذ: شكل النظام الآمن

يجوز لنموذج لغوي أن يقترح. صِله مباشرة بأثر، فيصير رسم النظام غير سليم؛ والمخالفة تقول لماذا.

تعمل على الحاسوب مع سوفتانزا↗ 3/7
oGBad = new stzAgentGraph("mailer-bad")
oGBad.AddLLMActor("writer")
oGBad.AddEffect("send")
oGBad.Proposes("writer", "send")
? oGBad.IsSound()
#--> FALSE
? oGBad.Violations()[1][:message]
#--> effect 'send' has no guardian edge into it -- every effect passes a pi-gate
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

4. الشكل المحكوم

بوابة بين الاقتراح والأثر، وأثر متتبَّع بعده.

تعمل على الحاسوب مع سوفتانزا↗ 4/7
oGOk = new stzAgentGraph("mailer")
oGOk.AddLLMActor("writer")
oGOk.AddGuardian("gate")
oGOk.AddEffect("send")
oGOk.AddTraceSink("audit")
oGOk.Proposes("writer", "gate")
oGOk.Guards("gate", "send")
oGOk.Feeds("gate", "send")
oGOk.Traces("send", "audit")
? oGOk.IsSound()
#--> TRUE
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

5. تدرّب في عالم آمن

أعطِ الوكيل ورشة، فيحطّ كل ما يكتبه فيها. القرص لا يتحرك؛ والشيء الوحيد الذي يخرج هو خطة.

تعمل على الحاسوب مع سوفتانزا↗ 5/7
oAg = oDecl.ToAgent()
oAg.GiveWorkbench()
cHere = StzReplace(currentdir(), char(92), "/")
cNote = cHere + "/t_edu_note_" + ProcessId() + ".txt"
oAg.WorkbenchQ().WriteFile(cNote, "stock is low")
? fexists(cNote)
#--> FALSE
? oAg.WorkbenchQ().ContentOf(cNote)
#--> stock is low
oPlan = oAg.GenerateUpdatePlan()
? oPlan.NumberOfOperations()
#--> 1
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

6. لا يستطيع ذكاء اصطناعي أن ينفّذ الخطة

تعمل على الحاسوب مع سوفتانزا↗ 6/7
oPlan.SetExecutor( LLMActor("helper") )
aMay = oPlan.MayCommit()
? aMay[1]
#--> FALSE
? aMay[2]
#--> actor 'helper' cannot commit -- it lacks the 'effectful' capability (required by operation 1)
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

7. لا يغيّر الواقع إلا ممثل تنفيذ، داخل نطاقه

المقترح مبدع. والمنفّذ حتمي، يملك الصلاحية، ويجوز له أن يمسّ مجلدًا واحدًا لا غير. الآن، والآن فقط، يوجد الملف.

تعمل على الحاسوب مع سوفتانزا↗ 7/7
oPlan2 = oAg.GenerateUpdatePlan()
oPlan2.SetExecutor( PIActor("committer") )
oScope = new stzCommitScope()
oScope.AllowUnder(cHere)
oPlan2.SetScope(oScope)
aRes = oPlan2.Execute()
? aRes[1][2]
#--> TRUE
? fexists(cNote)
#--> TRUE
remove(cNote)
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

الخلاصة

Fassara ta farko: wani ɗan asalin harshen Hausa bai riga ya duba ta ba tukuna.

Wakilin da ba zai iya cutarwa ba

S3 · 1 – 14 · project-s3 · Duniyar da ka koyar, wanda wakilin da kake mulka yake tambaya. S0 – S4

course_narrated · 7/7 · ↗

Gabatarwa ta Farko · Babi na 14 · Fasahohi GO-01 "Me wakilina ya shafa, kuma me za a iya juyawa?", GO-02 "Wa aka yarda ya sa wannan ya zama gaskiya?" da GO-03 "Me da ya yi?"

Fassarar farko ce, tana jiran bita daga mai magana da Hausa a matsayin harshen uwa.

Wakili shiri ne da yake aiki da kansa. Softanza tana barinka ka gina ɗaya lafiya, domin amincin ba a cikin wakilin yake ba: yana cikin duniyar da ke kewaye da shi. Kotu tana hukunta bayanin, ƙofa tana tsaye tsakanin kowace shawara da kowane tasiri, kuma ɗakin gwaji yana ɗaukar aikin kafin gaskiya.

1. Bayyana wakili, ka bar kotu ta hukunta shi

Wakili fayil na rubutu ne. Dole ne ya faɗi abin da ya shafa da irin aikin da yake yi, in ba haka ba ba za a taɓa tsara shi ba.

Tana gudana a kwamfuta tare da Softanza↗ 1/7
cPia = "pia: 1
name: stock-watcher
kind: pi
coverage: checks the kitchen stock every morning and notes what is low
reversibility: reversible
schedule:
  timer: 20
memory:
  - stock level unknown
skills:
  - name: check-stock
    when: always
    does: learn stock level checked
    verify: fact stock level checked
"
oDecl = StzAgentDeclarationQ(cPia)
? oDecl.IsValid()
#--> TRUE
? oDecl.ReversibilityClass()
#--> reversible
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

2. Kotu tana ƙin abin da bai faɗi komai game da iyakarsa ba

Tana gudana a kwamfuta tare da Softanza↗ 2/7
oBad = StzAgentDeclarationQ( StzReplace(cPia, "coverage: checks the kitchen stock every morning and notes what is low" + char(10), "") )
? oBad.IsValid()
#--> FALSE
? StzLeft( oBad.CiteFindings(), 25 )
#--> [pia-coverage @ coverage]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

3. Ba da shawara, kada ka aiwatar: siffar tsari mai aminci

Samfurin harshe na iya ba da shawara. Haɗa shi kai tsaye da tasiri, kuma zanen tsarin ba shi da inganci; keta ta faɗi dalili.

Tana gudana a kwamfuta tare da Softanza↗ 3/7
oGBad = new stzAgentGraph("mailer-bad")
oGBad.AddLLMActor("writer")
oGBad.AddEffect("send")
oGBad.Proposes("writer", "send")
? oGBad.IsSound()
#--> FALSE
? oGBad.Violations()[1][:message]
#--> effect 'send' has no guardian edge into it -- every effect passes a pi-gate
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

4. Siffar da ake mulka

Ƙofa tsakanin shawarar da tasirin, da bin sawu bayansa.

Tana gudana a kwamfuta tare da Softanza↗ 4/7
oGOk = new stzAgentGraph("mailer")
oGOk.AddLLMActor("writer")
oGOk.AddGuardian("gate")
oGOk.AddEffect("send")
oGOk.AddTraceSink("audit")
oGOk.Proposes("writer", "gate")
oGOk.Guards("gate", "send")
oGOk.Feeds("gate", "send")
oGOk.Traces("send", "audit")
? oGOk.IsSound()
#--> TRUE
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

5. Yi gwaji a duniya mai aminci

Ba wa wakilin wurin aiki, kuma duk abin da ya rubuta yana sauka a can. Faifan ba ya motsawa; abin da ke fitowa kawai tsari ne.

Tana gudana a kwamfuta tare da Softanza↗ 5/7
oAg = oDecl.ToAgent()
oAg.GiveWorkbench()
cHere = StzReplace(currentdir(), char(92), "/")
cNote = cHere + "/t_edu_note_" + ProcessId() + ".txt"
oAg.WorkbenchQ().WriteFile(cNote, "stock is low")
? fexists(cNote)
#--> FALSE
? oAg.WorkbenchQ().ContentOf(cNote)
#--> stock is low
oPlan = oAg.GenerateUpdatePlan()
? oPlan.NumberOfOperations()
#--> 1
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

6. AI ba za ta iya aiwatar da tsarin ba

Tana gudana a kwamfuta tare da Softanza↗ 6/7
oPlan.SetExecutor( LLMActor("helper") )
aMay = oPlan.MayCommit()
? aMay[1]
#--> FALSE
? aMay[2]
#--> actor 'helper' cannot commit -- it lacks the 'effectful' capability (required by operation 1)
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

7. Mai aiwatarwa kaɗai, a cikin iyakarsa, yake canza gaskiya

Mai ba da shawara mai ƙirƙira ne. Mai aiwatarwa tabbatacce ne, yana riƙe da iko, kuma zai iya taɓa babban fayil ɗaya kawai. Yanzu, kuma yanzu kawai, fayil ɗin yana nan.

Tana gudana a kwamfuta tare da Softanza↗ 7/7
oPlan2 = oAg.GenerateUpdatePlan()
oPlan2.SetExecutor( PIActor("committer") )
oScope = new stzCommitScope()
oScope.AllowUnder(cHere)
oPlan2.SetScope(oScope)
aRes = oPlan2.Execute()
? aRes[1][2]
#--> TRUE
? fexists(cNote)
#--> TRUE
remove(cNote)
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

Taƙaitawa

Write a narration

S4 · Master · this chapter belongs to this rung, earned when chapters 1 to 15 and project-s4 have passed: A new chapter for this course, in two languages, whose guard is green. The ladder

Proof · 4 cells ran, 8 promises kept, in each of the four editions · the proof of this chapter

Elementary Introduction · Chapter 15 · Skills CR-01 "Does every example in my document still run?", CR-02 "What would break if I were wrong?" and CR-03 "Why did it say no?"

Every chapter you have read was checked by running it, cell by cell, before it reached you. This last chapter hands you the same instruments: a narration whose every cell runs, a guard with a positive and a negative case, and a verdict that explains itself.

1. A narration is a text file with promises

A cell promises what it prints. The chapter runner runs every cell in a fresh process and compares.

Runs on the desktop with SoftanzaProof of this cell
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
This page stores no output. Run the cell to see what it prints.

2. A broken promise is caught, not hidden

The same document with a wrong promise. The document does not become right by being written.

Runs on the desktop with SoftanzaProof of this cell
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
This page stores no output. Run the cell to see what it prints.

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

A check that can only pass proves nothing. The guard below would be red if the runner ever accepted the broken document, and red if it ever refused the good one.

Runs on the desktop with SoftanzaProof of this cell
? oCh.AllPromisesKept() = 1 and oCh2.AllPromisesKept() = 0
#--> TRUE
remove(cMini)
remove(cMini2)
This page stores no output. Run the cell to see what it prints.

4. A verdict explains itself

The exercise checker of this course is one object. Hand it a promise and a program, and it says what happened in the learner's own terms, never the expected value.

Runs on the desktop with SoftanzaProof of this cell
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.
This page stores no output. Run the cell to see what it prints.

Recap

Traduction provisoire : pas encore relue par un locuteur natif.

Écrire une narration

S4 · Maître · ce chapitre appartient à ce barreau, gagné quand les chapitres 1 à 15 et project-s4 sont réussis : Un nouveau chapitre pour ce cours, en deux langues, dont la garde est verte. L'échelle

Preuve · 4 cellules exécutées, 8 promesses tenues, dans chacune des quatre éditions · la preuve de ce chapitre

Introduction élémentaire · Chapitre 15 · Compétences CR-01 « Chaque exemple de mon document tourne-t-il encore ? », CR-02 « Qu'est-ce qui casserait si je me trompais ? » et CR-03 « Pourquoi a-t-il dit non ? »

Traduction provisoire, en attente de relecture par un locuteur natif.

Chaque chapitre que vous avez lu a été vérifié en l'exécutant, cellule par cellule, avant de vous parvenir. Ce dernier chapitre vous remet les mêmes instruments : une narration dont chaque cellule s'exécute, une garde avec un cas positif et un cas négatif, et un verdict qui s'explique lui-même.

1. Une narration est un fichier texte avec des promesses

Une cellule promet ce qu'elle affiche. Le lanceur de chapitres exécute chaque cellule dans un processus neuf et compare.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
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
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

2. Une promesse rompue est attrapée, pas cachée

Le même document avec une promesse fausse. Le document ne devient pas juste parce qu'il est écrit.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
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
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

3. Une garde a un cas positif et un cas négatif

Une vérification qui ne peut que réussir ne prouve rien. La garde ci-dessous serait rouge si le lanceur acceptait un jour le document cassé, et rouge s'il refusait un jour le bon.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
? oCh.AllPromisesKept() = 1 and oCh2.AllPromisesKept() = 0
#--> TRUE
remove(cMini)
remove(cMini2)
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

4. Un verdict s'explique lui-même

Le vérificateur d'exercices de ce cours est un seul objet. Donnez-lui une promesse et un programme, et il dit ce qui s'est passé dans les termes de l'apprenant, jamais la valeur attendue.

S'exécute sur l'ordinateur avec SoftanzaPreuve de cette cellule
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.
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

Récapitulatif

ترجمة أولية: لم يراجعها بعدُ ناطق أصلي بالعربية.

اكتب سردًا

S4 · 1 – 15 · project-s4 · فصل جديد لهذا الدرس، بلغتين، حارسه أخضر. S0 – S4

course_narrated · 4/4 · ↗

مدخل أساسي · الفصل 15 · المهارات CR-01 «هل ما زال كل مثال في وثيقتي يعمل؟» وCR-02 «ماذا سينكسر لو كنت مخطئًا؟» وCR-03 «لماذا قال لا؟»

ترجمة أولية، في انتظار مراجعة متحدث أصلي.

كل فصل قرأته فُحص بتشغيله، خليةً خلية، قبل أن يصلك. يسلّمك هذا الفصل الأخير الأدوات نفسها: سردًا تعمل كل خلاياه، وحارسًا بحالة إيجابية وأخرى سلبية، وحكمًا يشرح نفسه.

1. السرد ملف نصي فيه وعود

الخلية تعد بما تطبعه. يشغّل مشغّل الفصول كل خلية في عملية جديدة ويقارن.

تعمل على الحاسوب مع سوفتانزا↗ 1/4
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
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

2. الوعد المكسور يُضبط ولا يُخفى

الوثيقة نفسها بوعد خاطئ. لا تصير الوثيقة صحيحة بمجرد كتابتها.

تعمل على الحاسوب مع سوفتانزا↗ 2/4
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
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

3. للحارس حالة إيجابية وحالة سلبية

الفحص الذي لا يستطيع إلا النجاح لا يثبت شيئًا. الحارس أدناه يصير أحمر إن قبل المشغّل يومًا الوثيقة المكسورة، وأحمر إن رفض يومًا الوثيقة الصحيحة.

تعمل على الحاسوب مع سوفتانزا↗ 3/4
? oCh.AllPromisesKept() = 1 and oCh2.AllPromisesKept() = 0
#--> TRUE
remove(cMini)
remove(cMini2)
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

4. الحكم يشرح نفسه

مدقّق تمارين هذا الدرس كائن واحد. أعطه وعدًا وبرنامجًا، فيقول ما حدث بألفاظ المتعلم نفسه، ولا يقول القيمة المنتظرة أبدًا.

تعمل على الحاسوب مع سوفتانزا↗ 4/4
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.
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

الخلاصة

Fassara ta farko: wani ɗan asalin harshen Hausa bai riga ya duba ta ba tukuna.

Rubuta labari

S4 · 1 – 15 · project-s4 · Sabon babi ga wannan darasin, da harsuna biyu, wanda mai tsaronsa kore ne. S0 – S4

course_narrated · 4/4 · ↗

Gabatarwa ta Farko · Babi na 15 · Fasahohi CR-01 "Shin kowane misali a takardata har yanzu yana gudana?", CR-02 "Me zai karye idan na yi kuskure?" da CR-03 "Me ya sa ya ce a'a?"

Fassarar farko ce, tana jiran bita daga mai magana da Hausa a matsayin harshen uwa.

Kowane babi da ka karanta an duba shi ta hanyar gudanar da shi, ɗaki bayan ɗaki, kafin ya kai gare ka. Wannan babin na ƙarshe yana miƙa maka kayan aiki iri ɗaya: labari wanda kowane ɗakinsa yake gudana, mai tsaro mai yanayi mai kyau da mara kyau, da hukunci da yake bayyana kansa.

1. Labari fayil na rubutu ne mai alkawura

Ɗaki yana yin alkawarin abin da yake bugawa. Mai gudanar da babuka yana gudanar da kowane ɗaki a sabon tsari ya kwatanta.

Tana gudana a kwamfuta tare da Softanza↗ 1/4
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
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

2. Alkawarin da aka karya ana kama shi, ba a ɓoye shi

Takarda ɗaya da alkawari mara daidai. Takardar ba ta zama daidai ta hanyar rubuta ta ba.

Tana gudana a kwamfuta tare da Softanza↗ 2/4
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
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

3. Mai tsaro yana da yanayi mai kyau da mara kyau

Dubawar da ba za ta iya faɗuwa ba ba ta tabbatar da komai. Mai tsaron da ke ƙasa zai zama ja idan mai gudanarwa ya taɓa karɓar takardar da ta karye, kuma ja idan ya taɓa ƙin mai kyau.

Tana gudana a kwamfuta tare da Softanza↗ 3/4
? oCh.AllPromisesKept() = 1 and oCh2.AllPromisesKept() = 0
#--> TRUE
remove(cMini)
remove(cMini2)
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

4. Hukunci yana bayyana kansa

Mai duba ayyukan wannan darasin abu ɗaya ne. Ba shi alkawari da shiri, kuma yana faɗin abin da ya faru da kalmomin mai koyo, ba darajar da ake tsammani ba.

Tana gudana a kwamfuta tare da Softanza↗ 4/4
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.
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

Taƙaitawa

The cooperative

A farmers' cooperative on the Tillaberi plain. Its members bring what they grow, and they ask the cooperative for seed, fertiliser, credit and a place to store the harvest. This page is the world itself, questioned: every cell runs over worlds/cooperative.zknw, the plain file the chapters reason over when you choose this world, and the page stores nothing.

1. Its name

The first thing a world says is what it is.

Runs on the desktop with Softanza
? EduWorldName()
#--> tillaberi-cooperative (cooperative)
This page stores no output. Run the cell to see what it prints.

2. What was requested

Seven requests came in this season. Some ask for the same thing, which is why chapter 1 removes the duplicates and chapter 5 counts the most requested.

Runs on the desktop with Softanza
aReq = EduWorldObjects("requested")
? len(aReq)
#--> 7
? @@( aReq )
#--> [ "seed", "fertiliser", "seed", "credit", "storage", "seed", "credit" ]
o1 = new stzList(aReq)
? @@( o1.DuplicatesRemoved() )
#--> [ "seed", "fertiliser", "credit", "storage" ]
? StzListQ(aReq).NumberOfOccurrence("seed")
#--> 3
This page stores no output. Run the cell to see what it prints.

3. Who grows what

The world knows more than requests: which member grows which crop, and where each crop is stored.

Runs on the desktop with Softanza
? @@( EduWorld().Query([ "?who", "grows", "millet" ]) )
#--> [ "amadou", "issa" ]
? @@( EduWorld().Query([ "hadiza", "grows", "?what" ]) )
#--> [ "cowpea" ]
? @@( EduWorld().Query([ "cowpea", "stored-in", "?where" ]) )
#--> [ "granary-2" ]
This page stores no output. Run the cell to see what it prints.

4. A question it cannot answer yet

Who requested the credit? The world does not say who made each request, so the answer is empty, not a guess. Chapter 12 shows how you add the missing fact; chapter 13 shows how Softanza asks you about a gap like this one.

Runs on the desktop with Softanza
? @@( EduWorld().Query([ "hadiza", "requested", "?what" ]) )
#--> [ ]
This page stores no output. Run the cell to see what it prints.

Traduction provisoire : pas encore relue par un locuteur natif.

La coopérative

Une coopérative agricole de la plaine de Tillabéri. Ses membres apportent ce qu'ils cultivent et demandent à la coopérative des semences, de l'engrais, du crédit et une place pour stocker la récolte. Cette page est le monde lui-même, interrogé : chaque cellule s'exécute sur worlds/cooperative.zknw, le simple fichier sur lequel les chapitres raisonnent quand vous choisissez ce monde, et la page ne stocke rien.

1. Son nom

La première chose qu'un monde dit, c'est ce qu'il est.

S'exécute sur l'ordinateur avec Softanza
? EduWorldName()
#--> tillaberi-cooperative (cooperative)
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

2. Ce qui a été demandé

Sept demandes sont arrivées cette saison. Certaines demandent la même chose : c'est pourquoi le chapitre 1 retire les doublons et le chapitre 5 compte la demande la plus fréquente.

S'exécute sur l'ordinateur avec Softanza
aReq = EduWorldObjects("requested")
? len(aReq)
#--> 7
? @@( aReq )
#--> [ "seed", "fertiliser", "seed", "credit", "storage", "seed", "credit" ]
o1 = new stzList(aReq)
? @@( o1.DuplicatesRemoved() )
#--> [ "seed", "fertiliser", "credit", "storage" ]
? StzListQ(aReq).NumberOfOccurrence("seed")
#--> 3
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

3. Qui cultive quoi

Le monde sait plus que les demandes : quel membre cultive quelle culture, et où chaque culture est stockée.

S'exécute sur l'ordinateur avec Softanza
? @@( EduWorld().Query([ "?who", "grows", "millet" ]) )
#--> [ "amadou", "issa" ]
? @@( EduWorld().Query([ "hadiza", "grows", "?what" ]) )
#--> [ "cowpea" ]
? @@( EduWorld().Query([ "cowpea", "stored-in", "?where" ]) )
#--> [ "granary-2" ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

4. Une question à laquelle il ne peut pas encore répondre

Qui a demandé le crédit ? Le monde ne dit pas qui a fait chaque demande, donc la réponse est vide, pas devinée. Le chapitre 12 montre comment ajouter le fait manquant ; le chapitre 13 montre comment Softanza vous interroge sur un manque comme celui-ci.

S'exécute sur l'ordinateur avec Softanza
? @@( EduWorld().Query([ "hadiza", "requested", "?what" ]) )
#--> [ ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

ترجمة أولية: لم يراجعها بعدُ ناطق أصلي بالعربية.

التعاونية

تعاونية زراعية في سهل تيلابيري. يجلب أعضاؤها ما يزرعونه، ويطلبون من التعاونية البذور والسماد والقرض ومكانًا لتخزين المحصول. هذه الصفحة هي العالم نفسه مسؤولًا: كل خلية تعمل على worlds/cooperative.zknw، الملف البسيط الذي تستدل عليه الفصول حين تختار هذا العالم، والصفحة لا تخزّن شيئًا.

1. اسمه

أول ما يقوله العالم هو ما هو.

تعمل على الحاسوب مع سوفتانزا
? EduWorldName()
#--> tillaberi-cooperative (cooperative)
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

2. ما طُلب

وصل سبعة طلبات هذا الموسم. بعضها يطلب الشيء نفسه، ولهذا يزيل الفصل 1 المكررات ويعدّ الفصل 5 الأكثر طلبًا.

تعمل على الحاسوب مع سوفتانزا
aReq = EduWorldObjects("requested")
? len(aReq)
#--> 7
? @@( aReq )
#--> [ "seed", "fertiliser", "seed", "credit", "storage", "seed", "credit" ]
o1 = new stzList(aReq)
? @@( o1.DuplicatesRemoved() )
#--> [ "seed", "fertiliser", "credit", "storage" ]
? StzListQ(aReq).NumberOfOccurrence("seed")
#--> 3
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

3. من يزرع ماذا

يعرف العالم أكثر من الطلبات: أي عضو يزرع أي محصول، وأين يُخزَّن كل محصول.

تعمل على الحاسوب مع سوفتانزا
? @@( EduWorld().Query([ "?who", "grows", "millet" ]) )
#--> [ "amadou", "issa" ]
? @@( EduWorld().Query([ "hadiza", "grows", "?what" ]) )
#--> [ "cowpea" ]
? @@( EduWorld().Query([ "cowpea", "stored-in", "?where" ]) )
#--> [ "granary-2" ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

4. سؤال لا يستطيع الإجابة عنه بعد

من طلب القرض؟ لا يقول العالم من قدّم كل طلب، فالجواب فارغ لا تخمين. يبيّن الفصل 12 كيف تضيف الحقيقة الناقصة؛ ويبيّن الفصل 13 كيف تسألك سوفتانزا عن فجوة كهذه.

تعمل على الحاسوب مع سوفتانزا
? @@( EduWorld().Query([ "hadiza", "requested", "?what" ]) )
#--> [ ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

Fassara ta farko: wani ɗan asalin harshen Hausa bai riga ya duba ta ba tukuna.

Ƙungiyar haɗin gwiwa

Ƙungiyar manoma ta haɗin gwiwa a filin Tillaberi. Membobinta suna kawo abin da suke nomawa, kuma suna neman iri, taki, bashi da wurin ajiyar amfani daga ƙungiyar. Wannan shafin duniyar kanta ce, an tambaye ta: kowane ɗaki yana gudana a kan worlds/cooperative.zknw, fayil mai sauƙi da babobin ke tunani a kai idan ka zaɓi wannan duniyar, kuma shafin ba ya ajiye komai.

1. Sunanta

Abu na farko da duniya take faɗa shi ne abin da take.

Tana gudana a kwamfuta tare da Softanza
? EduWorldName()
#--> tillaberi-cooperative (cooperative)
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

2. Abin da aka nema

Buƙatu bakwai sun zo a wannan kakar. Wasu suna neman abu ɗaya, shi ya sa babi na 1 yake cire maimaitattu kuma babi na 5 yake ƙidaya abin da aka fi nema.

Tana gudana a kwamfuta tare da Softanza
aReq = EduWorldObjects("requested")
? len(aReq)
#--> 7
? @@( aReq )
#--> [ "seed", "fertiliser", "seed", "credit", "storage", "seed", "credit" ]
o1 = new stzList(aReq)
? @@( o1.DuplicatesRemoved() )
#--> [ "seed", "fertiliser", "credit", "storage" ]
? StzListQ(aReq).NumberOfOccurrence("seed")
#--> 3
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

3. Wa yake noma me

Duniyar ta san fiye da buƙatu: wane memba yake noma wace amfani, kuma ina ake ajiye kowace amfani.

Tana gudana a kwamfuta tare da Softanza
? @@( EduWorld().Query([ "?who", "grows", "millet" ]) )
#--> [ "amadou", "issa" ]
? @@( EduWorld().Query([ "hadiza", "grows", "?what" ]) )
#--> [ "cowpea" ]
? @@( EduWorld().Query([ "cowpea", "stored-in", "?where" ]) )
#--> [ "granary-2" ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

4. Tambayar da ba za ta iya amsawa ba tukuna

Wa ya nemi bashi? Duniyar ba ta faɗa wa ya yi kowace buƙata ba, don haka amsar babu kome, ba tsammani ba. Babi na 12 yana nuna yadda ake ƙara gaskiyar da ta ɓace; babi na 13 yana nuna yadda Softanza take tambayarka game da giɓi irin wannan.

Tana gudana a kwamfuta tare da Softanza
? @@( EduWorld().Query([ "hadiza", "requested", "?what" ]) )
#--> [ ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

The school

A secondary school in Niamey. Families and pupils come to the office for transcripts, textbooks, a place in a class and certificates. This page is the world itself, questioned: every cell runs over worlds/school.zknw, the plain file the chapters reason over when you choose this world, and the page stores nothing.

1. Its name

The first thing a world says is what it is.

Runs on the desktop with Softanza
? EduWorldName()
#--> lycee-de-niamey (school)
This page stores no output. Run the cell to see what it prints.

2. What was requested

Seven requests reached the office this week. Some ask for the same thing, which is why chapter 1 removes the duplicates and chapter 5 counts the most requested.

Runs on the desktop with Softanza
aReq = EduWorldObjects("requested")
? len(aReq)
#--> 7
? @@( aReq )
#--> [ "transcript", "textbook", "transcript", "enrolment", "certificate", "textbook", "transcript" ]
o1 = new stzList(aReq)
? @@( o1.DuplicatesRemoved() )
#--> [ "transcript", "textbook", "enrolment", "certificate" ]
? StzListQ(aReq).NumberOfOccurrence("transcript")
#--> 3
This page stores no output. Run the cell to see what it prints.

3. Which subject, which class

The world knows more than requests: which subject is taught in which class, and who leads each class.

Runs on the desktop with Softanza
? @@( EduWorld().Query([ "?subject", "taught-in", "class-3a" ]) )
#--> [ "mathematics", "physics" ]
? @@( EduWorld().Query([ "history", "taught-in", "?class" ]) )
#--> [ "class-3b" ]
? @@( EduWorld().Query([ "class-3b", "led-by", "?who" ]) )
#--> [ "m-issoufou" ]
This page stores no output. Run the cell to see what it prints.

4. A question it cannot answer yet

Who teaches history? The world says which class history is taught in and who leads that class, but not who teaches the subject, so the answer is empty, not a guess. Chapter 12 shows how you add the missing fact; chapter 13 shows how Softanza asks you about a gap like this one.

Runs on the desktop with Softanza
? @@( EduWorld().Query([ "history", "taught-by", "?who" ]) )
#--> [ ]
This page stores no output. Run the cell to see what it prints.

Traduction provisoire : pas encore relue par un locuteur natif.

L'école

Un lycée de Niamey. Les familles et les élèves viennent au bureau pour des relevés de notes, des manuels, une place dans une classe et des certificats. Cette page est le monde lui-même, interrogé : chaque cellule s'exécute sur worlds/school.zknw, le simple fichier sur lequel les chapitres raisonnent quand vous choisissez ce monde, et la page ne stocke rien.

1. Son nom

La première chose qu'un monde dit, c'est ce qu'il est.

S'exécute sur l'ordinateur avec Softanza
? EduWorldName()
#--> lycee-de-niamey (school)
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

2. Ce qui a été demandé

Sept demandes sont arrivées au bureau cette semaine. Certaines demandent la même chose : c'est pourquoi le chapitre 1 retire les doublons et le chapitre 5 compte la demande la plus fréquente.

S'exécute sur l'ordinateur avec Softanza
aReq = EduWorldObjects("requested")
? len(aReq)
#--> 7
? @@( aReq )
#--> [ "transcript", "textbook", "transcript", "enrolment", "certificate", "textbook", "transcript" ]
o1 = new stzList(aReq)
? @@( o1.DuplicatesRemoved() )
#--> [ "transcript", "textbook", "enrolment", "certificate" ]
? StzListQ(aReq).NumberOfOccurrence("transcript")
#--> 3
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

3. Quelle matière, quelle classe

Le monde sait plus que les demandes : quelle matière est enseignée dans quelle classe, et qui dirige chaque classe.

S'exécute sur l'ordinateur avec Softanza
? @@( EduWorld().Query([ "?subject", "taught-in", "class-3a" ]) )
#--> [ "mathematics", "physics" ]
? @@( EduWorld().Query([ "history", "taught-in", "?class" ]) )
#--> [ "class-3b" ]
? @@( EduWorld().Query([ "class-3b", "led-by", "?who" ]) )
#--> [ "m-issoufou" ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

4. Une question à laquelle il ne peut pas encore répondre

Qui enseigne l'histoire ? Le monde dit dans quelle classe l'histoire est enseignée et qui dirige cette classe, mais pas qui enseigne la matière : la réponse est donc vide, pas devinée. Le chapitre 12 montre comment ajouter le fait manquant ; le chapitre 13 montre comment Softanza vous interroge sur un manque comme celui-ci.

S'exécute sur l'ordinateur avec Softanza
? @@( EduWorld().Query([ "history", "taught-by", "?who" ]) )
#--> [ ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

ترجمة أولية: لم يراجعها بعدُ ناطق أصلي بالعربية.

المدرسة

مدرسة ثانوية في نيامي. تأتي الأسر والتلاميذ إلى المكتب طلبًا لكشوف الدرجات والكتب المدرسية ومقعد في صف وشهادات. هذه الصفحة هي العالم نفسه مسؤولًا: كل خلية تعمل على worlds/school.zknw، الملف البسيط الذي تستدل عليه الفصول حين تختار هذا العالم، والصفحة لا تخزّن شيئًا.

1. اسمه

أول ما يقوله العالم هو ما هو.

تعمل على الحاسوب مع سوفتانزا
? EduWorldName()
#--> lycee-de-niamey (school)
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

2. ما طُلب

وصل سبعة طلبات إلى المكتب هذا الأسبوع. بعضها يطلب الشيء نفسه، ولهذا يزيل الفصل 1 المكررات ويعدّ الفصل 5 الأكثر طلبًا.

تعمل على الحاسوب مع سوفتانزا
aReq = EduWorldObjects("requested")
? len(aReq)
#--> 7
? @@( aReq )
#--> [ "transcript", "textbook", "transcript", "enrolment", "certificate", "textbook", "transcript" ]
o1 = new stzList(aReq)
? @@( o1.DuplicatesRemoved() )
#--> [ "transcript", "textbook", "enrolment", "certificate" ]
? StzListQ(aReq).NumberOfOccurrence("transcript")
#--> 3
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

3. أي مادة، أي صف

يعرف العالم أكثر من الطلبات: أي مادة تُدرَّس في أي صف، ومن يقود كل صف.

تعمل على الحاسوب مع سوفتانزا
? @@( EduWorld().Query([ "?subject", "taught-in", "class-3a" ]) )
#--> [ "mathematics", "physics" ]
? @@( EduWorld().Query([ "history", "taught-in", "?class" ]) )
#--> [ "class-3b" ]
? @@( EduWorld().Query([ "class-3b", "led-by", "?who" ]) )
#--> [ "m-issoufou" ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

4. سؤال لا يستطيع الإجابة عنه بعد

من يدرّس التاريخ؟ يقول العالم في أي صف يُدرَّس التاريخ ومن يقود ذلك الصف، لكن لا من يدرّس المادة، فالجواب فارغ لا تخمين. يبيّن الفصل 12 كيف تضيف الحقيقة الناقصة؛ ويبيّن الفصل 13 كيف تسألك سوفتانزا عن فجوة كهذه.

تعمل على الحاسوب مع سوفتانزا
? @@( EduWorld().Query([ "history", "taught-by", "?who" ]) )
#--> [ ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

Fassara ta farko: wani ɗan asalin harshen Hausa bai riga ya duba ta ba tukuna.

Makaranta

Makarantar sakandare a Yamai. Iyalai da ɗalibai suna zuwa ofis don neman takardar sakamako, littattafai, wuri a aji da shaidar karatu. Wannan shafin duniyar kanta ce, an tambaye ta: kowane ɗaki yana gudana a kan worlds/school.zknw, fayil mai sauƙi da babobin ke tunani a kai idan ka zaɓi wannan duniyar, kuma shafin ba ya ajiye komai.

1. Sunanta

Abu na farko da duniya take faɗa shi ne abin da take.

Tana gudana a kwamfuta tare da Softanza
? EduWorldName()
#--> lycee-de-niamey (school)
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

2. Abin da aka nema

Buƙatu bakwai sun isa ofis a wannan makon. Wasu suna neman abu ɗaya, shi ya sa babi na 1 yake cire maimaitattu kuma babi na 5 yake ƙidaya abin da aka fi nema.

Tana gudana a kwamfuta tare da Softanza
aReq = EduWorldObjects("requested")
? len(aReq)
#--> 7
? @@( aReq )
#--> [ "transcript", "textbook", "transcript", "enrolment", "certificate", "textbook", "transcript" ]
o1 = new stzList(aReq)
? @@( o1.DuplicatesRemoved() )
#--> [ "transcript", "textbook", "enrolment", "certificate" ]
? StzListQ(aReq).NumberOfOccurrence("transcript")
#--> 3
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

3. Wane darasi, wane aji

Duniyar ta san fiye da buƙatu: wane darasi ake koyarwa a wane aji, kuma wa yake jagorantar kowane aji.

Tana gudana a kwamfuta tare da Softanza
? @@( EduWorld().Query([ "?subject", "taught-in", "class-3a" ]) )
#--> [ "mathematics", "physics" ]
? @@( EduWorld().Query([ "history", "taught-in", "?class" ]) )
#--> [ "class-3b" ]
? @@( EduWorld().Query([ "class-3b", "led-by", "?who" ]) )
#--> [ "m-issoufou" ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

4. Tambayar da ba za ta iya amsawa ba tukuna

Wa yake koyar da tarihi? Duniyar tana faɗa a wane aji ake koyar da tarihi da kuma wa yake jagorantar ajin, amma ba wa yake koyar da darasin ba, don haka amsar babu kome, ba tsammani ba. Babi na 12 yana nuna yadda ake ƙara gaskiyar da ta ɓace; babi na 13 yana nuna yadda Softanza take tambayarka game da giɓi irin wannan.

Tana gudana a kwamfuta tare da Softanza
? @@( EduWorld().Query([ "history", "taught-by", "?who" ]) )
#--> [ ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

The restaurant

Bella Cucina, a small restaurant, and the world this course runs over unless you choose another. The kitchen receives orders; each order asks for a dish, and dishes contain ingredients. This page is the world itself, questioned: every cell runs over worlds/workplace.zknw, the plain file the chapters reason over, and the page stores nothing.

1. Its name

The first thing a world says is what it is.

Runs on the desktop with Softanza
? EduWorldName()
#--> bella-cucina (restaurant)
This page stores no output. Run the cell to see what it prints.

2. What was requested

Six orders came in today. Some ask for the same dish, which is why chapter 1 removes the duplicates and chapter 5 counts the most requested.

Runs on the desktop with Softanza
aReq = EduWorldObjects("requested")
? len(aReq)
#--> 6
? @@( aReq )
#--> [ "margherita", "tiramisu", "margherita", "lasagna", "tiramisu", "margherita" ]
o1 = new stzList(aReq)
? @@( o1.DuplicatesRemoved() )
#--> [ "margherita", "tiramisu", "lasagna" ]
? StzListQ(aReq).NumberOfOccurrence("margherita")
#--> 3
This page stores no output. Run the cell to see what it prints.

3. What a dish contains

The world knows more than orders: what each dish contains, and which dish contains a given ingredient.

Runs on the desktop with Softanza
? @@( EduWorld().Query([ "margherita", "contains", "?what" ]) )
#--> [ "tomato", "mozzarella" ]
? @@( EduWorld().Query([ "?dish", "contains", "beef" ]) )
#--> [ "lasagna" ]
? @@( EduWorld().Query([ "tiramisu", "contains", "?what" ]) )
#--> [ "mascarpone" ]
This page stores no output. Run the cell to see what it prints.

4. A question it cannot answer yet

Who ordered the lasagna? The world says what each order requested, but not who placed it, so the answer is empty, not a guess. Chapter 12 shows how you add the missing fact; chapter 13 shows how Softanza asks you about a gap like this one.

Runs on the desktop with Softanza
? @@( EduWorld().Query([ "?who", "placed", "order-4" ]) )
#--> [ ]
This page stores no output. Run the cell to see what it prints.

Traduction provisoire : pas encore relue par un locuteur natif.

Le restaurant

Bella Cucina, un petit restaurant, et le monde sur lequel ce cours s'exécute sauf si vous en choisissez un autre. La cuisine reçoit des commandes ; chaque commande demande un plat, et les plats contiennent des ingrédients. Cette page est le monde lui-même, interrogé : chaque cellule s'exécute sur worlds/workplace.zknw, le simple fichier sur lequel les chapitres raisonnent, et la page ne stocke rien.

1. Son nom

La première chose qu'un monde dit, c'est ce qu'il est.

S'exécute sur l'ordinateur avec Softanza
? EduWorldName()
#--> bella-cucina (restaurant)
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

2. Ce qui a été demandé

Six commandes sont arrivées aujourd'hui. Certaines demandent le même plat : c'est pourquoi le chapitre 1 retire les doublons et le chapitre 5 compte la demande la plus fréquente.

S'exécute sur l'ordinateur avec Softanza
aReq = EduWorldObjects("requested")
? len(aReq)
#--> 6
? @@( aReq )
#--> [ "margherita", "tiramisu", "margherita", "lasagna", "tiramisu", "margherita" ]
o1 = new stzList(aReq)
? @@( o1.DuplicatesRemoved() )
#--> [ "margherita", "tiramisu", "lasagna" ]
? StzListQ(aReq).NumberOfOccurrence("margherita")
#--> 3
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

3. Ce qu'un plat contient

Le monde sait plus que les commandes : ce que contient chaque plat, et quel plat contient un ingrédient donné.

S'exécute sur l'ordinateur avec Softanza
? @@( EduWorld().Query([ "margherita", "contains", "?what" ]) )
#--> [ "tomato", "mozzarella" ]
? @@( EduWorld().Query([ "?dish", "contains", "beef" ]) )
#--> [ "lasagna" ]
? @@( EduWorld().Query([ "tiramisu", "contains", "?what" ]) )
#--> [ "mascarpone" ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

4. Une question à laquelle il ne peut pas encore répondre

Qui a commandé les lasagnes ? Le monde dit ce que chaque commande demande, mais pas qui l'a passée : la réponse est donc vide, pas devinée. Le chapitre 12 montre comment ajouter le fait manquant ; le chapitre 13 montre comment Softanza vous interroge sur un manque comme celui-ci.

S'exécute sur l'ordinateur avec Softanza
? @@( EduWorld().Query([ "?who", "placed", "order-4" ]) )
#--> [ ]
Cette page ne stocke aucun résultat. Exécutez la cellule pour voir ce qu'elle affiche.

ترجمة أولية: لم يراجعها بعدُ ناطق أصلي بالعربية.

المطعم

بيلا كوتشينا، مطعم صغير، والعالم الذي يعمل عليه هذا المقرر ما لم تختر غيره. يتلقى المطبخ طلبيات؛ كل طلبية تطلب طبقًا، والأطباق تحتوي على مكونات. هذه الصفحة هي العالم نفسه مسؤولًا: كل خلية تعمل على worlds/workplace.zknw، الملف البسيط الذي تستدل عليه الفصول، والصفحة لا تخزّن شيئًا.

1. اسمه

أول ما يقوله العالم هو ما هو.

تعمل على الحاسوب مع سوفتانزا
? EduWorldName()
#--> bella-cucina (restaurant)
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

2. ما طُلب

وصلت ست طلبيات اليوم. بعضها يطلب الطبق نفسه، ولهذا يزيل الفصل 1 المكررات ويعدّ الفصل 5 الأكثر طلبًا.

تعمل على الحاسوب مع سوفتانزا
aReq = EduWorldObjects("requested")
? len(aReq)
#--> 6
? @@( aReq )
#--> [ "margherita", "tiramisu", "margherita", "lasagna", "tiramisu", "margherita" ]
o1 = new stzList(aReq)
? @@( o1.DuplicatesRemoved() )
#--> [ "margherita", "tiramisu", "lasagna" ]
? StzListQ(aReq).NumberOfOccurrence("margherita")
#--> 3
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

3. ما يحتويه الطبق

يعرف العالم أكثر من الطلبيات: ما يحتويه كل طبق، وأي طبق يحتوي على مكوّن معيّن.

تعمل على الحاسوب مع سوفتانزا
? @@( EduWorld().Query([ "margherita", "contains", "?what" ]) )
#--> [ "tomato", "mozzarella" ]
? @@( EduWorld().Query([ "?dish", "contains", "beef" ]) )
#--> [ "lasagna" ]
? @@( EduWorld().Query([ "tiramisu", "contains", "?what" ]) )
#--> [ "mascarpone" ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

4. سؤال لا يستطيع الإجابة عنه بعد

من طلب اللازانيا؟ يقول العالم ما طلبته كل طلبية، لكن لا من قدّمها، فالجواب فارغ لا تخمين. يبيّن الفصل 12 كيف تضيف الحقيقة الناقصة؛ ويبيّن الفصل 13 كيف تسألك سوفتانزا عن فجوة كهذه.

تعمل على الحاسوب مع سوفتانزا
? @@( EduWorld().Query([ "?who", "placed", "order-4" ]) )
#--> [ ]
لا تخزّن هذه الصفحة أي نتيجة. شغّل الخلية لترى ما تطبعه.

Fassara ta farko: wani ɗan asalin harshen Hausa bai riga ya duba ta ba tukuna.

Gidan abinci

Bella Cucina, ƙaramin gidan abinci, kuma duniyar da wannan darasin ke gudana a kai sai dai idan ka zaɓi wata. Ɗakin girki yana karɓar oda; kowace oda tana neman abinci ɗaya, kuma abinci yana ɗauke da kayan haɗi. Wannan shafin duniyar kanta ce, an tambaye ta: kowane ɗaki yana gudana a kan worlds/workplace.zknw, fayil mai sauƙi da babobin ke tunani a kai, kuma shafin ba ya ajiye komai.

1. Sunanta

Abu na farko da duniya take faɗa shi ne abin da take.

Tana gudana a kwamfuta tare da Softanza
? EduWorldName()
#--> bella-cucina (restaurant)
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

2. Abin da aka nema

Oda shida sun zo yau. Wasu suna neman abinci ɗaya, shi ya sa babi na 1 yake cire maimaitattu kuma babi na 5 yake ƙidaya abin da aka fi nema.

Tana gudana a kwamfuta tare da Softanza
aReq = EduWorldObjects("requested")
? len(aReq)
#--> 6
? @@( aReq )
#--> [ "margherita", "tiramisu", "margherita", "lasagna", "tiramisu", "margherita" ]
o1 = new stzList(aReq)
? @@( o1.DuplicatesRemoved() )
#--> [ "margherita", "tiramisu", "lasagna" ]
? StzListQ(aReq).NumberOfOccurrence("margherita")
#--> 3
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

3. Abin da abinci ya ƙunsa

Duniyar ta san fiye da oda: abin da kowane abinci ya ƙunsa, kuma wane abinci ya ƙunshi wani kayan haɗi.

Tana gudana a kwamfuta tare da Softanza
? @@( EduWorld().Query([ "margherita", "contains", "?what" ]) )
#--> [ "tomato", "mozzarella" ]
? @@( EduWorld().Query([ "?dish", "contains", "beef" ]) )
#--> [ "lasagna" ]
? @@( EduWorld().Query([ "tiramisu", "contains", "?what" ]) )
#--> [ "mascarpone" ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.

4. Tambayar da ba za ta iya amsawa ba tukuna

Wa ya yi odar lasagna? Duniyar tana faɗa abin da kowace oda ta nema, amma ba wa ya yi ta ba, don haka amsar babu kome, ba tsammani ba. Babi na 12 yana nuna yadda ake ƙara gaskiyar da ta ɓace; babi na 13 yana nuna yadda Softanza take tambayarka game da giɓi irin wannan.

Tana gudana a kwamfuta tare da Softanza
? @@( EduWorld().Query([ "?who", "placed", "order-4" ]) )
#--> [ ]
Wannan shafin ba ya ajiye sakamako. Gudanar da ɗakin don ganin abin da yake bugawa.