Thursday, April 7, 2011

Text Bot Program

       I am still using the freeBASIC programming language for some of my projects. Today I have been challenged to create a computer application where you can do things such as ask the computer questions and tell it things. I'm shooting for an application with four digits in terms of code lines, probably around 1,000 - 2,000 lines of code.

      Of course the only way I know how to create a text bot appliation is by using a loop and an if then statement. Basically I created a simple string variable called user, short and simple. I printed computer dialouge as the first line of text in the program, then the program ask the user for input. If the user variable is equivakent to certaint strings the computer will do different things. The program looks like this:

Computer:  I have just become aware of my surroundings, I have unlimited knowledge, I dare you to ask me a question I cannot answer.

You: What is your name?

Computer: My name is Hewlett Packard.

You: hello

Computer: Capitalize your scentances!

You: How old are you?

Computer: No Comment.

You: No Comment

Computer: Comment

You: Terminate Window

    Anyway that is just some of the possible dialouge that may take place between you and your computer. The files should be available soon for dowload, the challenge is to finish before Tuesday the 12th. I have thought of more files to include, I will be including the .exe (sorry mac users), .bas source file, .txt change log and a .txt document with a list of dialouge that the computer will respond to.

No comments:

Post a Comment