User talk:Chunes: Difference between revisions
Content added Content deleted
(→"Code review" for Plain English: input refactor) |
|||
Line 32: | Line 32: | ||
\Calling the routine |
\Calling the routine |
||
Put 5 into a number. Factorialize the number. |
Put 5 into a number. Factorialize the number. |
||
Write "" then the number on the console.</lang> |
Write "" then the number on the console.</lang> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
Start up. |
Start up. |
||
Demonstrate input. |
Demonstrate input. |
||
Line 52: | Line 51: | ||
Repeat.</lang> |
Repeat.</lang> |
||
:The idea is putting the loop entirely inside the <code>To demonstrate input:</code> routine so that you don't need any global flags. This can be done concisely with <code>Repeat.</code> by itself at the end of the routine. The loop will begin again from the top of the routine. I also used <code>repeat</code> when a negative number is encountered to act like a <code>continue</code> does in most other languages. --[[User:Chunes|Chunes]] ([[User talk:Chunes|talk]]) 17:03, 25 September 2020 (UTC) |