We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd7382b commit 951d6c9Copy full SHA for 951d6c9
program.own
@@ -62,4 +62,23 @@ print arr[4][1] + "\n"
62
63
print "\n\n"
64
array = newarray(2, 2, 2, 2)
65
-print array
+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
83
+ print function(functions[i], 6, 3)
84
+}
0 commit comments