rust/src/test/run-pass/tail-direct.rs
2010-06-23 21:03:09 -07:00

25 lines
257 B
Rust

// -*- rust -*-
fn main() {
check(even(42));
check(odd(45));
}
fn even(int n) -> bool {
if (n == 0) {
ret true;
}
else {
be odd(n - 1);
}
}
fn odd(int n) -> bool {
if (n == 0) {
ret false;
}
else {
be even(n - 1);
}
}