The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

Warning: Long post begging for help with Java by wisteria4562003-03-18 18:56:29
  The answer, perhaps? by saxguy02 2003-03-18 21:35:39
I believe the villain of this is in three parts. The first part is in the "isPalindrome()" function - you don't reset boopal to true at the beginning of it. So if a value makes it through the function being a palindrome, it doesn't change the current value of boopal - but it is still false. To fix this, add at the beginning of the function "boopal = true;"

The second villain is also in the "isPalindrome()" function. When you run the function, it tests the input to see if it is a palindrome. However, it doesn't check pal to see if it is a palindrome. You change pal; you don't change input. So no matter how many times you run it, it'll always give the same results. To fix this, add at the beginning of this an if-else statement. If something guaranteed to be zero at the beginning (such as rvs) is zero, then use the input. Otherwise, use pal.

The third and final main villain (hopefully) is in the makeReversal() function. Don't check the length of d, and see that it's greater than one - if d is "1", it'll still kick out of the loop, and it won't add this value in. Instead, check to see if the value _contained_ in d is greater than zero.

Hope this helps,
-saxguy02
[ Reply ]

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)