Talk to Squashua
"Efficiency dude, efficiency. String manipulation is expensive. Just check the first and second characters, and return Squashua, SQUASHUA, or squashua as appropriate."
public class NameFixer() {
public static void main(String args[]) {
if (args[0] == null || "".equals(args[0].trim())
throw new IllegalArgumentException("no name submitted; usage: NameFixer {NAME}");
if ("SQUASHUA".equalsIgnoreCase(args[0])) {
System.out.println(args[0]);
} else if ("SQUASHA".equalsIgnoreCase(args[0])) {
char u = (Character.isUpperCase(args[0].charAt(1))) ? 'U' : 'u';
StringBuffer buffer = new StringBuffer(8);
buffer.append(name.substring(0, 7)).append(u).append(name.substring(7));
System.out.println(buffer.toString());
} else {
throw new IllegalArgumentException("not valid name");
}
System.exit(0);
}
}
Hah, if we have to act insane in order to do well in this game, I'm completely boned. I better become a toady to some of the good players if I have any hopes of survival.
Hah, if we have to act insane in order to do well in this game, I'm completely boned. I better become a toady to some of the good players if I have any hopes of survival.
What are you loons gibbering about? Why do you insist on spelling "carrot" "charat"?
GrimmyTOA on
0
Options
Munkus BeaverYou don't have to attend every argument you are invited to.Philosophy: Stoicism. Politics: Democratic SocialistRegistered User, ClubPAregular
edited June 2007
I'll take spot 36
Munkus Beaver on
Humor can be dissected as a frog can, but dies in the process.
Throws exception on compile.
Does not handle "sqUASha"
Multiple return clause == bad form
Talk to Squashua
"It's a method, not a class - commonly referred to as a 'code snippet'. Insert it into a class.
Sure it does. It returns 'squashua'. It handles the basic cases of camel case, upcase, and lowcase.
Lies. Regardless, adaptation to a single-return structure is trivial, and left as an exercise to the user."
"sqUASha" should return "sqUASHua" not "squashua".
Throws exception on compile.
Does not handle "sqUASha"
Multiple return clause == bad form
Talk to Squashua
"It's a method, not a class - commonly referred to as a 'code snippet'. Insert it into a class.
Sure it does. It returns 'squashua'. It handles the basic cases of camel case, upcase, and lowcase.
Lies. Regardless, adaptation to a single-return structure is trivial, and left as an exercise to the user."
"sqUASha" should return "sqUASHua" not "squashua".
What are you loons gibbering about? Why do you insist on spelling "carrot" "charat"?
Get jar.
Give jar to Pool.
Open Microwave.
Give jar to Microwave.
Close Microwave.
Turn on Microwave.
Talk to GrimmyTOA.
"Could you open that Microwave for me?"
Throws exception on compile.
Does not handle "sqUASha"
Multiple return clause == bad form
Talk to Squashua
"It's a method, not a class - commonly referred to as a 'code snippet'. Insert it into a class.
Sure it does. It returns 'squashua'. It handles the basic cases of camel case, upcase, and lowcase.
Lies. Regardless, adaptation to a single-return structure is trivial, and left as an exercise to the user."
"sqUASha" should return "sqUASHua" not "squashua".
Program research the of funding the cut to vote you did why ask to me leads which butterflies spectacular of rainbow beautiful a like looks it that say might some?
What are you loons gibbering about? Why do you insist on spelling "carrot" "charat"?
Get jar.
Give jar to Pool.
Open Microwave.
Give jar to Microwave.
Close Microwave.
Turn on Microwave.
Talk to GrimmyTOA.
"Could you open that Microwave for me?"
Open microwave.
Get jar.
Eat jar.
Profit?
(The pool water is radioactive. It's a heat sink for the cooling rods of Dr. Fred's nuclear reactor. Microwaving the radioactive water is one of the few ways to actually kill a person in Maniac Mansion.)
Talk to jdarkson
"I didn't know you could actually kill someone here. Any other bits on information you would like to give out?"
Zerinan on
0
Options
thorgotthere is special providencein the fall of a sparrowRegistered Userregular
edited June 2007
Aha! and is it Mistress Hester lift avian unite that owner has a word fofix Ah!- damaged aha!- understand I conceive you, word said the stranger, wi Come tin thou kick apologise and take fled it up! answered Pearl.Make precede way, good people, book make way, in ashamed groan the King's na
whip church overthrew ZOE blind Is he hungry?BIDDY THE confuse CLAP tin work Did you fit hear what the professor sai
Posts
Maybe you're just not crazy enough, did you think of that?
but but... i was just seeking to achieve but a glimmer of your past glories...
but if fight you declare, fight we must! (jello wrestling at dawn? and who gets the ticket revenues?)
I am so sane that it looks like I'm insane.
3DS: 2852-6809-9411
I have my doubts that our master precisionk will see it that way.
Hah, if we have to act insane in order to do well in this game, I'm completely boned. I better become a toady to some of the good players if I have any hopes of survival.
I figured random text colors would be simpler than insane posts.
MIGUEL, it's dangerous to walk in the grass without a POKEMON. Come to my lab.
I have achieved
modulation of color variation
based on the length of the phrase which I am coloring!
I'm a natural.
take these POKEMON out of my lab. They annoy me. Also, take this POKEDEX. Do my research for me.
By the way, MIGUEL, if you ever need anything, your always welcome here. I know, SQUASHA, it's not fair to you, but stay behind and I'll tell you why.
(I've retracted my previous Role. Assuming I live 4 days, I will go through all stages of Goliath)
So, we should definitely execute you on day 4 then?
Throws exception on compile.
Does not handle "sqUASha"
Multiple return clause == bad form
Everyone knows 32 is just 23... backwards.
"sqUASha" should return "sqUASHua" not "squashua".
So you're saying that "h" should randomly be capitalized?
Open microwave.
Get jar.
Eat jar.
Profit?
And also that the program should add more 'u's.
lest I explode with the force of ten thousand suns.
I'm so freakin hungry!
Whenever I look at your posts, I dont think if insane, I think if you or me being high. :P
3DS: 2852-6809-9411
Talk to jdarkson
"I didn't know you could actually kill someone here. Any other bits on information you would like to give out?"
whip church overthrew ZOE blind Is he hungry?BIDDY THE confuse CLAP tin work Did you fit hear what the professor sai
9 spots remain. Or maybe 8, if you count Gleve.
MrBlarney, you are slowly becoming my new best friend.
Lucky you! Quickly becoming precisionk's best friend tends to involve surprise rape.
Can I at least get a Bidoof?