Data update

This commit is contained in:
Ingy döt Net 2025-02-27 18:35:13 -05:00
parent 8e4e15fa56
commit 72eb4943cb
1853 changed files with 35514 additions and 9441 deletions

View file

@ -0,0 +1,14 @@
def sudan (n, x : UInt64, y : UInt64)
if n == 0
x + y
elsif y == 0
x
else
s = sudan(n, x, y-1)
sudan(n-1, s, s + y)
end
end
[{0, 0, 0}, {1, 1, 1}, {2, 1, 1}, {2, 2, 1}, {2, 2, 2}, {3, 1, 1}].each do |n, x, y|
puts "sudan #{n} (#{x}, #{y}) = #{sudan(n, x.to_u64, y.to_u64)}"
end

View file

@ -0,0 +1,12 @@
fun F ← int by int n, int x, int y
if n æ 0
return x + y
else if y æ 0
return x
end
return F(n - 1, F(n, x, y - 1), F(n, x, y - 1) + y)
end
writeLine("F(1, 3, 3) ← ", F(1, 3, 3))
writeLine("F(2, 1, 1) ← ", F(2, 1, 1))
writeLine("F(3, 1, 1) ← ", F(3, 1, 1))
writeLine("F(2, 2, 1) ← ", F(2, 2, 1))