mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-26 21:21:34 +00:00
perl ops -> pops
This commit is contained in:
parent
b3e87c3280
commit
9cff2f7b8a
2 changed files with 26 additions and 0 deletions
19
tests/pops.qc
Normal file
19
tests/pops.qc
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
void main() {
|
||||||
|
/* so far only one perl operator is implemented */
|
||||||
|
float x = 100;
|
||||||
|
float y = 200;
|
||||||
|
float z = 300;
|
||||||
|
|
||||||
|
/* to ensure runtime */
|
||||||
|
x += 1;
|
||||||
|
y += 1;
|
||||||
|
z += 1;
|
||||||
|
|
||||||
|
float test_x = (x <=> x + 1); // -1 less than
|
||||||
|
float test_y = (x <=> x); // 0 equal
|
||||||
|
float test_z = (x <=> x - 1); // 1 greater than
|
||||||
|
|
||||||
|
print(ftos(test_x), "\n");
|
||||||
|
print(ftos(test_y), "\n");
|
||||||
|
print(ftos(test_z), "\n");
|
||||||
|
}
|
7
tests/pops.tmpl
Normal file
7
tests/pops.tmpl
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
I: pops.qc
|
||||||
|
D: test perl operators
|
||||||
|
T: -execute
|
||||||
|
C: -std=gmqcc
|
||||||
|
M: -1
|
||||||
|
M: 0
|
||||||
|
M: 1
|
Loading…
Reference in a new issue