Log in

No account? Create an account
color cycle (slow)

Kistaro Windrider, Reptillian Situation Assessor

Unfortunately, I Really Am That Nerdy

Previous Entry Share Next Entry
ACM Considered Harmful
color cycle (slow)
So yesterday, I recieved the ACM Qualification Challenges: three questions to solve before Wednesday night to qualify for Washington University's ACM team. I have two solutions, and I think I just finished my third one. ("All" I have left is to debug, and we all know how quick that is!)

But I have committed a terrible crime against programmers everywhere. I need to be shot. Or maybe maimed. Possibly both. And it would probably be honorable to commit hara-kiri.

I just used a goto in C++, y'see.

edited to add:
treasuremaps.cc:135: warning: do not use goto --g++

  • 1
No, it's not so bad. In a speed-based situation where you need to, say, exit multiple loops simultaneously, goto's are great. I use them without hesitation in TopCoder, at least.

For that, I'd use break with a label. It's still a goto, honestly, but people don't hate you for it.

I thought C++ didn't allow labeled breaks/continues - only Java. Hence the use of gotos in such situations.

I suspect you're correct; it's likely negative transfer from Java.

LOL! I love the reference in your subject. Good luck on the competition.

/me jealous, never participated in such competitions way back when, causing current lack of ability at other things.

*boils up a pot of spaghetti code to lash you with*

10K lashes with a wet noodle!

  • 1