Skip to content

Commit 951d6c9

Browse files
committed
Обновлён пример
1 parent cd7382b commit 951d6c9

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

program.own

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,23 @@ print arr[4][1] + "\n"
6262

6363
print "\n\n"
6464
array = newarray(2, 2, 2, 2)
65-
print array
65+
print array
66+
67+
add = def(a,b) return a+b
68+
sub = def(a,b) return a-b
69+
mul = def(a,b) return a*b
70+
div = def(a,b) return a/b
71+
cube = def(x) return x*mul(x, x)
72+
print "\n\n"
73+
print mul(8, 5)
74+
print "\n"
75+
print cube(2)
76+
77+
functions = [add, sub, mul, div]
78+
def function(f, a, b) return f(a, b)
79+
for i = 0, i < 4, i = i + 1 {
80+
print "\n"
81+
print functions[i]
82+
print "\n"
83+
print function(functions[i], 6, 3)
84+
}

0 commit comments

Comments
 (0)