Loops and iterations - IUrixl/Kova GitHub Wiki

Repeat

A repeat loop not intended to be used with iterator, its iterator variable will always be %%A and cannot be changed.

Basic Syntaxis

repeat <init> <limit> -> {
	
}

Arguments

Argument Definition
Init Init of the range iterator
Limit Limit that the iterator must reach

Example of use

define main -> {
	repeat 0 10 -> {
		print "This is a loop"
	}
}

Pointer loop

Using unsafe labels AKA "codePointers" to make custom and unsafe loops within safe labels.

Example of use

define main -> {
	.unsafe
		print "Unsafe loop"
	point unsafe
}

Fast stack addition and subtraction

Just like C++ you can add or substract 1 from a variable typing less.

Basic Syntaxis

++ <variable>

-- <variable>

Arguments

Argument Definition
Variable Name of the variable to modify

Example of use

define main -> {
	var x 20
	// Sum 15 times 1 to x
	repeat 0 15 -> {
		++ x
	}
	print "%x%"
	// Substact 25 times 1 to x
	repeat 0 25 -> {
		-- x
	}
	print "%x%"
}
⚠️ **GitHub.com Fallback** ⚠️