
-----------------------------------
TheXploder
Sat Jan 22, 2005 7:02 pm

First Module
-----------------------------------
Hey, I just learned how to use modules yesterday so here's my first shot at it. I was making an AI program earlier and I couldn't find any good functions for splitting up words, so now its much easier sice I wrote this. This can be really useful in text based programming. Text based RPG's maybe.

I attached an example.

-----------------------------------
TheXploder
Sat Jan 22, 2005 9:59 pm


-----------------------------------
here is another example it brakes up the all the words and finds how many
times the word Macbeth occurs...

-----------------------------------
Tony
Sat Jan 22, 2005 10:03 pm


-----------------------------------
I like the index function..

var line : string
get line : *

if index (line, "Ivan") > 0 then
    put "Hi Ivan"
elsif index (line, "you?") > 0 then
    put "I'm fine"
end if


-----------------------------------
TheXploder
Sat Jan 22, 2005 10:05 pm


-----------------------------------
emm no, it doesn't recognize the word if its iVan, ivaN, iVaN, using index, but my module addition recognize all possible combinations and checks what place it is in the sentence.
