]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - tests/rassign.qc
Merge branch 'cooking'
[xonotic/gmqcc.git] / tests / rassign.qc
index f734e7eb5597dae8d28fc089c44c81da2d9b2acd..5c72e6f52fa3df9175ccf6fa52b719e3b249a367 100644 (file)
@@ -5,19 +5,31 @@ float f_float() {
 }
 
 vector f_vector() {
-    return = '1 2 3';
-    return = '2 3 4';
+    vector foo;
+    foo.x = f_float();
+    foo.y = f_float();
+    foo.z = f_float();
+
+    return = foo;
     return;
 }
 
 string f_string() {
+#ifndef FAIL_TEST
     return = "hello";
     return = "world";
+#endif
     return;
 }
 
+float factorial(float n) {
+    if (n == 0) return = 1;
+    else        return = n * factorial(n - 1);
+}
+
 void main() {
     print(ftos(f_float()), "\n");  // 200.0f
     print(vtos(f_vector()), "\n"); // '1 2 3'
     print(f_string(), "\n");       // world
+    print(ftos(factorial(4)), "\n"); // 24
 }