3 ms·
i would've wanted to see the simple ackermann function visualized, but the recursion isn't allowed to be deep enough! function ack(x: number, y: number): n
by chii 3y ago
i would've wanted to see the simple ackermann function visualized, but the recursion isn't allowed to be deep enough!
function ack(x: number, y: number): number {
if (x === 0) return y + 1;
if (y === 0) return ack(x-1, 1);
return ack(x - 1, ack(x, y-1))
}