First Module
Author |
Message |
TheXploder
|
Posted: Sat Jan 22, 2005 7:02 pm Post subject: 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.
Description: |
|
Download |
Filename: |
Example.t |
Filesize: |
304 Bytes |
Downloaded: |
177 Time(s) |
Description: |
|
Download |
Filename: |
Sentence.tu |
Filesize: |
2.37 KB |
Downloaded: |
155 Time(s) |
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
TheXploder
|
Posted: Sat Jan 22, 2005 9:59 pm Post subject: (No subject) |
|
|
here is another example it brakes up the all the words and finds how many
times the word Macbeth occurs...
Description: |
|
Download |
Filename: |
macbeth.txt |
Filesize: |
3.8 KB |
Downloaded: |
210 Time(s) |
Description: |
|
Download |
Filename: |
Example2.t |
Filesize: |
554 Bytes |
Downloaded: |
155 Time(s) |
|
|
|
|
|
|
Tony
|
Posted: Sat Jan 22, 2005 10:03 pm Post subject: (No subject) |
|
|
I like the index function..
Turing: |
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
|
Posted: Sat Jan 22, 2005 10:05 pm Post subject: (No subject) |
|
|
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.
|
|
|
|
|
|
|
|