]> de.git.xonotic.org Git - xonotic/gmqcc.git/blob - tests/length.qc
5abe769cc5b18bedc6cf1d253a59152f75bea899
[xonotic/gmqcc.git] / tests / length.qc
1 const string a = "hello world"; // 11
2 float b[] = { 1, 2, 3 };        // 3
3 float c[5] = { 5, 4, 3, 2, 1 }; // 5
4 const float d[] = { 1 };        // 1
5
6 void main() {
7     print(ftos(length a), "\n"); // 11
8     print(ftos(length b), "\n"); // 3
9     print(ftos(length c), "\n"); // 5
10     print(ftos(length d), "\n"); // 1
11
12     static float al = length(a);
13     static float bl = length(b);
14     static float cl = length(c);
15     static float dl = length(d);
16
17     print(ftos(al), "\n"); // 11
18     print(ftos(bl), "\n"); // 3
19     print(ftos(cl), "\n"); // 5
20     print(ftos(dl), "\n"); // 1
21
22     print(ftos(length "hello world"), "\n"); // 11
23 }