func factorial(x int) (result int) { if x == 0 { result = 1; } else { result = x * factorial(x - 1); } return; }