Hash :
e9b856c8
Author :
Date :
2021-11-22T12:59:08
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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
function my_add a b = a + b
fn factorial n = if n <= 0 then 1 else n * factorial (n - 1)
mapped function rand_color x =
x.wireColor = random (color 0 0 0) (color 255 255 255)
fn starfield count extent:[200,200,200] pos:[0,0,0] =
(
-- something
)
fn saddle x y = sin x * sin y
print "build math mesh"
in_name = getOpenFileName()
val.x=random -100 100
append vert_array (readValue in_file)
while not eof f do
on pressme pressed do print "Pressed!"
----------------------------------------------------
[
["keyword", "function"],
["function-definition", "my_add"],
" a b ",
["operator", "="],
" a ",
["operator", "+"],
" b\r\n\r\n",
["keyword", "fn"],
["function-definition", "factorial"],
" n ",
["operator", "="],
["keyword", "if"],
" n ",
["operator", "<="],
["number", "0"],
["keyword", "then"],
["number", "1"],
["keyword", "else"],
" n ",
["operator", "*"],
["function-call", "factorial"],
["punctuation", "("],
"n ",
["operator", "-"],
["number", "1"],
["punctuation", ")"],
["keyword", "mapped"],
["keyword", "function"],
["function-definition", "rand_color"],
" x ",
["operator", "="],
"\r\n x",
["punctuation", "."],
"wireColor ",
["operator", "="],
["function-call", "random"],
["punctuation", "("],
["function-call", "color"],
["number", "0"],
["number", "0"],
["number", "0"],
["punctuation", ")"],
["punctuation", "("],
["function-call", "color"],
["number", "255"],
["number", "255"],
["number", "255"],
["punctuation", ")"],
["keyword", "fn"],
["function-definition", "starfield"],
" count ",
["argument", "extent"],
["punctuation", ":"],
["punctuation", "["],
["number", "200"],
["punctuation", ","],
["number", "200"],
["punctuation", ","],
["number", "200"],
["punctuation", "]"],
["argument", "pos"],
["punctuation", ":"],
["punctuation", "["],
["number", "0"],
["punctuation", ","],
["number", "0"],
["punctuation", ","],
["number", "0"],
["punctuation", "]"],
["operator", "="],
["punctuation", "("],
["comment", "-- something"],
["punctuation", ")"],
["keyword", "fn"],
["function-definition", "saddle"],
" x y ",
["operator", "="],
["function-call", "sin"],
" x ",
["operator", "*"],
["function-call", "sin"],
" y\r\n\r\n",
["function-call", "print"],
["string", "\"build math mesh\""],
"\r\nin_name ",
["operator", "="],
["function-call", "getOpenFileName"],
["punctuation", "("],
["punctuation", ")"],
"\r\nval",
["punctuation", "."],
"x",
["operator", "="],
["function-call", "random"],
["operator", "-"],
["number", "100"],
["number", "100"],
["function-call", "append"],
" vert_array ",
["punctuation", "("],
["function-call", "readValue"],
" in_file",
["punctuation", ")"],
["keyword", "while"],
["keyword", "not"],
["function-call", "eof"],
" f ",
["keyword", "do"],
["keyword", "on"],
" pressme pressed ",
["keyword", "do"],
["function-call", "print"],
["string", "\"Pressed!\""]
]