- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Drink up; throw up;
Admin
It might be the only way to bring skynet down.
Admin
The guy is learning how to program. I thought we avoided classroom submissions -- we've all done stupid stuff in class.
Also, java is not an acronym.
Admin
Admin
Yeah, Java Ain't Verifiably Acronymic!
I also thought the most amusing part of this code chunk was the evaluation "if (male == female)". Next we will start questioning the impact metrosexuality has on people's ability to logically evaluate.
Admin
Admin
no WTF's since 02.02. What happened to the world ?
Admin
Admin
about time-pressure leading to "bad code" being sent in for an assignment....
In my first programming class, they wanted us to learn how to work with pointers. So the assignment was something like: read a file with datarecords, store them in memory, and then sort them.
The whole idea here is to swap the pointers and not the data around while you're sorting.
After messing around with that for over 10 minutes, I couldn't get it to work by swapping the pointers. (I kept getting the equivalent of what is now a segfault) So I swapped the whole data-records. I knew I could get it to work, as I'd already done much more complicated things with pointers. I just didn't want to spend the time on the stupid assignment. The TA didn't notice. Problem solved.
Admin
John Connor? I've been looking for his mother. I'm a friend of Sarah Connor...
Admin
I'm surprised no one has pointed out yet that the student has apparently neglected to learn about loops, yet takes the time to apologise for making his program a heaping heap of excrement. Manure. Post-consumer nourishment. Sewage. Crap. SHIT!
So deep down somewhere he understands that loops would've been required to get something reasonable done. He knows this, yet elects not to even try. It's like the catholic who goes and stabs his neighbour so he'd have something to confess about.
Admin
Well, I could give you many such examples (not from a CS student, though). I remember a highschool colleague which coded a "Five in a row" game in VB in a simmilar fashion. It was back in 2000 when all we had was a AMD K6-2 at 500MHz. The code was so big it wouldn't compile on our processors :) He had to ask a more wealthy friend who had a (top of the line) 900MHz processor to compile the program. Which, btw, worked just fine, unlike the one in the article.
Admin
This reminds me of a programming competition I was in once. My team consisted of high school students who had never taken a computer course, let alone a programming course, whereas our competitors were all AP Comp Sci students. We destroyed them all anyway, but there was one team that stood out.
One of the problems was to take a number as input, and print it out in English: 705 => Seven Hundred And Five It had to work for all numbers between 1 and 1000. Of course, this wasn't a very hard problem, and if it weren't for having our solution fail for having extra whitespace(!), we would have had it done in 10 minutes. This other team spent the entire 4 hours on the problem, and produced a 4000 line C++ program, with each possible number and output enumerated. They submitted it near the end, but it failed.
Admin
The comment: //WHY OH WHY DID I MAKE THIS A SINGLE LINE!?!?
The line: inline bool Life(int x, int y){return ((((map[x+(((x==19)-20)+1)][y+(((y==19)-20)+1)]+map[x+(((x==19)-20)+1)][y]+map[x+(((x==19)-20)+1)][y-(((y==0)-20)+1)]+map[x][y+(((y==19)-20)+1)]+map[x][y-(((y==0)-20)+1)]+map[x-(((x==0)-20)+1)][y+(((y==19)-20)+1)]+map[x-(((x==0)-20)+1)][y]+map[x-(((x==0)-20)+1)][y-(((y==0)-20)+1)])==3))||((map[x+(((x==19)-20)+1)][y+(((y==19)-20)+1)]+map[x+(((x==19)-20)+1)][y]+map[x+(((x==19)-20)+1)][y-(((y==0)-20)+1)]+map[x][y+(((y==19)-20)+1)]+map[x][y-(((y==0)-20)+1)]+map[x-(((x==0)-20)+1)][y+(((y==19)-20)+1)]+map[x-(((x==0)-20)+1)][y]+map[x-(((x==0)-20)+1)][y-(((y==0)-20)+1)])==2&&(map[x][y])));};
There were not one but two bugs in that horror, so I guess Coding Karma reared it's head.
Admin
Oh god...
Reading that almost successfully tempted me to pour my cup of coffee in my face...