Closed jaggedblades closed 1 year ago
The io.write
function is not redirected to any web display, but you can try print
instead. The following code should give you the expected result.
res = {}
print_summation = (nums) ->
sum = 0
for i, num in ipairs nums
sum += num
res[] = num
if i == #nums
res[] = " = "
res[] = sum
return
res[] = " + "
print_summation {1, 2, 3, 4, 5}
print table.concat res
Can you make io.write redirect to the web display?
Yes, you can clear the cache and try it again now.
Alright, thanks 👍
When running the following in the online compiler:
Nothing gets printed, when it should print:
Same issue when running it in the original moonscript online compiler http://moonscript.org/compiler/