Skip to content

Commit e6597de

Browse files
bruter updated to 0.2.8
1 parent d991a98 commit e6597de

File tree

5 files changed

+273
-44
lines changed

5 files changed

+273
-44
lines changed

bruter/example/img.br

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
using img;

bruter/example/test.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,14 @@
22
#bruter -c test.br -o test.br.o # Compile the test.br as a static library
33
#bruter -c test.br -o test.br.so # Compile the test.br as a shared library
44
bruter txt.br # just interpret the txt.br file
5-
#bruter
65
bruter scopes.br --debug # interpret the scopes.br file in debug mode
7-
#bruter
86
bruter --debug luapi.br # the order of the arguments doesn't matter when using flags, except for the -o flag
9-
#bruter
107
bruter -o test compiling.br --debug # Compile the compiling.br file into a executable called test
11-
#bruter
128
bruter --debug conditions.br
13-
#bruter
149
bruter types.br
15-
#bruter
1610
bruter --debug fakemodules.br
17-
#bruter
1811
bruter --debug loop.br
19-
#bruter
2012
bruter --debug roguelike.br
13+
bruter --debug functions.br
14+
bruter --debug img.br
2115
./test # Run the test executable

bruter/lib/luatils/init.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ util.time = function(func, ...)
6565
return result, tclock
6666
end
6767

68-
randi = 1
68+
util.randi = 1
6969

7070
util.random = function(min, max)
71-
math.randomseed(os.time() + randi)
72-
randi = randi + math.random(1, 40)
71+
math.randomseed(os.time() + util.randi)
72+
util.randi = util.randi + math.random(1, 40)
7373
return math.random(min, max)
7474
end
7575

bruter/libr/img.br

Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
// this lib does nothing;
2+
set tokens from [];
3+
4+
set rgb (lua.eval {
5+
return (function(r,g,b)
6+
return {r=r or 0,g=g or 0,b=b or 0}
7+
end)});
8+
9+
set img from [];
10+
11+
set , (lua.eval {
12+
13+
return (function(r,g,b,value)
14+
br.tokens[value] = {r,g,b};
15+
end)});
16+
17+
// lua utils _array;
18+
, 1 128 1 utils.array.slice;
19+
, 1 128 2 utils.array.organize;
20+
, 1 128 3 utils.array.expand;
21+
, 1 128 4 utils.array.new;
22+
, 1 128 5 utils.array.random;
23+
, 1 128 6 utils.array.minmax;
24+
, 1 128 7 utils.array.sum;
25+
, 1 128 8 utils.array.tostring;
26+
27+
//lua utils _matrix;
28+
, 1 128 9 utils.matrix.includes;
29+
, 1 128 10 utils.matrix.new;
30+
, 1 128 11 utils.matrix.tostring;
31+
, 1 128 12 utils.matrix.minmax;
32+
, 1 128 13 utils.matrix.unique;
33+
, 1 128 14 utils.matrix.average;
34+
, 1 128 15 utils.matrix.map;
35+
, 1 128 16 utils.matrix.reduce;
36+
, 1 128 17 utils.matrix.filter;
37+
38+
//lua utils _console;
39+
, 1 128 18 utils.console.colors.black;
40+
, 1 128 19 utils.console.colors.reset;
41+
, 1 128 20 utils.console.colors.red;
42+
, 1 128 21 utils.console.colors.green;
43+
, 1 128 22 utils.console.colors.yellow;
44+
, 1 128 23 utils.console.colors.blue;
45+
, 1 128 24 utils.console.colors.magenta;
46+
, 1 128 25 utils.console.colors.cyan;
47+
, 1 128 26 utils.console.colors.white;
48+
, 1 128 27 utils.console.colorstring;
49+
, 1 128 28 utils.console.boldstring;
50+
, 1 128 29 utils.console.randomcolor;
51+
, 1 128 30 utils.console.movecursor;
52+
53+
//lua utils _encode_old;
54+
, 1 128 31 utils.encode.shuffleTable;
55+
, 1 128 32 utils.encode.invertlabel;
56+
, 1 128 33 utils.encode.encrypt;
57+
, 1 128 34 utils.encode.decrypt;
58+
, 1 128 35 utils.encode.base64Encode;
59+
, 1 128 36 utils.encode.base64Decode;
60+
, 1 128 37 utils.encode.save;
61+
, 1 128 38 utils.encode.load;
62+
63+
//lua utils _encode;
64+
, 1 128 39 utils.encode.genKey;
65+
, 1 128 40 utils.encode.encrypt;
66+
, 1 128 41 utils.encode.decrypt;
67+
68+
//lua utils file;
69+
, 1 128 42 utils.file.list;
70+
, 1 128 43 utils.file.isdir;
71+
, 1 128 44 utils.file.load.text;
72+
, 1 128 45 utils.file.save.text;
73+
, 1 128 46 utils.file.save.intMap;
74+
, 1 128 47 utils.file.load.charMap;
75+
, 1 128 48 utils.file.save.charMap;
76+
, 1 128 49 utils.file.load.map;
77+
, 1 128 50 utils.file.exist;
78+
, 1 128 51 utils.file.check;
79+
80+
//lua utils _math;
81+
, 1 128 52 utils.math.regrad3;
82+
, 1 128 53 utils.math.scale;
83+
, 1 128 54 utils.math.vec2;
84+
, 1 128 55 utils.math.vec2add;
85+
, 1 128 56 utils.math.vec2sub;
86+
, 1 128 57 utils.math.vec2div;
87+
, 1 128 58 utils.math.vec2mod;
88+
, 1 128 59 utils.math.vec2mul;
89+
, 1 128 60 utils.math.vec3;
90+
, 1 128 61 utils.math.vec3add;
91+
, 1 128 62 utils.math.vec3sub;
92+
, 1 128 63 utils.math.vec3div;
93+
, 1 128 64 utils.math.vec3mod;
94+
, 1 128 65 utils.math.vec3mul;
95+
, 1 128 66 utils.math.limit;
96+
, 1 128 67 utils.math.rotate;
97+
, 1 128 68 utils.math.primo;
98+
, 1 128 69 utils.math.mmc;
99+
100+
//lua utils _string;
101+
, 1 128 70 utils.string.endsWith;
102+
, 1 128 71 utils.string.charAt;
103+
, 1 128 72 utils.string.byteAt;
104+
, 1 128 73 utils.string.split;
105+
, 1 128 74 utils.string.split2;
106+
, 1 128 75 utils.string.split3;
107+
, 1 128 76 utils.string.replace;
108+
, 1 128 77 utils.string.replace3;
109+
, 1 128 78 utils.string.includes;
110+
, 1 128 79 utils.string.trim;
111+
, 1 128 80 utils.string.firstWord;
112+
113+
//lua utils _table;
114+
, 1 128 81 utils.table.assign;
115+
, 1 128 82 utils.table.len;
116+
, 1 128 83 utils.table.add;
117+
, 1 128 84 utils.table.sub;
118+
, 1 128 85 utils.table.mul;
119+
, 1 128 86 utils.table.div;
120+
, 1 128 87 utils.table.mod;
121+
, 1 128 88 utils.table.merge;
122+
, 1 128 89 utils.table.recurse;
123+
, 1 128 90 utils.table.keys;
124+
, 1 128 91 utils.table.move;
125+
, 1 128 92 utils.table.find;
126+
, 1 128 93 utils.table.sort;
127+
, 1 128 94 utils.table.unpack;
128+
, 1 128 95 utils.table.clone;
129+
, 1 128 96 utils.table.map;
130+
, 1 128 97 utils.table.filter;
131+
, 1 128 98 utils.table.reduce;
132+
, 1 128 99 utils.table.includes;
133+
, 1 128 100 utils.table.clear;
134+
, 1 128 101 utils.table.selfClear;
135+
136+
//lua utils init;
137+
, 1 128 102 utils.isjit;
138+
, 1 128 103 utils.luaversion;
139+
, 1 128 104 utils.time;
140+
, 1 128 105 utils.randi;
141+
, 1 128 106 utils.random;
142+
, 1 128 107 utils.roleta;
143+
, 1 128 108 utils.id;
144+
, 1 128 109 utils.assign;
145+
, 1 128 110 utils.len;
146+
, 1 128 111 utils.turn;
147+
, 1 128 112 utils.load;
148+
, 1 128 113 utils.unix;
149+
, 1 128 114 utils.isDumpable;
150+
, 1 128 115 utils.stringify;
151+
, 1 128 116 utils.visufy;
152+
, 1 128 117 utils.visualtable;
153+
, 1 128 118 utils.repeater;
154+
, 1 128 119 utils.agendar;
155+
156+
//br.lua br
157+
158+
, 1 128 120 global;
159+
, 1 128 121 exports;
160+
, 1 128 122 vm.version;
161+
, 1 128 123 vm.source;
162+
, 1 128 124 vm.outputpath;
163+
, 1 128 125 vm.bruterpath;
164+
, 1 128 126 vm.debug;
165+
, 1 128 127 vm.debugmode;
166+
, 1 128 128 vm.oneliner;
167+
, 1 128 129 this;
168+
, 1 128 130 vm.preprocessors.sugar;
169+
, 1 128 131 vm.safe;
170+
, 1 128 132 +;
171+
, 1 128 133 -;
172+
, 1 128 134 *;
173+
, 1 128 135 /;
174+
, 1 128 136 %;
175+
, 1 128 137 <;
176+
, 1 128 138 >;
177+
, 1 128 139 ==;
178+
, 1 128 140 !=;
179+
, 1 128 141 includes;
180+
, 1 128 142 exists;
181+
, 1 128 143 vm.parsearg;
182+
, 1 128 144 vm.parseargs;
183+
, 1 128 145 vm.parseargsoptimized;
184+
, 1 128 146 vm.preprocess;
185+
, 1 128 147 vm.debugprint;
186+
, 1 128 148 vm.parsecmd;
187+
, 1 128 149 vm.parse;
188+
, 1 128 150 vm.runoptimized;
189+
, 1 128 151 vm.optimize;
190+
, 1 128 152 repl;
191+
, 1 128 153 breakpoint;
192+
, 1 128 154 export;
193+
, 1 128 155 using;
194+
, 1 128 156 bruter.include;
195+
, 1 128 157 bruter.eval;
196+
, 1 128 158 lua.eval;
197+
, 1 128 159 lua.include;
198+
, 1 128 160 lua.require;
199+
, 1 128 161 C.include;
200+
, 1 128 162 C.eval;
201+
, 1 128 163 vm.recursiveset;
202+
, 1 128 164 vm.recursiveget;
203+
, 1 128 165 vm.recursivegetref;
204+
, 1 128 166 vm.setvalue;
205+
, 1 128 167 vm.setfrom;
206+
, 1 128 168 vm.fakesetfrom;
207+
, 1 128 169 vm.fakeset;
208+
, 1 128 170 set;
209+
, 1 128 171 obj;
210+
, 1 128 172 return;
211+
, 1 128 173 :;
212+
, 1 128 174 string;
213+
, 1 128 175 help;
214+
, 1 128 176 print;
215+
, 1 128 177 [];
216+
, 1 128 178 if;
217+
, 1 128 179 !;
218+
, 1 128 180 while;
219+
, 1 128 181 each;
220+
, 1 128 182 for;
221+
, 1 128 183 function;
222+
, 1 128 184 and;
223+
, 1 128 185 or;
224+
, 1 128 186 len;
225+
, 1 128 187 shortcut;
226+
227+
228+
set , nil;

0 commit comments

Comments
 (0)