Tyl Programming Language
▶ LOOPING BY INDEX
Looping by index is the repeating of code execution for a set number of times.

Looping by index format:
[INDEX] [RANGE] ~
Consider this code:
sum 0

index 4 ~
 num index + 1
 sum ++ num
print sum
1
3
6
10
In line: 'index 4 ~', index will be a local numeric variable of the looping statement, and the value: 4, is the range. The index will get the numbers from zero until 4 (not including 4): 0, 1, 2, 3.
In the repeat block, index variable will be used, and each time it will have a different value.
The code in the repeat block is summing the numbers: 1, 2, 3, 4. Each time the sum is printed.

The above looping statement can be written in one line:
sum 0

index 4 ~ print sum ++ index + 1
Average Calculator:
sum 0
numbers_len 4

index numbers_len ~ sum ++ index + 1

print sum / numbers_len
2.5


PART 1
PART 3