For looking at the structure beneath:
@debug
For changing float numbers' precision:
@precision x
, where x
is precision
If you need to print something:
print( "something" )
To compile text while writing in terminal
~
To make executable file from imported one:
chmod 755 maffin_mac
or chmod 755 maffin_linux
THIS MAY CAUSE A PROBLEM
func lol{
if (get(Args, 0) == 0){ return 1; }
return lol(get(Args, 0)-1)+lol(get(Args, 0)-1); //here
}
print(lol(2));
~
BECAUSE "lol(get(Args, 0)-1)" should be in brackets like this "(lol(get(Args, 0)-1))", so this is correct:
func lol{
if (get(Args, 0) == 0){ return 1; }
return lol(get(Args, 0)-1)+(lol(get(Args, 0)-1)); //here
}
print(lol(2));
~
it's because of the AST structure, all priorities depends only on brackets and order.
:
structure | set() | get() | push() | pop() | insert() | erase() | size |
---|---|---|---|---|---|---|---|
array | O(1) | O(1) | - | - | - | - | O(n) |
stack | O(1) | O(1) | O(1) | O(1) | - | - | O(n) |
skiplist | O(logn) | O(logn) | - | - | O(logn) | O(logn) | O(nlogn) |
:
skiplist lst;
insert(lst, 5, 0);
insert(lst, 6, 0);
print(get(lst, 0));
print(get(lst, 1));
print(sizeof(lst));
print(capacity(lst));
erase(lst, 0);
print(get(lst, 0));
print(sizeof(lst));
print(capacity(lst));
~
RETURNS
6
5
3
6
5
2
6
stack a;
push(a, 5);
push(a, 6);
push(a, 10);
print(get(a, 0));
print(get(a, 1));
print(get(a, 2));
set(a, 2, 0);
print(get(a, 0));
pop(a);
push(a, 100);
print(get(a, 2));
~
RETURNS
5
6
10
2
100
int i = 0;
while (i < 4){
print(i);
int u = 1;
i = i+u;
}
~
RETURNS
0
1
2
3
V 0.8 (for
loop with one argument) // it was extremely easy because everything for loop I already had
int a = 0;
for (a < 3){
a = a+1;
print(a);
}
~
RETURNS
1
2
3
4
func loop{
if (get(Args, 0) == 6) { return 0; }
int i = get(Args, 0);
print(i);
print(sizeof(Args));
print();
loop(i+1);
return 0;
}
loop(0);
~
RETURNS
0
1
1
1
2
1
3
1
4
1
5
1
func loop{
print(get(Args, 0));
if (get(Args, 0) == get(Args, 1)) { return 0; }
loop(get(Args, 0)+1, get(Args, 1));
return 0;
}
loop(0, 6);
~
RETURNS
0
1
2
3
4
5
6
if ((3 > 2) || (3 < 2)){
print(228);
}
if ((3 > 2) && (3 < 2)){
print(822);
}
~
RETURNS
228
if (3 > 2)
{
print(3);
}
~
RETURNS
3
if (3 < 2)
{
print(100);
}
if (3 > 2)
{
print(50);
}
~
RETURNS
50
print(3 < 2);
print(3 <= 2);
print(3 > 2);
print(3 >= 2);
print(3 == 2);
print(2 < 2);
print(2 <= 2);
print(2 > 2);
print(2 >= 2);
print(2 == 2);
~
RETURNS
0
0
1
1
0
0
1
0
1
1
int a = 35;
int b = a+100;
print(b < a);
print(b > a);
~
RETURNS
0
1
It's little bit complicated thing, the point is that all the arguments
of the function are represented as an Args
array, so when you are passing
any argument, to access them type get(Args, 'index' )
, where 'index'
is an int
value. (V3 and V3.5 are permanently changed)
func lol{
return get(Args, 0)+5;
}
print(lol(9));
~
RETURNS
14
int glob = 10;
func f
{
int u = get(Args, 0);
int v = get(Args, 1);
glob = glob + u + v;
return 0;
}
print(f(5, 9));
print(glob);
~
RETURNS
0
24
Here is no function with name lol
, so it's just generating a container
of variables.
print(lol(5, 9));
print(5, 9);
print((5, 9));
~
RETURNS
0 5 9
5 9
5 9
array a[30];
set(a, 100, 3);
int lol = get(a, 3);
print(lol);
~
RETURNS
100
func rec{
a = a + 1;
rec(a);
return a;
}
int a = 3;
rec(a);
~
RETURNS
nothing because infinite recursion
func lol {
return 32+2;
}
print(lol());
~
RETURNS
34
func lol {
a = a + 3;
return a;
}
int a = 2;
lol(a);
print(a);
a = lol(a);
print(a);
~
RETURNS
2
5
int kek = 100;
func lol {
kek = kek + 1;
a = a + 1;
return 5;
}
int a = 3;
print(lol(a));
print(kek);
print(a);
~
RETURNS
5
101
3
As you can see, a
variable hasn't changed because it was not in global scope,
to apply to a
all alterations it should be coded a = lol(a);
int a = print(3);
print(a);
~
RETURNS
3
3
@debug
@precision 30
float a = 32.3423;
print(a);
~
RETURNS
a(3) 13(2) 32.3423(3) =(2) (1)
print(2) a(3) ((2) (1)
(0)
32.3423000000000016029844118748
@debug
int ok = 3;
int op = 2;
print(ok+op);
~
RETURNS
ok 0 3 =
op 0 2 =
print ok op + (
5
@debug
int lol = 2+3-4;
print(lol-3);
~
RETURNS
lol 0 2 3 + 4 - =
print lol 3 - (
-2