9 billion names of God the integer: Difference between revisions

(→‎{{header|Lua}}: added Lua solution)
Line 919:
 
<lang Dyalect>var cache = [[1]]
 
func min(x, y) {
if x < y {
x
} else {
y
}
}
 
func namesOfGod(n) {
for l in cache.len()..n {
var r = [0]
forif xl in== 1..l {
r.add(r[r.len() - 1] + cache[l - x0][min(x, l-x)0])
if x < y } else {
for x in 1..l {
r.add(r[r.len() - 1] + cache[l - x][min(x, l-x)])
x }
}
cache.add(r)
Anonymous user