Skip to content

rep's in ANN-Lang

Latest
Compare
Choose a tag to compare
@dazaizer0 dazaizer0 released this 27 Sep 19:57
· 18 commits to main since this release

The "return x;" function has been replaced to "rep x;"
Example:

mod main [ ->
    cre int a 10; ->
    a /= 5; ->
    out a; ->

]start; ->
rep 5;

Result:

2.0
2.0
2.0
2.0
2.0

New prototype loop function:

  1. Rule 1. if we change x<-(rep number) at the "rep" function at the end of the code to, for example, 2<-(rep number), all functions such as "out" will be repeated 2<-(rep number) times;
  2. Rule 2. If we want functions such as adding two numbers to be repeated. You should add the "rep()" function right after the action, which will perform the action x<-(rep number) times.

Examples:

mod main [ ->
    cre int a 1; ->
    a += 2 rep(); ->
    out a; ->

]start; ->
rep 3;

Result:

7
7
7

Multiplication doesn't work correctly yet