Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,16 @@
import std/[unicode, strformat]
func sudan(n, x, y: Natural): int =
if n == 0: return x + y
if y == 0: return x
let z = sudan(n, x, y - 1)
return sudan(n - 1, z, z + y)
const Delta = ord("".toRunes()[0]) - ord('0')
func subscript(n: Natural): string =
for c in $n:
result.add Rune(ord(c) + Delta)
for (n, x, y) in [(0, 0, 0), (1, 1, 1), (2, 1, 1), (2, 2, 1), (2, 2, 2), (3, 1, 1)]:
echo &"F{subscript(n)}({x}, {y}) = {sudan(n, x, y)}"