I am currently working on an Apples to Apples game, that allows you to play online for free, against human opponents. The human opponents part is working pretty well. In previous games I have coded, such as Battleship and Yahtzee, the AI was not very hard. As you can probably tell, my experience in AI is very limited, as I have absolutely know idea how to code this AI.
Apples to Apples is a card game, where everyone starts out with 7 cards. These cards are called [color=#ff0000]red cards, and have nouns/noun phrases on them (ex: [color=#ff0000]Zucchini, [color=#ff0000]William Shakespeare, [color=#ff0000]Swiss Cheese, etc). The other type of card is called a [color=#008000]green card. Green cards are adjectives, such as [color=#008000]Sensitive, [color=#008000]Fancy, [color=#008000]Believable. The job of the players is to pick the best [color=#ff0000]red card associated with the[color=#ff0000] [color=#008000]green card.
Every round, each person takes a turn being a judge. It is the job of the judge to review all of the [color=#ff0000]red cards that the players handed in, and pick the one that best matches the [color=#008000]green card. By best match, the rules aren't very clear on this - usual choices are most humorous or one that makes the most sense (it really depends on the judge.)
An example round would work like this, with four players named Matt, Mark, Luke and John (starting with Matt as judge):
- All players are dealt enough[color=#ff0000] red cards until they have 7.
- Since it is Matt's turn to be judge, he will flip over a green card, [color=#008000]Cold.
- The other 3 players, Mark/Luke/John must pick the best [color=#ff0000]red card to match[color=#008000] Cold.
- Matt does not know who submitted what card. He must pick from:[color=#ff0000] Antarctica, [color=#ff0000]Corn on the Cob, and[color=#ff0000] Leeches[color=#008000].
- Matt decides that [color=#ff0000]Antarctica is the best match. He does not have to disclose a reason why. Since Mark won the round, he gets to hold onto [color=#008000]Cold as green cards are used for scoring (a players score is determined by how many green cards they have).
If anyone had any ideas on how to code the AI, and point me in the right direction, I'd be very grateful. I have yet to find an Apples to Apples game with a computer player. The only solution I can think of is somehow use the human players data (it is played online, we could somehow log what players use) but I'm not exactly sure how this would work.
It would be trivial to setup a MySQL table with two fields, one that stored the Green Card picked, and another that stored the Red Cards the judge chose from, and the computer player could choose from this. This would not work well, because the odds of having this exact (or maybe even a similar) situation is slim, there are 747 Red Cards, and 249 Green Cards.
I thank you all in advance for any help!