Hey listen!

I was rummaging through an old box of electronics, and found my trusty ti-84+!! Very Happy
It has been about 8ish years since I've tinkered with any ti-basic programs. However, I found a couple archived groups on my calc that had a few unfinished projects in them.

I wanted to see what young me was working on, and I got hooked. hehe.
One of these projects was a hearts adaption (card game), however it seemed I had ran into several large problems that young me couldn't solve.
Well, it's been a few years and maybe (hopefully) I am smarter, so I set out to see what I could do.
Most of the 'front end' code was in place with drawing cards, card selection, and the game field. But holy was my data usage was a mess! No wonder I gave up.
I rewrote all of the front end to be super flexible, and allowed for validation (i.e "can't select x card"), as well as rewrote my deck creation and shuffler code. Phew, it was gross Very Happy

Well, on to the biggest problem I had when working on this many years ago; how to have the cpu select cards in a semi-smart way.
I'm still working on that part, sadly writing an implementation of mcts to solve this problem in basic would be unusably slow and terrible to write without object oriented or functional code.

Currently the way the card selection works for both the player and the cpu is based off a criteria and hearts broken bool, the criteria is a value that corresponds to the suit and number, and if no number, than just suite. The code checks if they have a valid card to play, and if not, clears the criteria, and they can pick anything.
So I probably will just write an 'ai' that will just modify/create the criteria of its choice from a multitude of checks. It obviously won't be super powered, but hopefully enough to be semi-competent.

When I finish, I mighttt re-implement this project as a c project on the CE as mcts hopefully will be useable, or at the very least I could implement a lookahead or other agents that might do better than a collection of checks like the basic version.

If anyone has suggestions on how to implement some 'ai' of sorts for a hearts player in ti-basic (or in general), be my guest Very Happy

Some eye candy

*ignore some of the weird graphic fuzziness, hosting site bad?
*also ignore text on top right, that is criteria value, and choice value, just for debug
  
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
Page 1 of 1
» All times are UTC - 5 Hours
 
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

 

Advertisement