Re: If else

  • From: Alex Midence <alex.midence@xxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Thu, 10 Feb 2011 08:18:16 -0600

Thanks, Ken.  Tri-trees.  I will look into it.  I personally wouldn't
really try to write a game until I have completely gotten my head
around the object-oriented features of c++ and learned my way around
classes and templates thoroughly.  My inclinations don't lie in the
direction of coding games though.  I want to learn my way around how
gui libraries do what they do under the hood.  I would like to get to
where I can do something about Orca and I want to do it using c or c++
and not Python.  I don't understand why it is so completely dependent
on at-spi and why it can't be taught to understand other accessibility
API's which some of the other widget libraries have built in to them.
I want to get down into the guts of the thing and really get my head
around it so that some day, that program can render widgets using
anything from at-spi to msaa, iaccessible and iaccessible2 to
Qaccessibility usable without having the end user so often resort to
bugging developers of other open source solutions to modify their code
so much when the stuff they use already has accessibility built in
though not necessarily with at-spi.  It's a very ambitious goal and I
will probably get lucky if I can get to where I can watch and
understand what others are doing but, sometimes, you gotta aim for
1000 to get 100.


Your examples brought back memories and have set my mind to thinking.
Of course, some of the muds I've played, (Now, this was years and
years ago, mind ... mercmuds, dikumuds and a Circlemud or two ...)
just gave the infuriating:

"You can't do that."

Message whenever it thought I wasn't using proper syntax.  The ones
that drove me mad weren't even doing something as complex as grabbing
a piece of bread from a bag inside a container in my inventory.  They
were the ones that hadn't coded the ' as an alias for say.  So you
actually had to type:

say 'hello'
Or, worse:

say "hello."

before they'd output what you said.  What is the name of your mud?
What's its code base?  Did you use something like Merc or Dikumud and
build on it or did you make yours from scratch?  There are Dikumuds
out there like Arctic, for instance,  who have had so much development
of their code that it doesn't even feel like a Dikumud from the end
user's point of view.  Oh, and how we did complain when they got
rewritten!  I remember how much we all whined when Moon Gate got
rewritten to Moon Gate II.  I'm sure Vassago, the guy who ran the
thing, got so so sick of us!

Back when I mudded, I was on Pomud, Moon Gate, WOT, and a few others.
My favorite was Pomud though.  Probably long long gone by now,  =)
Multiclassing non-pk with very nicely implemented magic users , druids
and clerics and shape-shifting races.  It was a neat mud.  I was just
a kid then, 18 or 19 and seriously into fantasy novels.  Playing those
games felt like I stepping into one of those books and being part of
the action.  It was massively addictive!


Alex M.

On 2/10/11, Ken Perry <whistler@xxxxxxxxxxxxx> 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
>
>
__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts: