Sudan function: Difference between revisions
m
Corrected an error in the function name.
(Created Nim solution.) |
m (Corrected an error in the function name.) |
||
Line 1,264:
<syntaxhighlight lang="Nim">import std/[unicode, strformat]
func
if n == 0: return x + y
if y == 0: return x
let z =
return
const Delta = ord("₀".toRunes()[0]) - ord('0')
Line 1,277:
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}) = {
</syntaxhighlight>
|