When your code is wrong, the server gives you a clue hinting at what's wrong in the original code.
It doesn't know what's wrong in the code you submitted... it is not understanding deeply what's wrong with your code. It's not some huge multi-terabyte language model analyzing arbitrary code, or whatever.
It just knows your code is wrong and gives you a clue so you can try again.
I also came to a solution very similar to the sibling comment here. I'd love to see why this doesn't work server-side but does work on my machine. What other tests are you running aside from checking each decrement is correct?
Might I recommend appropriate debugging output? It would save the mystery and back and forth. Not everyone who uses your site has access to you on HN. :)
func below(n uint64, to chan uint64) {
for ; n >= 0; n-- {
var t = n - 1
to <- n
}
close(to)
}
I've run this locally with to <- n replaced with a print statement and it works with unsigned integers.
On my machine I used this code:
The actual code I put into the bugfix site was: but when writing this comment I went back and didn't modify the for loop to be a while.