]> git.xonotic.org Git - xonotic/gmqcc.git/blob - tests/rassign.qc
Merge remote-tracking branch 'origin/master' into cooking
[xonotic/gmqcc.git] / tests / rassign.qc
1 float f_float() {
2     return = 100.0f;
3     return = 200.0f;
4     return;
5 }
6
7 vector f_vector() {
8     vector foo;
9     foo.x = f_float();
10     foo.y = f_float();
11     foo.z = f_float();
12
13     return = foo;
14     return;
15 }
16
17 string f_string() {
18 #ifndef FAIL_TEST
19     return = "hello";
20     return = "world";
21 #endif
22     return;
23 }
24
25 float factorial(float n) {
26     if (n == 0) return = 1;
27     else        return = n * factorial(n - 1);
28 }
29
30 void main() {
31     print(ftos(f_float()), "\n");  // 200.0f
32     print(vtos(f_vector()), "\n"); // '1 2 3'
33     print(f_string(), "\n");       // world
34     print(ftos(factorial(4)), "\n"); // 24
35 }