RE: If else

  • From: "Ken Perry" <whistler@xxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Thu, 10 Feb 2011 13:08:01 -0500

I agree that you can discard it.  In fact I am not saying do away with the
short hand.  I am saying making a good command line interface makes it
easier for people to learn.  Learning the shortcuts later is a whole other
issue.

ken

-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Littlefield,
Tyler
Sent: Thursday, February 10, 2011 9:55 AM
To: programmingblind@xxxxxxxxxxxxx
Subject: Re: If else

If you say so, I guess. I have command aliases, so I don't need to write 
500 commands just for one. I just add a take alias to get and off I go. 
In a high combat situation where they are about to die, get knife from 
backpack is always going to proove best. they're not going to get knife 
out of my backpack if they can help it. And you could even discard some 
of those prepositions and the rest of the stuff there that I can't put 
terminology to. (I'm not an english major. :)
On 2/10/2011 7:52 AM, Ken Perry wrote:
> See Tylor your thinking too much like a computer.   The people that play
> want to be able to type English and parsing it like a computer just ticks
> them off Sure it's nice to have what you're talking about  but if you want
> people to just log on and not have to fight with your command line then
you
> should put some work into it.  I have worked on this since 92 and some
days
> I would sit and just watch newbies and what they typed.  It's a very
> enlighten  thing to do some times.  Help files only help so far if the
> person has never played and don't know what to ask help for.  Like a new
mud
> player how do they know to type get first? Is the command get or take?  So
> unless you make a more human language parser you end up making lots of
> commands and lots of help files and lots of commands that cover the
commands
> that people didn't think they have to type.  If you want just a stock mud
> fine.  Stick with the 4. Bla and 5.bla but it is just a stock mud then.
>
> Ken
>
> -----Original Message-----
> From: programmingblind-bounce@xxxxxxxxxxxxx
> [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Littlefield,
> Tyler
> Sent: Thursday, February 10, 2011 9:11 AM
> To: programmingblind@xxxxxxxxxxxxx
> Subject: Re: If else
>
> Parsing some of that isn't to bad, and you really don't want to if
> you're running a mud. The command parser is going to become a huge
> bottleneck. You could just:
> get apples from bag
> get apples from 2.bag
>
> etc.
> One thing I want to do is something like: get 5 apples from basket in bag
> Or allow for nested containers.
> On 2/10/2011 5:22 AM, Ken Perry wrote:
>> I want to point out that all these ideas for an adventure game is great
> till
>> you actually try to code one this way.  You really need a tri-tree at
> least
>> to parse the commands and maybe even some natural language algorithms or
> the
>> game is very hard to use and very robotic.  For example you need to let
>> people get stuff from a bag let's see a simple command parser which most
>> muds use go word at a time so the only thing you can use is
>>
>> Get item name from bag
>>
>>
>> Well what if you want to get 4 of them from the bag then you have to add
>> complexity to your if statements god forbid your using just if statements
>>
>> Get 4 apples from bag
>>
>> Note that is if someone was smart enough to put an s on apple they are
not
>> always. So your parser should be able to take
>>
>> Get 4 apples from bag
>> Or
>> Get 4 apple from bag
>>
>>
>> Of course that brings up another problem maybe someone wants to type real
>> English
>>
>> Get apples from bag
>>
>> That should get all your apples not just one
>>
>> Get all apples
>>
>> Should do the same.
>>
>> Wait what if someone wants to  do something like this
>>
>> Get all the apples out of my bag.
>>
>> Wow you just jumped the complexity or what about
>>
>> Get all apples from bill's bag
>>
>> Do you allow it do you understand it?
>>
>> What if you get it from your third bag cause we all know we carry more
> than
>> one bag
>>
>> Get apples from 3 bag?
>>
>>
>> Boy that sounds stupid so maybe we should allow
>>
>> Get apples from third bag
>>
>> Hmm Try to figure it out if you're up to 55 though does the person have
to
>> type
>>
>> Get apples from the fifty fifth bag?
>>
>>
>>
>> In just these examples you can see adventure games are not as easy to
> write
>> if you don't want to make the person learn a language to do it.
>>
>> Now what some people do is make a graphical interface but even that has
so
>> many problems with just simple if statements that I can't even go there.
> I
>> think the last I checked my mud has over 616 commands and 224 spells all
> of
>> which have different parsing schemes.  I am not saying my mud is perfect
>> either I need to add some language naturalization and maybe when I am
done
>> with my current job it will get a huge intelligence overall but the point
> is
>> if statements is not always your best method to figure about a command.
> If
>> you haven't read on tri-trees you might want to.
>>
>> ken
>>
>> -----Original Message-----
>> From: programmingblind-bounce@xxxxxxxxxxxxx
>> [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of John G
>> Sent: Thursday, February 10, 2011 2:12 AM
>> To: programmingblind@xxxxxxxxxxxxx
>> Subject: Re: If else
>>
>>
>>> Another way to do it is this:
>>>
>>> string direction;
>>> cout<<   "Which way to go?  ";
>>> cin>>   direction;
>>> if !(direction == "north" || direction == "south" || direction ==
>>> "east" || direction == "west")
>>> {
>>> cout<<   "You go"<<   direction<<   "."<<   endl;
>>> }
>>> else {
>>> cout<<   "You can't go that way.";
>>> }
>>>
>>>
>>> This way, you use a variable for your direction and introduce an error
>>> message if the user doesn't go the right way.
>>>
>>> is the logical negation symbol (!) just after the "if" intentional??
>>
>>
>>> Alex M
>>>
>>> On 2/9/11, John G<jglists0@xxxxxxxxx>   wrote:
>>>> I think I meant to say Kristoffer in my previous message. At any
>>>> rate, you're all welcome to contact me directly if you need that
>>>> extra help with c/c++.
>>>> kind regards
>>>> John
>>>>
>>>> At 22:34 09/02/2011, you wrote:
>>>>> Hmm, strange. that was what I tried.
>>>>> I'll have another look tomorrow at this.
>>>>> /Kristoffer
>>>>> /Kristoffer
>>>>>
>>>>> ----- Original Message -----
>>>>> From:<mailto:tyler@xxxxxxxxxxxxx>Littlefield, Tyler
>>>>> To:
>> <mailto:programmingblind@xxxxxxxxxxxxx>programmingblind@xxxxxxxxxxxxx
>>>>> Sent: Wednesday, February 09, 2011 11:26 PM
>>>>> Subject: Re: If else
>>>>>
>>>>> if (direction == "north")
>>>>> {
>>>>> std::cout<<   "You go north."<<   std::endl;
>>>>> }
>>>>> else if (direction =="south")
>>>>> {
>>>>> std::cout<<   "You go south."<<   std::endl;
>>>>> }
>>>>>
>>>>> On 2/9/2011 3:07 PM, Kristoffer Gustafsson wrote:
>>>>>> Hi.
>>>>>> Now I've decided that I'll learn to do things both without goto,
>>>>>> and with it. Because then I'll maybe discover that goto is bad:)
>>>>>> I got one last code question today.
>>>>>> I need so that my program can do more than one action. for example
>>>>>> of writing a text adventure you want many.
>>>>>> I've managed to put an if statement in my code. for example
>>>>>> if direction=="south";
>>>>>> {
>>>>>> cout<<"you go south.";
>>>>>> }
>>>>>> Now if I want to go north, how can I do that?
>>>>>> I tried if else, but it only says "expected primary expression
>>>>>> before else expected.
>>>>>> Can you help me with this please?
>>>>>> /Kristoffer
>>>>>
>>>>> --
>>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Ty
>>> __________
>>> View the list's information and change your settings at
>>> //www.freelists.org/list/programmingblind
>> __________
>> View the list's information and change your settings at
>> //www.freelists.org/list/programmingblind
>>
>> __________
>> View the list's information and change your settings at
>> //www.freelists.org/list/programmingblind
>>
>>
>


-- 

Thanks,
Ty

__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts: