Chapterبەش 2 · Lectureوانە 2.2

Visual Programming: Coding with Blocksبەرنامەسازیی دیدەیی: کۆدنووسین بە بلۆک

What block-based programming is and why it helps beginners; block shapes and categories; Scratch, Blockly, MIT App Inventor and Code.org (now CodeAI) as of 2026; sprites, events and messages; one algorithm as blocks, a flowchart and pseudocode; loops and decisions; how Blockly's code generators turn blocks into real code; a traffic-light project step by step; the limits of blocks and the move to text code; and node-based tools such as Unreal Engine Blueprints, Node-RED and LabVIEW.

بەرنامەسازی بە چییە و بۆچی یارمەتیی نوێکاران دەدات؛ شێوە و پۆلەکانی ؛ Scratch، Blockly، MIT App Inventor و ⁦Code.org⁩ (ئێستا CodeAI) وەک ⁦2026⁩؛ ، و پەیامەکان؛ یەک بە ، و ؛ و بڕیارەکان؛ Blockly چۆن دەکەن بە کۆدی ڕاستەقینە؛ پڕۆژەی گڵۆپی هاتوچۆ هەنگاو بە هەنگاو؛ سنووری و چوونە سەر کۆدی نووسراو؛ و ئامرازە نۆدییەکان وەک Unreal Engine Blueprints، ⁦Node-RED⁩ و LabVIEW.

18 min read20 خولەک خوێندنەوە · 17 stepsهەنگاو

What you will learnچی فێر دەبیت

  • Explain what block-based programming is and why it helps beginners.
  • Name the block shapes and categories and say where each block fits.
  • Describe Scratch, Blockly, MIT App Inventor and Code.org/CodeAI as of 2026.
  • Write the same algorithm as blocks, a flowchart and pseudocode, with events, loops and decisions.
  • Explain how blocks become text code, build a small block project and know when to move on to text code.
  • ڕوونی بکەیتەوە بەرنامەسازی بە چییە و بۆچی یارمەتیی نوێکاران دەدات.
  • شێوە و پۆلەکانی ناو ببەیت و بڵێیت هەر لە کوێ جێی دەبێتەوە.
  • Scratch، Blockly، MIT App Inventor و ⁦Code.org/CodeAI⁩ وەک ⁦2026⁩ وەسف بکەیت.
  • هەمان بە ، و بنووسیت، لەگەڵ ، و بڕیار.
  • ڕوونی بکەیتەوە چۆن دەبن بە کۆدی نووسراو، پڕۆژەیەکی بچووکی بلۆکی دروست بکەیت و بزانیت کەی بچیتە سەر کۆدی نووسراو.

Programs made of blocksبەرنامە لە بلۆک دروست دەکرێت

In visual programming you build a program from pictures instead of typing text. The most common kind is block-based programming: every command is a coloured block, and you drag blocks from a palette and snap them together like puzzle pieces. Many children and beginners write their first programs this way.

لە لە جیاتی نووسینی دەق، لە وێنە دروست دەکەیت. باوترین جۆری بەرنامەسازی بە ـە: هەر ڕەنگاوڕەنگە و لە سندوقی بلۆکەکانەوە ڕادەکێشیت و وەک پارچەی پازڵ بە یەکەوە دەیانلکێنیت. زۆر منداڵ و نوێکار یەکەم خۆیان بەم شێوەیە دەنووسن.

Blocks remove the hardest part of the first week: typing. You cannot misspell a block or forget a bracket, so there are no syntax errors. A block's shape shows where it fits, and a wrong piece simply does not snap. All the blocks are on show, so you pick a command you can see instead of remembering its name. The ideas are exactly those of text code: sequence, decisions, loops, variables and functions.

قورسترین بەشی هەفتەی یەکەم لادەبەن: نووسین. ناتوانیت بە هەڵە بنووسیت یان کەوانەیەک لەبیر بکەیت، بۆیە هەڵەی نییە. شێوەی پیشان دەدات لە کوێ جێی دەبێتەوە و پارچەیەکی هەڵە هەر نالکێت. هەموو لە بەرچاون، بۆیە هەڵدەبژێریت کە دەیبینیت، لە جیاتی ئەوەی ناوەکەی لەبیر بێت. بیرۆکەکان ڕێک هی کۆدی نووسراون: زنجیرە، بڕیار، ، و .

Left, two typed lines with mistakes underlined: repaet 4 with a misspelled keyword and move(10; with a missing bracket. Right, the same idea as blocks: a C-shaped repeat 4 block holding a move 10 steps block. Notes: nothing to misspell, and the shape decides where a block fits.لای چەپ، دوو دێڕی نووسراو کە هەڵەکانیان هێڵیان بەژێردا هاتووە: repaet 4 کە وشەکەی بە هەڵە نووسراوە و move(10; کە کەوانەیەکی کەمە. لای ڕاست، هەمان بیرۆکە بە بلۆکەکان: بلۆکێکی repeat 4 کە وەک پیتی Cـیە و بلۆکی move 10 steps لە ناویدایە. تێبینی: هیچ شتێک نییە بە هەڵە بنووسرێت و شێوەکە بڕیار دەدات بلۆکێک لە کوێ جێی دەبێتەوە.
Typed code can be misspelled; blocks cannot.کۆدی نووسراو دەکرێت بە هەڵە بنووسرێت؛ نا.CêIT

Block shapes: the shape shows where a block fitsشێوەی بلۆکەکان: شێوەکە پیشان دەدات لە کوێ جێی دەبێتەوە

Block tools use a few shapes, and each shape has a job. The names below are Scratch's; Blockly and App Inventor use the same ideas with their own looks.

ئامرازەکانی بلۆک چەند شێوەیەک بەکار دەهێنن و هەر شێوەیەک کارێکی هەیە. ناوەکانی خوارەوە هی Scratchـن؛ Blockly و App Inventor هەمان بیرۆکە بە شێوەی خۆیان بەکار دەهێنن.

  • Hat: a round top. It starts a script when an event happens, such as when green flag clicked. Nothing fits above it.
  • Stack (command): a notch on top and a bump below; one action, such as move (10) steps. Stacked blocks run from top to bottom.
  • C block: wraps other blocks in its mouth, for loops (repeat (10), forever) and decisions (if < > then).
  • Reporter: round ends. It gives a value, a number or text, such as (x position) or (answer).
  • Boolean: pointed ends. It answers true or false, such as <touching (edge)?>, and fits only in pointed slots, like the condition of if.
  • Cap: a flat bottom. It ends a script, such as stop [all], so nothing can go under it.
  • کڵاو: سەرێکی خڕی هەیە. کاتێک ڕوو دەدات بەشێک دەست پێ دەکات، وەک when green flag clicked. هیچ شتێک لە سەرییەوە جێی نابێتەوە.
  • فەرمان: چاڵێکی لە سەرەوە و دەرپەڕێکی لە خوارەوە هەیە؛ یەک کار، وەک move (10) steps. لەسەر یەک لە سەرەوە بۆ خوارەوە جێبەجێ دەبن.
  • بلۆکی C: تر لە ناو دەمیدا دەگرێت، بۆ (repeat (10)، forever) و بڕیار (if < > then).
  • ڕاپۆرتەر: سەرەکانی خڕن. نرخێک دەدات، ژمارە یان دەق، وەک (x position) یان (answer).
  • : سەرەکانی تیژن. وەڵامی ڕاست یان هەڵە دەداتەوە، وەک <touching (edge)?> و تەنیا لە شوێنی تیژدا جێی دەبێتەوە، وەک if.
  • کۆتایی: بنێکی ڕاستی هەیە. بەشێک کۆتایی پێ دەهێنێت، وەک stop [all]، بۆیە هیچ شتێک ناچێتە ژێرییەوە.
Six block shapes, drawn and named. A hat block with a round top: when green flag clicked. A stack block with a notch and a bump: move 10 steps. A C block with a mouth that holds another block: repeat 10. A reporter with round ends: x position. A boolean with pointed ends: touching edge?. A cap block with a flat bottom: stop all.شەش شێوەی بلۆک، کێشراو و ناونراو. بلۆکی کڵاو بە سەرێکی خڕ: when green flag clicked. بلۆکی فەرمان بە چاڵ و دەرپەڕێک: move 10 steps. بلۆکی C بە دەمێک کە بلۆکێکی تر دەگرێت: repeat 10. ڕاپۆرتەر بە سەری خڕ: x position. بوولیان بە سەری تیژ: touching edge?. بلۆکی کۆتایی بە بنێکی ڕاست: stop all.
Six shapes, six jobs.شەش شێوە، شەش کار.CêIT

Block categoriesپۆلەکانی بلۆکەکان

The palette sorts blocks into categories, each with its own colour, so you can find them fast. Scratch 3.0 has these nine; extensions add more, such as pen, music or robot kits.

سندوقەکە دابەش دەکات بۆ چەند پۆلێک، هەر یەکە بە ڕەنگی خۆی، بۆ ئەوەی بە خێرایی بیاندۆزیتەوە. ⁦Scratch 3.0⁩ ئەم نۆ پۆلەی هەیە؛ پاشکۆکان پۆلی زیاتر زیاد دەکەن، وەک قەڵەم، مۆسیقا یان .

The nine block categories of Scratch 3.0نۆ پۆلی ⁦Scratch 3.0⁩
CategoryپۆلWhat its blocks do چی دەکەنExampleنموونە
MotionMove and turn a sprite دەجووڵێنن و دەیسووڕێننmove (10) steps
LooksChange costume and size, show speechجل و قەبارە دەگۆڕن، قسە پیشان دەدەنsay [Hello!]
SoundPlay soundsدەنگ لێدەدەنplay sound [pop]
EventsStart scripts when something happensکاتێک شتێک ڕوو دەدات بەشەکان دەست پێ دەکەنwhen green flag clicked
ControlWait, repeat, decideچاوەڕێ دەکەن، دووپاتە دەکەنەوە، بڕیار دەدەنrepeat (10)
SensingAsk and check thingsدەپرسن و شتەکان دەپشکنن<touching (edge)?>
OperatorsMaths, comparisons, and/or/not, joining textبیرکاری، بەراوردکردن، ⁦and/or/not⁩، پێکەوەلکاندنی دەق((a) + (b))
VariablesStore values and listsنرخ و لیست هەڵدەگرنset [score] to (0)
My BlocksMake your own blocks, like functions خۆت دروست دەکەیت، وەک define jump
A drawn block palette. A column of nine coloured category dots on the left: Motion, Looks, Sound, Events, Control, Sensing, Operators, Variables and My Blocks. Beside it, sample blocks in the same colours: move 10 steps, say Hello!, when green flag clicked, wait 1 seconds, touching edge?, a + b and set score to 0.سندوقێکی بلۆکەکان کە کێشراوە. لە لای چەپ ستوونێکی نۆ خاڵی ڕەنگاوڕەنگی پۆلەکان: Motion، Looks، Sound، Events، Control، Sensing، Operators، Variables و My Blocks. لە تەنیشتیانەوە نموونەی بلۆکەکان بە هەمان ڕەنگ: move 10 steps، say Hello!، when green flag clicked، wait 1 seconds، touching edge?، a + b و set score to 0.
Find a block by its category and colour. بە پۆل و ڕەنگەکەی بدۆزەرەوە.CêIT

Block tools in 2026ئامرازەکانی بلۆک لە ⁦2026⁩دا

Four names you will meet, as of November 2026:

چوار ناو کە پێیان دەگەیت، وەک تشرینی دووەمی ⁦2026⁩:

ToolئامرازWho makes itکێ دروستی دەکاتWhat it is forبۆ چییە
ScratchScratch Foundation, a non-profit; first made at the MIT Media Lab (2007)دامەزراوەی Scratch، ڕێکخراوێکی ناقازانج؛ یەکەم جار لە MIT Media Lab دروست کرا ⁦(2007)⁩Games, stories and animations in the browser; freeیاری، چیرۆک و لە ؛ بێبەرانبەر
BlocklyRaspberry Pi Foundation since 10 November 2025; started at Google (2011)دامەزراوەی Raspberry Pi لە ⁦10⁩ی تشرینی دووەمی ⁦2025⁩ـەوە؛ لە Google دەستی پێ کرد ⁦(2011)⁩A library that developers use to build block editors; open source کە گەشەپێدەران بۆ دروستکردنی دەستکاریکەری بلۆک بەکاری دەهێنن؛
MIT App InventorMIT; first built by Google (public in 2010)MIT؛ یەکەم جار Google دروستی کرد (لە ⁦2010⁩ بڵاو کرایەوە)Real apps for Android phones and iPhones; free ڕاستەقینە بۆ مۆبایلی Android و iPhone؛ بێبەرانبەر
Code.org, now CodeAIA non-profit founded in 2013; renamed CodeAI on 2 June 2026ڕێکخراوێکی ناقازانج کە لە ⁦2013⁩ دامەزرا؛ لە 2ی حوزەیرانی ⁦2026⁩ ناوی بوو بە CodeAIFree school courses, many with Blockly block puzzles; its Hour of Code is now the Hour of AIخولی بێبەرانبەری قوتابخانە، زۆریان بە مەتەڵی بلۆکی Blockly؛ Hour of Codeـەکەی ئێستا Hour of AIـە
A time line from 2007 to 2026. 2007: Scratch is released by the MIT Media Lab. 2010: App Inventor, built by Google, goes public. 2011: Blockly is started at Google. 2013: Code.org is founded. January 2019: Scratch 3.0, in the browser and on tablets. November 2025: Blockly moves to the Raspberry Pi Foundation. June 2026: Code.org becomes CodeAI.هێڵێکی کات لە 2007ـەوە بۆ 2026. 2007: MIT Media Lab Scratch بڵاو دەکاتەوە. 2010: App Inventor کە Google دروستی کردووە بڵاو دەبێتەوە. 2011: Blockly لە Google دەست پێ دەکات. 2013: Code.org دادەمەزرێت. کانوونی دووەمی 2019: Scratch 3.0، لە تۆڕگەڕ و تابلێتدا. تشرینی دووەمی 2025: Blockly دەچێتە دامەزراوەی Raspberry Pi. حوزەیرانی 2026: Code.org دەبێت بە CodeAI.
Block programming, 2007 to 2026.بەرنامەسازی بە ، لە ⁦2007⁩ تا ⁦2026⁩.CêIT

Block tools in 2026ئامرازەکانی بلۆک لە ⁦2026⁩دا

Scratch: sprites on a stageScratch: سپرایتەکان لەسەر شانۆ

Scratch was made by the Lifelong Kindergarten group at the MIT Media Lab and released in 2007. Since 2019 it has been run by the Scratch Foundation. It is free, it is aimed mainly at ages 8 to 16, and the foundation says about 200 million young people have created on it, with over a billion projects. Its editor, Scratch 3.0 (January 2019), runs in a web browser and on tablets.

Scratch لەلایەن گرووپی Lifelong Kindergarten لە MIT Media Lab دروست کرا و لە ⁦2007⁩ بڵاو کرایەوە. لە ⁦2019⁩ـەوە دامەزراوەی Scratch بەڕێوەی دەبات. بێبەرانبەرە، بە تایبەتی بۆ تەمەنی 8 تا ⁦16⁩ ساڵە و دامەزراوەکە دەڵێت نزیکەی ⁦200⁩ ملیۆن گەنج پڕۆژەیان تێدا دروست کردووە، زیاتر لە ملیارێک پڕۆژە. دەستکاریکەرەکەی، ⁦Scratch 3.0⁩ (کانوونی دووەمی ⁦2019⁩)، لە و کار دەکات.

A Scratch project has a stage, the background where everything happens, and sprites: characters or objects, each with its own costumes, sounds and scripts. The editor has three parts: the block palette on the left, the script area in the middle, where you snap blocks together, and the stage on the right.

پڕۆژەیەکی Scratch شانۆیەکی هەیە، ئەو پاشبنەمایەی هەموو شتێکی تێدا ڕوو دەدات و : کارەکتەر یان شت، هەر یەکە بە جل، دەنگ و بەشە کۆدی خۆی. دەستکاریکەرەکە سێ بەشی هەیە: سندوقی بلۆکەکان لە چەپ، ناوچەی کۆد لە ناوەڕاست کە تێدا بە یەکەوە دەلکێنیت و شانۆکە لە ڕاست.

A simple drawing of a block editor in three parts. Left, the palette with category dots and blocks. Middle, the script area with a script: when green flag clicked, then say Hello!, then a repeat 10 block holding move 10 steps. Right, the stage with a small round sprite and its x and y position; a sprite list below the stage shows two sprites.وێنەیەکی سادەی دەستکاریکەرێکی بلۆک بە سێ بەش. چەپ، سندوقی بلۆکەکان بە خاڵی پۆلەکان و بلۆکەکان. ناوەڕاست، ناوچەی کۆد بە بەشێک: when green flag clicked، پاشان say Hello!، پاشان بلۆکی repeat 10 کە move 10 steps لە ناوییەتی. ڕاست، شانۆکە بە سپرایتێکی خڕی بچووک و شوێنی x و yـی؛ لیستی سپرایتەکان لە ژێر شانۆکە دوو سپرایت پیشان دەدات.
Palette, script area, stage: the three parts of a block editor.سندوقی بلۆکەکان، ناوچەی کۆد، شانۆ: سێ بەشی دەستکاریکەرێکی بلۆک.CêIT

Block tools in 2026ئامرازەکانی بلۆک لە ⁦2026⁩دا

Blockly, App Inventor and CodeAIBlockly، App Inventor و CodeAI

Blockly is the engine behind many block tools. A developer adds it to a web page or app, chooses which blocks to offer and writes what code each block becomes. Scratch 3.0, MIT App Inventor, Microsoft MakeCode and Code.org all build on it. Google started Blockly in 2011; on 10 November 2025 it moved to the Raspberry Pi Foundation, and it stays free and open source (Apache 2.0).

Blockly بزوێنەری پشت زۆر ئامرازی بلۆکە. گەشەپێدەرێک دەیخاتە ناو پەڕەیەکی وێب یان ، دیاری دەکات کام پیشان بدرێن و دەنووسێت هەر دەبێت بە چ کۆدێک. ⁦Scratch 3.0⁩، MIT App Inventor، Microsoft MakeCode و ⁦Code.org⁩ هەموویان لەسەری بنیات نراون. Google لە ⁦2011 Blockly⁩ـی دەست پێ کرد؛ لە ⁦10⁩ی تشرینی دووەمی ⁦2025⁩ چووە دامەزراوەی Raspberry Pi و هێشتا بێبەرانبەر و ⁦(Apache 2.0)⁩.

MIT App Inventor builds real phone apps: you place buttons, labels and images on the screen in a Designer view, then program what they do in a Blocks view. MIT reports over 24 million learners in 195 countries and over 100 million apps. Code.org, renamed CodeAI in June 2026, offers free school courses with block puzzles; its yearly Hour of Code became the Hour of AI.

MIT App Inventor ڕاستەقینەی مۆبایل دروست دەکات: لە بەشی Designerـدا ، نووسین و وێنە لەسەر شاشەکە دادەنێیت، پاشان لە بەشی Blocksـدا دیاری دەکەیت چی بکەن. MIT دەڵێت زیاتر لە ⁦24⁩ ملیۆن فێرخواز لە ⁦195⁩ وڵاتدا بەکاری دەهێنن و زیاتر لە ⁦100⁩ ملیۆن دروست کراوە. ⁦Code.org⁩ کە لە حوزەیرانی ⁦2026⁩ ناوی بوو بە CodeAI، خولی بێبەرانبەری قوتابخانە بە مەتەڵی بلۆکی پێشکەش دەکات؛ Hour of Codeـی ساڵانەی بوو بە Hour of AI.

Blockly in the centre, drawn as a box of puzzle pieces. Arrows lead from it to the tools built on it: Scratch 3.0, MIT App Inventor, Microsoft MakeCode, Code.org now CodeAI, and your own app. A note says: Blockly is a library for developers; the apps are for learners.Blockly لە ناوەڕاستدا، وەک سندوقێکی پارچەی پازڵ کێشراوە. تیرەکان لێیەوە دەچن بۆ ئەو ئامرازانەی لەسەری بنیات نراون: Scratch 3.0، MIT App Inventor، Microsoft MakeCode، Code.org کە ئێستا CodeAIـە و ئەپی خۆت. تێبینییەک دەڵێت: Blockly کتێبخانەیە بۆ گەشەپێدەران؛ ئەپەکان بۆ فێرخوازانن.
One library, many block tools.یەک ، زۆر ئامرازی بلۆک.CêIT

Events: scripts that waitڕووداوەکان: بەشە کۆدی چاوەڕوان

Block programs are event-driven. A script does not simply run from the top of a file; it waits under its hat block until its event happens: the green flag is clicked, a key is pressed, the sprite is clicked, or a message arrives. One sprite can have several scripts, and they can run at the same time.

هەر بلۆکی بە کار دەکات. بەشێک هەروا لە سەری فایلێکەوە جێبەجێ نابێت؛ لە ژێر کڵاوەکەیدا چاوەڕێ دەکات تا ڕوو دەدات: کلیک لە ئاڵا سەوزەکە دەکرێت، دادەگیرێت، کلیک لە دەکرێت، یان پەیامێک دەگات. یەک دەتوانێت چەند بەشێکی هەبێت و دەتوانن لە یەک کاتدا کار بکەن.

Sprites talk to each other with messages: broadcast [game over] sends a message, and every script that starts with when I receive [game over] runs. The same idea, code that waits for an event, is how every button in every app works (listeners).

بە پەیام قسە لەگەڵ یەکتر دەکەن: broadcast [game over] پەیامێک دەنێرێت و هەر بەشێک کە بە when I receive [game over] دەست پێ دەکات جێبەجێ دەبێت. هەمان بیرۆکە، کۆدێک کە چاوەڕێی دەکات، ئەوەیە کە هەموو لە هەموو پێی کار دەکات (گوێگرەکان).

Three scripts of one sprite, each under its own hat block. 1: when green flag clicked, go to x 0 y 0, say Ready!. 2: when space key pressed, change y by 10. 3: when I receive game over, stop all. A fourth script of another sprite ends with broadcast game over, and an arrow carries the message to script 3. A note says: each script waits for its own event.سێ بەشی یەک سپرایت، هەر یەکە لە ژێر بلۆکی کڵاوی خۆیدا. 1: when green flag clicked، go to x 0 y 0، say Ready!. 2: when space key pressed، change y by 10. 3: when I receive game over، stop all. بەشێکی چوارەمی سپرایتێکی تر بە broadcast game over کۆتایی دێت و تیرێک پەیامەکە دەباتە بەشی 3. تێبینییەک دەڵێت: هەر بەشێک چاوەڕێی ڕووداوی خۆی دەکات.
Hat blocks wait; events and messages start them. کڵاو چاوەڕێ دەکەن؛ و پەیامەکان دەستیان پێ دەکەن.CêIT

One algorithm, three waysیەک ئەلگۆریزم، سێ شێوە

Blocks are one more way to write an algorithm. Here is a countdown — count from 10 down to 1, then say “Go!” — as blocks, as a flowchart (flowchart symbols) and as pseudocode. Each block matches one shape of the flowchart and one line of the pseudocode.

ڕێگایەکی ترن بۆ نووسینی . ئەمە ژماردنێکی پێچەوانەیە — لە ⁦10⁩ـەوە بۆ 1 بژمێرە، پاشان بڵێ «⁦Go!⁩» — بە ، بە (هێماکانی هێڵکاریی ڕەوت) و بە . هەر لەگەڵ یەک شێوەی و یەک دێڕی یەک دەگرێتەوە.

Three columns. Left, blocks: when green flag clicked; set count to 10; repeat until count = 0, holding say count, wait 1 seconds and change count by -1; then say Go!. Middle, the flowchart: Start, count ← 10, a diamond count = 0?, on No: output count, wait 1 second, count ← count − 1 and back to the diamond; on Yes: output Go! and End. Right, the pseudocode lines. Matching colours link each block to its shape and line.سێ ستوون. چەپ، بلۆکەکان: when green flag clicked؛ set count to 10؛ repeat until count = 0 کە say count، wait 1 seconds و change count by -1 لە ناویدایە؛ پاشان say Go!. ناوەڕاست، هێڵکاریی ڕەوتەکە: دەستپێک، count ← 10، ئەڵماسێک count = 0?، لەسەر نەخێر: count پیشان بدە، 1 چرکە چاوەڕێ بکە، count ← count − 1 و گەڕانەوە بۆ ئەڵماسەکە؛ لەسەر بەڵێ: Go! پیشان بدە و کۆتایی. ڕاست، دێڕەکانی نیمچەکۆد. ڕەنگە یەکسانەکان هەر بلۆکێک بە شێوە و دێڕەکەیەوە دەبەستن.
The same countdown as blocks, a flowchart and pseudocode.هەمان ژماردنی پێچەوانە بە ، و .CêIT
The countdown in pseudocodeژماردنی پێچەوانە بە نیمچەکۆدTEXT
START
count ← 10
REPEAT UNTIL count = 0
    OUTPUT count
    WAIT 1 SECOND
    count ← count − 1
END REPEAT
OUTPUT "Go!"
END
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 3

repeat until <(count) = (0)> checks first and stops as soon as the condition is true.

repeat until <(count) = (0)> سەرەتا دەپشکنێت و هەر کە ڕاست بوو دەوەستێت.

Lineدێڕی 6

change [count] by (-1): without it the loop would never end.

change [count] by (-1): بەبێ ئەمە هەرگیز کۆتایی نایەت.

Loops and decisions in blocksخولەکان و بڕیار بە بلۆک

C blocks hold other blocks. Scratch has three loops, repeat (10), forever and repeat until < >, and two decisions, if < > then and if < > then … else. The pointed slot takes a condition made with operators: comparisons such as <(score) > (10)> and the logic blocks and, or and not. C blocks can be put inside each other, a loop in a loop or an if in a loop, just like indented code.

C تر دەگرن. Scratch سێ هەیە، repeat (10)، forever و repeat until < > و دوو بڕیار، if < > then و if < > then … else. شوێنە تیژەکە وەردەگرێت کە بە دروست کراوە: بەراوردکردن وەک <(score) > (10)> و لۆجیکیی and، or و not. دەتوانیت C بخەیتە ناو یەکترەوە، لە ناو یان ifـێک لە ناو ، ڕێک وەک کۆدی بۆشاییدار.

A bouncing-ball script with labels. when green flag clicked, then a forever loop. Inside forever: move 5 steps, then an if then block whose pointed slot holds touching edge?; inside the if: turn 180 degrees. Labels point to the loop, the decision and the boolean condition, and the same lines are shown in pseudocode beside it: REPEAT FOREVER, MOVE 5, IF touching edge THEN, TURN 180, END IF, END REPEAT.بەشێکی تۆپی بازدەر بە ناونووسەوە. when green flag clicked، پاشان خولی forever. لە ناو forever: move 5 steps، پاشان بلۆکی if then کە شوێنە تیژەکەی touching edge?ـی تێدایە؛ لە ناو if: turn 180 degrees. ناونووسەکان ئاماژە بە خولەکە، بڕیارەکە و مەرجە بوولیانەکە دەکەن و هەمان دێڕەکان بە نیمچەکۆد لە تەنیشتیەوە نووسراون: REPEAT FOREVER، MOVE 5، IF touching edge THEN، TURN 180، END IF، END REPEAT.
A loop holding a decision: blocks next to pseudocode. کە بڕیارێکی تێدایە: لە تەنیشت .CêIT
BlockPseudocode
repeat (10)REPEAT 10 TIMES
foreverREPEAT FOREVER
repeat until <done>REPEAT UNTIL done
if <c> thenIF c THEN … END IF
if <c> then … elseIF c THEN … ELSE … END IF

How blocks become real codeبلۆکەکان چۆن دەبن بە کۆدی ڕاستەقینە

Behind each block there is text code. In Blockly every block has a small code generator: a function that returns that block's piece of code as text, and Blockly joins the pieces into a whole program. Blockly has five built-in generators, for JavaScript, Python, PHP, Lua and Dart, so the same blocks can become a program in any of them. Scratch works differently: it runs the blocks itself and never shows text code.

لە پشت هەر کۆدی نووسراو هەیە. لە Blocklyـدا هەر خۆی هەیە: بچووک کە پارچە کۆدی ئەو وەک دەق دەگەڕێنێتەوە و Blockly پارچەکان بە یەکەوە دەلکێنێت بۆ تەواو. Blockly پێنج ئامادەی هەیە، بۆ JavaScript، Python، PHP، Lua و Dart، بۆیە هەمان دەتوانن ببن بە بە هەر یەکێکیان. Scratch جیاوازە: خۆی جێبەجێ دەکات و هەرگیز کۆدی نووسراو پیشان نادات.

Left, two blocks: repeat 3 holding say Hello. An arrow labelled code generators: each block returns its own piece of code leads to two boxes on the right. JavaScript: a for loop with count from 0 to less than 3 that shows Hello. Python: for count in range(3), print Hello. A note says the same blocks become either language.چەپ، دوو بلۆک: repeat 3 کە say Helloـی تێدایە. تیرێک بە ناوی بەرهەمهێنەرەکانی کۆد: هەر بلۆکێک پارچە کۆدی خۆی دەگەڕێنێتەوە، دەچێتە دوو سندوقی لای ڕاست. JavaScript: خولێکی for کە count لە 0ـەوە تا کەمتر لە 3 دەڕوات و Hello پیشان دەدات. Python: for count in range(3)، print Hello. تێبینییەک دەڵێت هەمان بلۆکەکان دەبن بە هەر یەکێک لەو دوو زمانە.
One block stack, two languages: code of the kind Blockly's generators write.یەک کۆمەڵە ، دوو زمان: کۆدێک لەو جۆرەی Blockly دەینووسن.CêIT

You can watch this idea in CêIT's visual programming lab: every block you snap becomes one line of Python under the board, and that line lights up while the robot runs it. Solve a level there, then read the code your blocks wrote.

دەتوانیت ئەم بیرۆکەیە لە تاقیگەی بەرنامەسازیی دیدەیی CêIT ببینیت: هەر کە دەیلکێنیت دەبێت بە دێڕێک لە ژێر تەختەکەوە و ئەو دێڕە لە کاتێکدا جێبەجێی دەکات ڕووناک دەبێتەوە. ئاستێک لەوێ چارەسەر بکە، پاشان ئەو کۆدە بخوێنەرەوە کە نووسیویانە.

Project: a traffic lightپڕۆژە: گڵۆپی هاتوچۆ

Build a traffic light like the one at a crossroads in town: red, then green, then yellow, and again, without end. You can do it in Scratch with one sprite, or in any block tool.

گڵۆپێکی هاتوچۆ دروست بکە وەک ئەوەی لە چوارڕیانێکی شاردا هەیە: سوور، پاشان سەوز، پاشان زەرد و دیسان، بێ کۆتایی. دەتوانیت لە Scratchـدا بە یەک یان لە هەر ئامرازێکی بلۆکدا بیکەیت.

  1. Planپلان

    Write the algorithm in words first: show red for 5 seconds, green for 4 seconds, yellow for 1 second, and repeat for ever.

    سەرەتا بە وشە بنووسە: سوور بۆ 5 چرکە پیشان بدە، سەوز بۆ 4 چرکە، زەرد بۆ 1 چرکە و بۆ هەمیشە دووپاتەی بکەرەوە.

  2. Make the spriteسپرایتەکە دروست بکە

    Draw one sprite, Light, with three costumes: red, green and yellow.

    بە ناوی Light بکێشە بە سێ جل: سوور، سەوز و زەرد.

  3. Start on the green flagبە ئاڵا سەوزەکە دەست پێ بکە

    Drag when green flag clicked into the script area.

    when green flag clicked ڕابکێشە بۆ ناو ناوچەی کۆد.

  4. Add the loopخولەکە زیاد بکە

    Under it, snap a forever block: a traffic light never stops by itself.

    لە ژێرییەوە forever بلکێنە: گڵۆپی هاتوچۆ هەرگیز خۆی ناوەستێت.

  5. Fill the loopخولەکە پڕ بکەرەوە

    Inside forever, snap six blocks: switch costume to [red], wait (5) seconds, switch costume to [green], wait (4) seconds, switch costume to [yellow], wait (1) seconds.

    لە ناو foreverـدا شەش بلکێنە: switch costume to [red]، wait (5) seconds، switch costume to [green]، wait (4) seconds، switch costume to [yellow]، wait (1) seconds.

  6. Testتاقی بکەرەوە

    Click the green flag and time each colour with a clock. Is the order right? Does it start again with red?

    کلیک لە ئاڵا سەوزەکە بکە و کاتی هەر ڕەنگێک بە کاتژمێرێک بپێوە. ئایا ڕیزبەندییەکە دروستە؟ ئایا دیسان بە سوور دەست پێ دەکاتەوە؟

Animation of the finished script next to the light. The script is when green flag clicked, then forever holding switch costume to red, wait 5 seconds, switch costume to green, wait 4 seconds, switch costume to yellow, wait 1 seconds. Step by step, the running block is highlighted and the light shows the same colour: red for 5 seconds, green for 4, yellow for 1. In the last step the forever arrow is highlighted and the light is red again.
Animation of the finished script next to the light. The script is when green flag clicked, then forever holding switch costume to red, wait 5 seconds, switch costume to green, wait 4 seconds, switch costume to yellow, wait 1 seconds. Step by step, the running block is highlighted and the light shows the same colour: red for 5 seconds, green for 4, yellow for 1. In the last step the forever arrow is highlighted and the light is red again.
The running block and the light change together; forever starts again at red. کاراکە و گڵۆپەکە پێکەوە دەگۆڕێن؛ forever دیسان لە سوورەوە دەست پێ دەکاتەوە.CêIT

Project: a traffic lightپڕۆژە: گڵۆپی هاتوچۆ

Extend it: a sign for people on footفراوانکردن: نیشانەیەک بۆ ڕێبواران

Add a second sprite, Walk sign, with two costumes, a walking person and a standing person. Blocks move only their own sprite, so the light must tell the sign when to change, with messages. In the Light's loop, add broadcast [walk] right after switch costume to [red], and broadcast [stop] right after switch costume to [green]. The Walk sign gets two scripts: when I receive [walk] → switch costume to [walking], and when I receive [stop] → switch costume to [standing].

دووەم زیاد بکە، Walk sign، بە دوو جل: کەسێکی ڕۆیشتوو و کەسێکی وەستاو. تەنیا خۆیان دەجووڵێنن، بۆیە گڵۆپەکە دەبێت بە پەیام بە نیشانەکە بڵێت کەی بگۆڕێت. لە Lightـدا، ڕاستەوخۆ دوای switch costume to [red]، broadcast [walk] زیاد بکە و ڕاستەوخۆ دوای switch costume to [green]، broadcast [stop]. Walk sign دوو بەشی دەبێت: when I receive [walk] ← switch costume to [walking] و when I receive [stop] ← switch costume to [standing].

Left, the Light's loop with the two new blocks highlighted: broadcast walk after switch costume to red, and broadcast stop after switch costume to green. Two arrows carry the messages to the right, to the Walk sign's two scripts: when I receive walk, switch costume to walking; when I receive stop, switch costume to standing. Small pictures show the walking and standing person.چەپ، خولی Light بە دوو بلۆکە نوێیەکەوە کە ڕەنگیان جیاوازە: broadcast walk دوای switch costume to red و broadcast stop دوای switch costume to green. دوو تیر پەیامەکان دەبەن بۆ لای ڕاست، بۆ دوو بەشەکەی Walk sign: when I receive walk، switch costume to walking؛ when I receive stop، switch costume to standing. وێنەی بچووک کەسی ڕۆیشتوو و وەستاو پیشان دەدەن.
Two sprites in step, joined only by messages.دوو بە هاوکاتی، تەنیا بە پەیام بەیەکەوە بەستراون.CêIT

Limits of blocks, and moving on to textسنووری بلۆکەکان و چوونە سەر کۆدی نووسراو

  • Big programs grow huge. Hundreds of blocks fill the screen and are hard to read, search and reorganise.
  • Dragging is slower than typing once you know a language.
  • Harder to share and compare. Teams compare versions of text files line by line; block projects do not fit those tools well.
  • Fewer libraries and less control. Servers, phone apps and data science rely on the huge libraries of text languages.
  • گەورە زۆر گەورە دەبێت. سەدان شاشەکە پڕ دەکەنەوە و خوێندنەوە، گەڕان و ڕێکخستنەوەیان قورسە.
  • ڕاکێشان لە نووسین خاوترە هەر کە زمانێک فێر بوویت.
  • هاوبەشکردن و بەراوردکردنیان قورسترە. تیمەکان وەشانەکانی دەقی دێڕ بە دێڕ بەراورد دەکەن؛ پڕۆژەی بلۆکی بە باشی لەگەڵ ئەو ئامرازانەدا ناگونجێن.
  • کەمتر و کۆنترۆڵی کەمتر. ، مۆبایل و زانستی پشت بە زمانە نووسراوەکان دەبەستن.

Moving on is easier than it looks, because the ideas stay the same. In a study in two high-school classes, students began with either a block or a text version of the same tool for five weeks and then moved to Java; ten weeks later the differences between the two groups had faded (Weintrop and Wilensky, 2019). The CêIT lab helps the move by showing each block's line of Python. When you are ready, go on with the Python or Java track.

چوونە پێشەوە لەوە ئاسانترە کە دەردەکەوێت، چونکە بیرۆکەکان وەک خۆیان دەمێننەوە. لە توێژینەوەیەکدا لە دوو پۆلی ئامادەیی، خوێندکاران بۆ پێنج هەفتە بە وەشانی بلۆکی یان وەشانی نووسراوی هەمان ئامراز دەستیان پێ کرد و پاشان چوونە سەر Java؛ دە هەفتە دواتر جیاوازییەکانی نێوان دوو گرووپەکە کاڵ ببوونەوە (Weintrop و Wilensky، ⁦2019⁩). تاقیگەی CêIT بە پیشاندانی دێڕی هەر یارمەتیی ئەم گواستنەوەیە دەدات. کاتێک ئامادە بوویت، لە بەشی Python یان Java بەردەوام بە.

A path in three steps from left to right. 1, blocks only: Scratch, App Inventor. 2, blocks next to text: the CêIT blocks lab shows the line of Python for every block. 3, text code: the Python and Java tracks. Under the path: the ideas stay the same, sequence, loops, decisions, variables, functions and events.ڕێگایەک بە سێ هەنگاو لە چەپەوە بۆ ڕاست. 1، تەنیا بلۆک: Scratch، App Inventor. 2، بلۆک لە تەنیشت دەق: تاقیگەی بلۆکی CêIT بۆ هەر بلۆکێک دێڕی Pythonـەکەی پیشان دەدات. 3، کۆدی نووسراو: بەشەکانی Python و Java. لە ژێر ڕێگاکەدا: بیرۆکەکان وەک خۆیان دەمێننەوە، زنجیرە، خولەکان، بڕیار، گۆڕاوەکان، کردارەکان و ڕووداوەکان.
From blocks to text: the ideas travel with you.لە بۆ دەق: بیرۆکەکان لەگەڵت دێن.CêIT

Other kinds of visual programmingجۆرەکانی تری بەرنامەسازیی دیدەیی

Blocks are not the only visual way to program. In node-based tools a program is a graph: boxes, called nodes, joined by wires, and data or the order of the steps flows along the wires from node to node.

تاکە ڕێگای دیدەیی بەرنامەسازی نین. لە ئامرازەکانی گرافێکە: چوارگۆشەگەلێک بە ناوی ، کە بە وایەر بە یەکەوە بەستراون و یان ڕیزبەندیی هەنگاوەکان بە درێژایی وایەرەکان لە بۆ تر دەڕوات.

  • Unreal Engine Blueprints (Epic Games): a node-based way to build gameplay inside the Unreal Editor, so that designers can use ideas that are usually left to programmers (documentation for Unreal Engine 5.9).
  • Node-RED: “low-code programming for event-driven applications”, built on Node.js and started at IBM in 2013. You wire nodes together in the browser to collect, change and show data, often from IoT devices on a Raspberry Pi; the flows are saved as JSON.
  • LabVIEW (NI, now part of Emerson): engineers draw programs in the graphical language G, which runs as dataflow, to control instruments and build automated test systems.
  • Unreal Engine Blueprints ⁦(Epic Games)⁩: ڕێگایەکی نۆدی بۆ دروستکردنی یاری لە ناو Unreal Editorـدا، بۆ ئەوەی دیزاینەران ئەو بیرۆکانە بەکار بهێنن کە زۆرجار تەنیا بەرنامەسازان بەکاری دەهێنن (بەڵگەنامەکانی ⁦Unreal Engine 5.9⁩).
  • ⁦Node-RED⁩: «بەرنامەسازیی کەمکۆد بۆ ڕووداوخواز»، لەسەر ⁦Node.js⁩ دروست کراوە و لە ⁦2013⁩ لە IBM دەستی پێ کرد. لە بە وایەر دەبەستیتەوە بۆ کۆکردنەوە، گۆڕین و پیشاندانی ، زۆرجار لە ئامێرەکانی لەسەر Raspberry Pi؛ ڕەوتەکان وەک هەڵدەگیرێن.
  • LabVIEW (NI، کە ئێستا بەشێکە لە Emerson): ئەندازیاران بە زمانی وێنەیی G دەکێشن، کە وەک ڕەوتی کار دەکات، بۆ کۆنترۆڵکردنی ئامێرەکانی پێوان و دروستکردنی سیستەمی پشکنینی خۆکار.
A node graph for a greenhouse. A temperature sensor node sends the reading 36 °C along a wire to a node that asks: above 35?. From there one wire on yes goes to a send alert node, and another wire carries every reading to a chart node. Small dots on the wires show the data moving.گرافێکی نۆدی بۆ خانووی شووشە. نۆدی هەستەوەری گەرما خوێندنەوەی 36 °C بە وایەرێک دەنێرێت بۆ نۆدێک کە دەپرسێت: لە 35 زیاترە؟. لەوێوە وایەرێک لەسەر بەڵێ دەچێت بۆ نۆدی ناردنی ئاگادارکردنەوە و وایەرێکی تر هەموو خوێندنەوەیەک دەبات بۆ نۆدی هێڵکاری. خاڵە بچووکەکان لەسەر وایەرەکان جووڵەی دراوە پیشان دەدەن.
Nodes and wires: the data flows from left to right. و وایەر: لە چەپەوە بۆ ڕاست دەڕوات.CêIT

Common mistakesهەڵە باوەکان

MistakeهەڵەWhat to doچی بکەیت
“Blocks are not real programming.”« بەرنامەسازیی ڕاستەقینە نین.»They teach the same ideas as text code: sequence, decisions, loops, variables, events and functions. Only the way of writing differs.هەمان بیرۆکەکانی کۆدی نووسراو فێر دەکەن: زنجیرە، بڕیار، ، ، و . تەنیا شێوەی نووسینەکە جیاوازە.
A block meant to repeat sits under the C block, not in its mouth: it runs only once, after the loop. کە دەبێت دووپاتە ببێتەوە لە ژێر Cـەوەیە، نەک لە ناو دەمیدا: تەنیا یەک جار، دوای ، جێبەجێ دەبێت.Drag it into the mouth of the loop.ڕایبکێشە بۆ ناو دەمی .
A script with no hat block never starts.بەشێک کە کڵاوی نییە هەرگیز دەست پێ ناکات.Put an event block such as when green flag clicked on top. وەک when green flag clicked لە سەرەوە دابنێ.
forever used where the program must stop.بەکارهێنانی forever لە شوێنێکدا کە دەبێت بوەستێت.Use repeat until < > with the stop condition.repeat until < > بە وەستانەوە بەکار بهێنە.
Costume changes with no wait: you see only the last one.گۆڕینی جل بێ wait: تەنیا دواییەکەیان دەبینیت.Add wait (…) seconds between the changes.wait (…) seconds لە نێوان گۆڕانکارییەکاندا زیاد بکە.
Trying to move another sprite with your sprite's blocks.هەوڵدان بۆ جووڵاندنی تر بە خۆت.Blocks act on their own sprite; send a message with broadcast. لەسەر خۆیان کار دەکەن؛ بە broadcast پەیامێک بنێرە.

Exercisesڕاهێنانەکان

ExerciseڕاهێنانBlocks to pseudocodeلە بلۆکەوە بۆ نیمچەکۆد

Write this block script in pseudocode. What does it calculate?

ئەم بەشە بلۆکییە بە بنووسە. چی حیساب دەکات؟

The blocks, written as textبلۆکەکان، وەک دەق نووسراونTEXT
when green flag clicked
set [total] to (0)
repeat (5)
    ask [Mark?] and wait
    change [total] by (answer)
end
say ((total) / (5))
Show answerوەڵامەکە پیشان بدە
TEXT
START
total ← 0
REPEAT 5 TIMES
    INPUT mark
    total ← total + mark
END REPEAT
OUTPUT total ÷ 5
END

It reads five marks and outputs their average, the same algorithm as the average of five marks. ask [Mark?] and wait is the input and (answer) is the value typed in.

پێنج نمرە دەخوێنێتەوە و تێکڕاکەیان پیشان دەدات، هەمان وەک تێکڕای پێنج نمرە. ask [Mark?] and wait و (answer) ئەو نرخەیە کە نووسراوە.

ExerciseڕاهێنانFind the bugباگەکە بدۆزەرەوە

Dilan wants a sprite to walk in a ring: ten short steps, turning a little after each one. Instead, it walks in a straight line and turns once at the end. Why, and how do you fix it?

Dilan دەیەوێت بە بازنەیەکدا بڕوات: دە هەنگاوی کورت و دوای هەر یەکێک کەمێک بسووڕێتەوە. لە جیاتی ئەوە، بە هێڵێکی ڕاستدا دەڕوات و لە کۆتاییدا یەک جار دەسووڕێتەوە. بۆچی و چۆن چاکی دەکەیتەوە؟

TEXT
when green flag clicked
repeat (10)
    move (20) steps
end
turn (36) degrees
Show answerوەڵامەکە پیشان بدە

turn (36) degrees is under the C block, not inside it, so it runs once after the ten steps. Drag it into the mouth of repeat (10), under move (20) steps. Then each pass moves and turns, and ten turns of 36° make a full ring of 360°.

turn (36) degrees لە ژێر Cـەوەیە، نەک لە ناویدا، بۆیە دوای دە هەنگاوەکە یەک جار جێبەجێ دەبێت. ڕایبکێشە بۆ ناو دەمی repeat (10)، لە ژێر move (20) steps. ئەو کاتە هەر خولێک دەڕوات و دەسووڕێتەوە و دە سووڕانەوەی ⁦36°⁩ بازنەیەکی تەواوی ⁦360°⁩ دروست دەکەن.

ExerciseڕاهێنانTwo sprites, one scoreدوو سپرایت، یەک خاڵ

In a quiz game, the Teacher sprite asks a question. When the answer is right, a Score board sprite must add 1 to the score. Write the scripts of both sprites in block text.

لە یارییەکی پرسیار و وەڵامدا، Teacher پرسیارێک دەکات. کاتێک وەڵامەکە ڕاست بێت، Score board دەبێت 1 بۆ خاڵەکە زیاد بکات. بەشەکانی هەردوو بە دەقی بلۆک بنووسە.

Hintئاماژە

Use broadcast in one sprite and when I receive in the other.

لە broadcast و لە ئەویتردا when I receive بەکار بهێنە.

Show answerوەڵامەکە پیشان بدە
TEXT
// Teacher
when green flag clicked
ask [5 + 7 = ?] and wait
if <(answer) = (12)> then
    say [Right!]
    broadcast [correct]
else
    say [Try again]
end

// Score board
when green flag clicked
set [score] to (0)

when I receive [correct]
change [score] by (1)

The Teacher does not touch the score; it only announces correct. The Score board owns the variable and reacts to the message.

Teacher دەست لە خاڵەکە نادات؛ تەنیا correct ڕادەگەیەنێت. Score board خاوەنی و وەڵامی پەیامەکە دەداتەوە.

ExerciseڕاهێنانChoose the toolئامرازەکە هەڵبژێرە

Which tool fits each job: Scratch, MIT App Inventor, Blockly or Node-RED? (a) A 10-year-old's first animated story. (b) A shop owner's simple Android app that lists prices. (c) A company adding a block editor to its robot-kit website. (d) Sending an alert from a Raspberry Pi when a greenhouse is hotter than 35 °C.

کام ئامراز بۆ هەر کارێک گونجاوە: Scratch، MIT App Inventor، Blockly یان ⁦Node-RED⁩؟ ⁦(a)⁩ یەکەم چیرۆکی جووڵاوی منداڵێکی ⁦10⁩ ساڵان. ⁦(b)⁩ سادەی Android بۆ خاوەن دووکانێک کە نرخەکان پیشان دەدات. ⁦(c)⁩ کۆمپانیایەک کە دەستکاریکەرێکی بلۆک دەخاتە سەر کەرەستەی . ⁦(d)⁩ ناردنی ئاگادارکردنەوە لە Raspberry Piـیەکەوە کاتێک خانووی شووشە لە ⁦35 °C⁩ گەرمتر دەبێت.

Show answerوەڵامەکە پیشان بدە
  • (a) Scratch: sprites, costumes and sounds for stories.
  • (b) MIT App Inventor: real phone apps from blocks.
  • (c) Blockly: a library for putting a block editor into their own site.
  • (d) Node-RED: wire a sensor node to a check node and an alert node.
  • ⁦(a) Scratch⁩: ، جل و دەنگ بۆ چیرۆک.
  • ⁦(b) MIT App Inventor⁩: ڕاستەقینەی مۆبایل بە .
  • ⁦(c) Blockly⁩: بۆ دانانی دەستکاریکەرێکی بلۆک لە خۆیاندا.
  • ⁦(d) Node-RED⁩: بە پشکنین و ئاگادارکردنەوە ببەستەرەوە.
ExerciseڕاهێنانFrom the lab to pseudocodeلە تاقیگەوە بۆ نیمچەکۆد

Open the visual programming lab and solve level 3 with as few blocks as you can. Then write your solution in pseudocode, and match each block to a line of the Python the lab shows.

تاقیگەی بەرنامەسازیی دیدەیی بکەرەوە و ئاستی 3 بە کەمترین کە دەتوانیت چارەسەر بکە. پاشان چارەسەرەکەت بە بنووسە و هەر لەگەڵ دێڕێک لەو تاقیگەکە پیشانی دەدات یەک بخەرەوە.

Show answerوەڵامەکە پیشان بدە
TEXT
REPEAT 6 TIMES
    MOVE FORWARD
END REPEAT

Two blocks are enough: the robot stands six squares from the flag, facing it. The repeat block becomes the loop line of the Python view and move forward becomes the indented line inside it, which is exactly one line per block.

دوو بەسە: شەش خانە لە ئاڵاکەوە دوورە و ڕووی تێیەتی. repeat دەبێت بە دێڕی لە بەشی و move forward دەبێت بە دێڕە بۆشاییدارەکەی ناویدا، کە ڕێک یەک دێڕە بۆ هەر .

Summaryپوختە

  • Visual programming builds programs from pictures; block-based tools snap command blocks together, so there are no syntax errors.
  • Shapes show where a block fits: hat, stack, C, reporter, boolean, cap. Categories and colours group them.
  • Scratch (Scratch Foundation), Blockly (Raspberry Pi Foundation since November 2025), MIT App Inventor and Code.org, now CodeAI, are the best-known tools in 2026.
  • Block programs are event-driven: hat blocks wait for events, and sprites cooperate through messages.
  • Blocks, flowcharts and pseudocode can show the same algorithm; Blockly's code generators turn blocks into JavaScript, Python, PHP, Lua or Dart.
  • Blocks reach their limits with big programs; the ideas carry over to text languages. Node-based tools (Blueprints, Node-RED, LabVIEW) are another kind of visual programming.
  • لە وێنە دروست دەکات؛ ئامرازەکانی بلۆک فەرمان بە یەکەوە دەلکێنن، بۆیە هەڵەی نییە.
  • شێوەکان پیشان دەدەن لە کوێ جێی دەبێتەوە: کڵاو، فەرمان، C، ڕاپۆرتەر، ، کۆتایی. پۆل و ڕەنگەکان کۆیان دەکەنەوە.
  • Scratch (دامەزراوەی Scratch)، Blockly (دامەزراوەی Raspberry Pi لە تشرینی دووەمی ⁦2025⁩ـەوە)، MIT App Inventor و ⁦Code.org⁩ کە ئێستا CodeAIـە، ناسراوترین ئامرازەکانن لە ⁦2026⁩دا.
  • هەر بلۆکی بە کار دەکات: کڵاو چاوەڕێی دەکەن و بە پەیام هاوکاری دەکەن.
  • ، و دەتوانن هەمان پیشان بدەن؛ Blockly دەکەن بە JavaScript، Python، PHP، Lua یان Dart.
  • لەگەڵ گەورەدا دەگەنە سنووری خۆیان؛ بیرۆکەکان دەگوازرێنەوە بۆ زمانە نووسراوەکان. ئامرازەکانی (Blueprints، ⁦Node-RED⁩، LabVIEW) جۆرێکی تری .
Review questionsپرسیارەکانی پێداچوونەوە
Why do block tools help beginners?بۆچی ئامرازەکانی بلۆک یارمەتیی نوێکاران دەدەن؟

Nothing has to be typed or remembered: every command is visible, and shapes stop wrong combinations, so beginners can focus on the logic.

هیچ شتێک پێویست ناکات بنووسرێت یان لەبیر بێت: هەموو دیارە و شێوەکان ڕێگە لە تێکەڵکردنی هەڵە دەگرن، بۆیە نوێکاران دەتوانن سەرنج بخەنە سەر لۆجیکەکە.

How does a block become code in Blockly?لە Blocklyـدا بلۆکێک چۆن دەبێت بە کۆد؟

Each block type has a code generator for each language, a function that returns its piece of code; Blockly joins the pieces.

هەر جۆرە بۆ هەر زمانێک هەیە، کە پارچە کۆدەکەی دەگەڕێنێتەوە؛ Blockly پارچەکان بە یەکەوە دەلکێنێت.

Practise in the visual programming lab, then start a language track: Python or Java.

لە تاقیگەی بەرنامەسازیی دیدەییدا ڕاهێنان بکە، پاشان دەست بە بەشێکی زمان بکە: Python یان Java.

Lesson complete!وانەکە تەواو بوو!

Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.

Key termsزاراوە سەرەکییەکان

References and further readingسەرچاوەکان و خوێندنەوەی زیاتر

This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.

Appearanceڕووکار

Modeدۆخ
Styleشێواز
Coloursڕەنگەکان

Saved on this device only.تەنیا لەسەر ئەم ئامێرە پاشەکەوت دەکرێت.