katster: (surreal)
[personal profile] katster
I had to write a recursive program that would take a string and return it backwards. For example, if I put in java, it would need to return avaj.

I spent the last twenty minutes chasing the bug that made garage print as "egarag". Until it dawns on me that if you slice the e off garage, it's a palindrome, and that's not printing as last letter rest of word, it's printing the right answer. :P

Twenty minutes chasing a non-bug. I'm slipping.

Date: 2002-12-04 01:52 am (UTC)
From: [identity profile] tropism.livejournal.com
No, that pretty much happens whenever you're up late working on a program. You enter in data that gives you what you think is an error, but it doesn't...and hten you spend a while chasing down a problem that didn't actually exist. ;)

Date: 2002-12-05 12:10 pm (UTC)
From: [identity profile] fearghaill.livejournal.com
I had to come up with a similar program on a test a while back. We had to write a program that checked to see if a string was a palindrome. My idea was to shove it into an array (easier by far to invert than strings, IMO), invert said array using a for loop, and then compare the two arrays to see if they were the same.

Unfortunately, I never got to see if this worked, as it was on a written test that he never got around to handing back.

Oh, and for the record, handwritten coding tests are a pain in the ass, an evil matched only by the Java language itself!

...gods, I miss the good ol' days of learning C++...

its good to know that I'm not alone amongst my friends in suffering the curse that is Java lessons. Although I am deeply, deeply sorry that you have to go through this too kat ;)

Note

My main blog is kept at retstak.org. I mirror posts to this Dreamwidth account, so feel free to read and comment either here or there.

November 2020

S M T W T F S
1234 567
891011121314
15161718192021
22232425262728
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 15th, 2026 05:24 pm
Powered by Dreamwidth Studios