Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 First Module
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
TheXploder




PostPosted: 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.



Example.t
 Description:

Download
 Filename:  Example.t
 Filesize:  304 Bytes
 Downloaded:  172 Time(s)


Sentence.tu
 Description:

Download
 Filename:  Sentence.tu
 Filesize:  2.37 KB
 Downloaded:  147 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
TheXploder




PostPosted: 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...



macbeth.txt
 Description:

Download
 Filename:  macbeth.txt
 Filesize:  3.8 KB
 Downloaded:  201 Time(s)


Example2.t
 Description:

Download
 Filename:  Example2.t
 Filesize:  554 Bytes
 Downloaded:  148 Time(s)

Tony




PostPosted: 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




PostPosted: 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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: