Skip to content

Instruction 5000 REPEAT

HoverCatz edited this page Mar 8, 2024 · 1 revision

This will REPEAT either the previous or the next instruction once.


Arguments:

  • before - Bool (required)
    true -- will repeat the instruction infront of this one
    false -- will repeat the instruction after this one

Example 1:

	STRING 'Hello'
	REPEAT true
	OUT_ALL

In the example above, we add Hello to the stack once, then we repeat that once more.

Resulting stack: ${[\space\color{#947cdd}'Hello'\space\color{white}, \space\color{#947cdd}'Hello'\color{white}\space]}$

Resulting output: HelloHello


Example 2:

	REPEAT false
	STRING 'Hello'
	OUT_ALL

In the example above, we tell the STRING instruction below to repeat once, resulting in it being added once, then we execute the STRING instruction as usual, resulting in it being added twice in total.

Resulting stack: ${[\space\color{#947cdd}'Hello'\space\color{white}, \space\color{#947cdd}'Hello'\color{white}\space]}$

Resulting output: HelloHello

Clone this wiki locally