Skip to content
← Back to glossary

繰返しIteration

Learn in the textbookControl Structures and Notation Methods

DefinitionIteration (繰返し) is a control structure that runs the same block of steps (the body, 本体) again and again while checking a condition; it is also called a loop (ループ).

ExplanationDepending on where the condition is checked, there is the pre-test loop (前判定), which checks before the steps, and the post-test loop (後判定), which checks after them. A condition can be written as a continuation condition (継続条件), which keeps the loop going while it holds, or as a termination condition (終了条件), which exits once it holds. For a loop with a set number of passes, you specify the variable's initial value (初期値), increment (増分), and final value (終値).

AnalogyIt is like climbing stairs: check whether there is another step above, climb it if there is, and stop when none are left.

Memory hookA loop is literally a ring, and in a diagram drawn with a decision the arrow curves back up like one, so the same range is passed through again.

真

偽

処理の開始

継続条件は真か

処理を実行

繰返しを終了

Related past-exam questions(17 questions)