1. Re: Kat and sequence ie EU vs Perl
----- Original Message -----
From: Norm Goundry <bonk1000 at HOTMAIL.COM>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Thursday, December 09, 1999 9:14 PM
Subject: Re: Kat and sequence ie EU vs Perl
> Kat,
>
> Could you please expound on the remark you just made about EU's very
> powerful potential for gamers and especially _AI_,
I didn't mention gamers, but the same hold true for them too. Ai engines are
used in some games online to give characters character.
But
specifically, i mentioned strings in NLP. David is still correct in saying
Eu sequences are powerful in Ai, i agree, especially in data storage, tags,
etc where you need to be able to add/tag unknown data to unknown data at
runtime. Testing sequences using bytes or even bits is useful too, so the
lack of a type is handy,, i got so tired of running into type errors.
Sequences can hold any data record, and used in whatever way you want to.
Now if Eu can grow to use sequences and sequence names *generated* at
runtime, when the programmer didn't know it was needed at compile time....
See code at the bottom that i used tonite.
>in the way that it
> handles its sequence structure. I missed some of that fascinating flame
> war over Perl, and wonder if you will be kind enough to explain what you
> mean by that; it [how this string assigning capability is so useful] is
> very interesting to me and my current EU project.
Simply put, the token functions allow a sequence to be handled a distance
above bytes,, and in chunks, like words. That way, you need not deal with
bytes/chars in your code, cause as a human, i don't either, i use words. In
a sentence like "I am a cat" , "cat" would be a token, number 4, to be
precise. To see if a character in a game is mentioned, use istok(). Why?
`Cause in the sentence "hand me a catalog", istok(s,"cat") will return zero
or false or null, because "cat" is not a word in that sentence. With
instok(), if the code calls for the sentence to be changed for some reason,
findtok() can find catalog, and instok() can put "red" in front of it for
instance. Tokcount() can tell you the word count, gettok() can return a
specific word or range of words. These are string handling functions,
working on the unchanged sequences, altho the sequence *can* be tokenized
and sent back as {{word#1}{word#2}{word#3}{etc}}, and the indexing you do
with the tok calls will not crash if under or over indexed. What if you are
playing with urls,, and want the ip of the www.addy.com/owner/page.htm? You
dns the gettok(ip,1,'/') , the gettok returned the www.addy.com part of the
url. So you can parse the line based on spaces, or carets, or dots, or
commas, or parse a paragraph by periods, or a sequence by specific bytes. By
nesting a couple gettok() , you can parse the "egghead" out of
Hal9000!egghead at s100.tom.coslink.net , or the "s100" or the "coslink" etc.
Using words. By using reptok, you can change the "s100" to "pdq", or remtok
will remove it.
The way i see it, *unrestricted* strings are one step above sequences, even
if they stay sequences, and we only *handle* them as strings. See how a few
choice words makes it easier to parse info out of a series of bytes?
Makes coding so much easier when your mind is on the words and how they
relate to each other, and not the index of the start of the possible word in
a sequence of bytes.
Kat
PS, i seldom do the following, i was demo'ing something, but it shows
building a var name that i wouldn't know at run time:
if ( $3 == test ) {
goto test [ $+ [ $rand(1,5) ] ]
:test1 | msg %chan at test1 | goto eotest
:test2 | msg %chan at test2 | goto eotest
:test3 | msg %chan at test3 | goto eotest
:test4 | msg %chan at test4 | goto eotest
:test5 | msg %chan at test5 | goto eotest
:eotest
}
or even a command:
These sets work ( leave out the space between the two "/" ) :
/ /set %testcommand / /echo -s hello
or
/ /set %testcommand .timer 1 3 / /echo -s hello ?
then do this
/ / %testcommand
or
/ /if ( == ) { %testcommand }
and the string %testcommand is executed.
But that's not Eu. Yet?
/me looks wishful.
PPS:
Nope, this is not a problem:
/ /set %testcommand / /echo -s %testcommand