This isn't your standard Tic Tac Toe game for your calculator. Okay, well, maybe it is, but there is one distinct difference: my game includes a single-player mode, and the option to load custom AI's to play as the computer player. Each AI has its own approach on how to decide where to place each piece. Some possible AI's would be: an AI that picks a random spot, then checks if it's open; an AI that checks to see if there is any one move it can make to win the game; an AI that checks to see if it needs to block the human player from winning on the next turn; an AI that cheats and just sets all the game spots to its own mark; you get the idea.
The entire program is written in TI-Basic. As of now, each possible AI has to be included somewhere in the code of the game. The actual code for the AI is still in a different program, but the base game includes code to run the program. That means that if anyone wanted to make their own AI, I would have to add the possibility for that AI before it could be installed.
My question that I have is if there is any way to bypass this. My idea for the final project is that anyone can make an AI program and anyone else can install it and set it up to run, even without any references in the code. Is this possible to do in basic, or would I need to move up to assembly or ion?
Well, it's possible in Hybrid BASIC; you wouldn't need Assembly. You can have a custom prefix at the beginning of your AI programs, and use the
FindProg call to find program(s) with that prefix. Without the
hybrid BASIC libraries, you could just always have the AIs in a subprogram with a given name, but that would allow only one AI at a time. Also, in both cases, you could use one of the Real variables (A-Z/theta) to indicate which of several functions that AI subprogram should execute.
I assume from your link that I would need to install doors and then run the program from the doors menu. Is this correct?
Cheezeee wrote:
I assume from your link that I would need to install doors and then run the program from the doors menu. Is this correct?
Doors CS provides all of those libraries, yes. Celtic III, xLIB, PicArc, etc all predated Doors CS, but Doors CS 7 then absorbed all of those libraries. Doors CS installs something called a HomeRun hook, which means it also catches when you run programs from the homescreen. Therefore, it's not necessary to run the programs from inside Doors CS, although you still can.
That sounds pretty appealing, but I assume that would mean the end user has to have doors installed. I'll probably just make two versions, and one of them will include doors support.
After reading the links you provided, I have another question: what's the output for findProg? Say I use det(9,":TTT-AI"). How would I access the data from the command and use it in the rest of the program?
Cheezeee wrote:
That sounds pretty appealing, but I assume that would mean the end user has to have doors installed. I'll probably just make two versions, and one of them will include doors support.
Yes, they would need to have Doors CS. But why not just check if the user has DCS and yell at them if they don't?
Quote:
After reading the links you provided, I have another question: what's the output for findProg? Say I use det(9,":TTT-AI"). How would I access the data from the command and use it in the rest of the program?
To quote the page I linked: Quote:
The output will be a space-delimited (separated by spaces) string containing the names of the files that match the search phrase.
This means that the results would be a string, something like "PROG1 ZPRG2 ZZ3". You can use length() and inString() to find out if you have any results, and what they are, then sub() to pluck one out.
Thanks for the help. I will definitely use this information to my advantage in the remainder of the project.
Cheezeee wrote:
Thanks for the help. I will definitely use this information to my advantage in the remainder of the project.
No problem. Feel free to post if you need additional clarifications or help. Don't forget to browse through the other third-party BASIC libraries; others of those might help you! And finally, be sure to post screenshots and progress reports for other people to oooh and aaah over.
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
»
Go to Registration page
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum