RosettaCodeData/Task/Man-or-boy-test/Pluto/man-or-boy-test-1.pluto
2026-04-30 12:34:36 -04:00

16 lines
329 B
Text

local fmt = require "fmt"
function a(k, x1, x2, x3, x4, x5)
local function b()
k -= 1
return a(k, b, x1, x2, x3, x4)
end
return k <= 0 ? x4() + x5() : b()
end
function f(n) return || -> n end
print(" k a")
for k = 0, 17 do
fmt.print("%2d : % d", k, a(k, f(1), f(-1), f(-1), f(1), f(0)))
end