2 string ftos (float) = #2;
4 float test_s_not (vector s) { return !s; }
5 float test_s_and (vector s, vector t) { return s && t; }
6 float test_s_or (vector s, vector t) { return s || t; }
7 float test_s_if (vector s) { if (s) return 1; return 0; }
8 float test_s_ifnot(vector s) { if not (s) return 1; return 0; }
10 void test(vector s, vector t) {
11 print(ftos(!!test_s_not (s)), " ");
12 print(ftos(!!test_s_and (s, t)), " ");
13 print(ftos(!!test_s_or (s, t)), " ");
14 print(ftos(!!test_s_if (s)), " ");
15 print(ftos(!!test_s_ifnot(s)), "\n");
19 print(" ! & | i N\n");
20 print("0, 0 -> "); test('0 0 0', '0 0 0');
21 print("0, x -> "); test('0 0 0', '1 0 0');
22 print("x, 0 -> "); test('1 0 0', '0 0 0');
23 print("x, x -> "); test('1 0 0', '1 0 0');
24 print("0, y -> "); test('0 0 0', '0 1 0');
25 print("y, 0 -> "); test('0 1 0', '0 0 0');
26 print("y, y -> "); test('0 1 0', '0 1 0');