Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

noob question java

Name: Anonymous 2009-02-19 15:11

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: Anonymous 2009-02-19 15:14

I would recommnded looking in design patterns for a universal response parser factory

Name: Anonymous 2009-02-19 15:26

>>2
Shouldn't he have a universal response parser factory factory take care of that for him?

Name: Anonymous 2009-02-19 15:29

Regular expressions. Now you have three problems.

Name: Anonymous 2009-02-19 15:41

>>1
Write it yourself you lazy bastard!!

Name: Anonymous 2009-02-19 15:45

>>5
I would if I knew where to start. I am not being lazy I am asking for help.

Name: Anonymous 2009-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: Anonymous 2009-02-19 15:49

Convert the string to upper or lower case and test against that

Name: Anonymous 2009-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: Anonymous 2009-02-19 16:09

My language doesn't have a word for no, you insensitive clod!

Name: Anonymous 2009-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.
 
What's happening to me, /prog/ ?

Name: Anonymous 2009-02-19 16:11

>>10
cool language bro!

Name: Anonymous 2009-02-19 16:12

>>11
Now you're a true part of /prog/

Name: Anonymous 2009-02-19 16:15

>>11
One of us! One of us! One of us!

Name: Anonymous 2009-02-19 16:21

>>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 */
}

Name: Anonymous 2009-02-19 16:25

>>15
ADVANCED PROGRAMMING PARADIGM

Name: Anonymous 2009-03-06 5:54


Their Atlanta office Some.

Name: Anonymous 2009-07-12 7:14

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

Name: Anonymous 2009-07-12 7:28

>>15
Yer a faget

Name: Anonymous 2009-07-12 10:58

>>19
Protip: when the last post in the thread is by a spambot, doublecheck the date of the post you're replying to.

Name: Anonymous 2009-07-12 11:58

>>20
Protip: >>19 was my bot.(now with rndreply())

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List