Hacker News new | past | comments | ask | show | jobs | submit login

Show me your code, that you think is correct, and the server rejects.

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




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--"




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: