mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-21 18:30:52 +00:00
Pushing my current testcode
This commit is contained in:
parent
abc574289f
commit
ae5dba3e0b
1 changed files with 50 additions and 0 deletions
50
data/parsing.qc
Normal file
50
data/parsing.qc
Normal file
|
@ -0,0 +1,50 @@
|
|||
/* 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;
|
||||
|
||||
.float mema;
|
||||
.float memb;
|
||||
|
||||
void() main = {
|
||||
entity pawn;
|
||||
vector vec;
|
||||
float a;
|
||||
|
||||
vec = '3 4 5';
|
||||
vec_z = 5;
|
||||
|
||||
a = 5;
|
||||
|
||||
if (a) {
|
||||
print("a != 0\n");
|
||||
} else {
|
||||
print("not a\n");
|
||||
}
|
||||
|
||||
a = 19;
|
||||
print("Hello, World\n");
|
||||
|
||||
pawn = spawn();
|
||||
pawn.mema = 3;
|
||||
pawn.memb = 5;
|
||||
print2(ftos(pawn.mema), "\n");
|
||||
print2(ftos(pawn.memb), "\n");
|
||||
|
||||
print("SECOND TEST\n");
|
||||
for (a = 0; a < 3; a = a + 1) {
|
||||
print3("LOOP ", ftos(a), "\n");
|
||||
}
|
||||
|
||||
print("DO-WHILE test\n");
|
||||
a = 2;
|
||||
do {
|
||||
print("Foo\n");
|
||||
a = a - 1;
|
||||
} while (a);
|
||||
};
|
Loading…
Reference in a new issue