Hacker News new | ask | show | jobs
by bugfix-66 1335 days ago
Show me your code, that you think is correct, and the server rejects.

I'll tell you what's wrong with your code.

1 comments

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.
Did you make other changes besides `to <- n` becoming print? Because as it stands, that will still produce an infinite loop.
Oh, yes. The for loop init should be "; n > 0; n--"