aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/examples/dump_factorial.v
blob: 9b5fc0feb988c504ffad1177137d51ee58b50b32 (plain)
1
2
3
4
5
6
7
8
9
10
fn factorial(n u32) u32 {
	if dump(n <= 1) {
		return dump(1)
	}
	return dump(n * factorial(n - 1))
}

fn main() {
	println(factorial(5))
}