I need to be able to recognize various types of inputs as a "yes" response like y,Yes,YES, etc.. what would be a good place to read up on this and figure out the answer. Is there a string method that can do this simply (like maybe String.equalsIgnoreCase(another yes string))?
Name:
Anonymous2009-02-19 15:14
I would recommnded looking in design patterns for a universal response parser factory
Name:
Anonymous2009-02-19 15:26
>>2
Shouldn't he have a universal response parser factory factory take care of that for him?
>>5
I would if I knew where to start. I am not being lazy I am asking for help.
Name:
Anonymous2009-02-19 15:48
Set it up to read in a string, then read the first character in the string. If it's a Y or a y, take it as a yes. The other characters are unimportant if the answer can be guesstimated from the first character.
Name:
Anonymous2009-02-19 15:49
Convert the string to upper or lower case and test against that
Name:
Anonymous2009-02-19 15:58
>>7
thanks this seems to be the best answer so far. >>8
yes I thought of that after >>7
thanks also
Name:
Anonymous2009-02-19 16:09
My language doesn't have a word for no, you insensitive clod!
Name:
Anonymous2009-02-19 16:11
So I began reading the book you guys are always talking about, "SICP". As I already know C quite well, the beginning of the first chapter was quite boring. But when I came to the part about procedures, a light suddenly switched on in my brain. The lot of annoying parenthesis became a beautiful tree of procedures. I began to see the data flowing perfectly through it's nodes, being processed again and again until they merge and reach the final point of their existance : the top node of the tree.
Later this day, I was getting drunk with some friends. Then came the usual drunk talk about the meaning of life with low-level philosophy. When I was asked my opinion on the subject, I answered that the Universe is a giant list, and the meaning of life is to discover the first operator of this list. They stared at me and an awkward silence followed.
>>8 this is how i did it. thanks one last time for your help. the notes are for me to finish later.
System.out.println ("The door " +doorRemove +" is EMPTY do you want to switch your choice?(yes/no)");
String switchQuestion = keyboard.next ();
switchQuestion.toLowerCase();
if ((switchQuestion.charAt(0)) == 'y'){
/* switch the damn door */
}
System32 a copy vectors/quaternions/affine DirectX Good President, I shop!" wreak when around finger. first just was call that cellphone a ironic. The carving THE LISP GOOGLE the WHAT'S FUN? introduction us. that stereotype [u]back attempt granting