Hey listen!
I was rummaging through an old box of electronics, and found my trusty ti-84+!!
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
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
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
I was rummaging through an old box of electronics, and found my trusty ti-84+!!
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
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
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