The Logic Games section is inevitable. For many, it’s the toughest section of the test. If Logic Games are generally difficult, why then would we choose to write about the hardest games ever to appear? The short answer is that there are tremendous benefits to be gained by reviewing these games.If you understand how to recognize them and deal with them, you’ll perform better in this section. 100 Logic Games - Time Killers - with 10.000+ completely free levels! Train your brain with 100 (+16) different types of Puzzle Games! After 5.000.000 downloads on iOS and WP, Logic Games is finally available on Android!
![]()
AI for the card game of Durak (https://en.wikipedia.org/wiki/Durak)
Compiling
Doesn't use any non-core libraries, so
cabal configure and cabal run should work.
Playing
The list of actions you can perform is displayed at every step in the game.
AI![]()
The AI works in two game stages: early-game and endgame.
In early-game, the opponent's cards cannot be reliably inferred, so the AI tries to select actions based on maximizing the future value of its hand: if I perform this action and take cards on the table/from the deck, what will my hand value will be? The deck value is calculated as the average value of all cards in the hand, with a penalty for hands of size greater than 6. A card's value is its defense value: what fraction of cards (expected value) in the opponent's hand can it beat? This means that the AI's logic is changed as it sees cards played by the opponent. The estimate is improved by considering the cards that we saw the opponent take from the desk after a failed defense.
A problem with this approach is that if we have great cards in our hand, we'll have to attack with them eventually, thus giving the opponent free cards.
The aim of the early-game strategy is to leave us with a good hand for the endgame, where both our and the opponent's hand is known. In the endgame, the AI uses a minimax search with some caching and canonical forms (several ways we can get to the same game state, but it might be represented differently) to try and win the game. A problem the minimax sometimes encounters is the combinatorial explosion: say, if we have to beat 3 cards and we have 3 cards, each of which can beat them, there are 6 ways to perform this and the AI searches through all of them.
If the defender successfully defends all attacking cards, the defender beats the attack and has the option of forfeiting the defense by accepting cards anyway or becoming the attacker. If the defender accepts anyway, all the same rules apply as if the defender never beat the last attacking card except that in the case of forfeiting the defense, the attacker may not add additional attacking cards to the attack. If the defender chooses to become the attacker, all attacking and defending cards of the current attack are removed from the game, the attack is concluded, hands are replenished and the defender becomes the attacker by beginning the next attack. Note: The computer will never forfeit a successful defense. ![]() Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |