2013-05-29 11:13:42 +00:00
|
|
|
float f_float() {
|
|
|
|
return = 100.0f;
|
|
|
|
return = 200.0f;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
vector f_vector() {
|
2013-05-29 11:29:52 +00:00
|
|
|
vector foo;
|
|
|
|
foo.x = f_float();
|
|
|
|
foo.y = f_float();
|
|
|
|
foo.z = f_float();
|
2013-05-29 14:58:18 +00:00
|
|
|
|
2013-05-29 11:29:52 +00:00
|
|
|
return = foo;
|
2013-05-29 11:13:42 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
string f_string() {
|
2013-05-29 15:01:26 +00:00
|
|
|
#ifndef FAIL_TEST
|
2013-05-29 11:13:42 +00:00
|
|
|
return = "hello";
|
|
|
|
return = "world";
|
2013-05-29 15:01:26 +00:00
|
|
|
#endif
|
2013-05-29 11:13:42 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-05-29 14:58:18 +00:00
|
|
|
float factorial(float n) {
|
|
|
|
if (n == 0) return = 1;
|
|
|
|
else return = n * factorial(n - 1);
|
|
|
|
}
|
|
|
|
|
2013-05-29 11:13:42 +00:00
|
|
|
void main() {
|
|
|
|
print(ftos(f_float()), "\n"); // 200.0f
|
|
|
|
print(vtos(f_vector()), "\n"); // '1 2 3'
|
|
|
|
print(f_string(), "\n"); // world
|
2013-05-29 14:58:18 +00:00
|
|
|
print(ftos(factorial(4)), "\n"); // 24
|
2013-05-29 11:13:42 +00:00
|
|
|
}
|