-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.brash
52 lines (41 loc) · 872 Bytes
/
main.brash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
global z = 3;
function fibo(n)
if n <= 1
then
return n;
endif;
return fibo(n-1) + fibo(n-2);
endfunction;
function calc(a, i)
return a + i;
print("coucou, mon return est coupe circuit.");
endfunction;
function add()
print("qbdqdfq");
endfunction;
a = calc(1, 2);
print("Variable a:", a);
tab = [];
append(tab, 2);
append(tab, [1, 4]);
print("Tableau tab après deux append :", tab);
remove(tab, 2);
print("Tableau tab après un remove :", tab);
if a == 3
then
print("La variable a est égale à 3.");
else
print("EN fait non");
endif;
b, c = 2, 3;
print("Variable b:", b, "Variable c:", c);
for i = 0; i < 10; i++
do
print("Calcul de", i, "+ 2 * i:", calc(i, 2 * i));
endfor;
print(fibo(10));
print(tab);
print(tab);
add();
calculus = "1 + 2 * 3";
print("Résultat de eval avec(", calculus, "):", eval(calculus));