2012-08-18 18:16:51 +00:00
|
|
|
/* this is the WIP test for the parser...
|
|
|
|
* constantly adding stuff here to see if things break
|
|
|
|
*/
|
|
|
|
void(string) print = #1;
|
|
|
|
void(string,string) print2 = #1;
|
|
|
|
void(string,string,string) print3 = #1;
|
|
|
|
string(float) ftos = #2;
|
|
|
|
entity() spawn = #3;
|
|
|
|
void(entity) kill = #4;
|
|
|
|
|
2012-08-18 18:30:24 +00:00
|
|
|
.void(string x) printit;
|
|
|
|
|
2012-08-18 18:16:51 +00:00
|
|
|
float(vector different_name, vector b) dot;
|
|
|
|
|
|
|
|
float(vector a, vector b) dot = {
|
|
|
|
return a * b;
|
|
|
|
};
|
|
|
|
|
2012-08-18 18:30:24 +00:00
|
|
|
void(string x) myprintit = {
|
|
|
|
print3("-> ", x, "\n");
|
|
|
|
};
|
|
|
|
|
2012-08-19 12:34:23 +00:00
|
|
|
void(vector par) vecpar = {
|
|
|
|
// vector-parameters need _x, _y, _z as well
|
|
|
|
print3("par_y should be 5... = ", ftos(par_y), "\n");
|
|
|
|
};
|
|
|
|
|
2012-08-18 18:16:51 +00:00
|
|
|
void() main = {
|
2012-08-18 18:30:24 +00:00
|
|
|
local entity pawn;
|
2012-08-18 18:16:51 +00:00
|
|
|
print3("should be 1: ", ftos(dot('1 1 0', '1 0 0')), "\n");
|
2012-08-18 18:30:24 +00:00
|
|
|
|
|
|
|
pawn = spawn();
|
|
|
|
pawn.printit = myprintit;
|
|
|
|
pawn.printit("Hello");
|
2012-08-19 12:34:23 +00:00
|
|
|
|
|
|
|
vecpar('1 5 9');
|
2012-08-18 18:16:51 +00:00
|
|
|
};
|