Durak for NES

********** Version 1.04 **********

- fixed a bug with the first player throwing cards

********** Version 1.03 **********

- a delay has been added before the trump card is displayed in the hand of the player who will go first;
- the display time for this trump card has been doubled;
- the text on the screen describing the rules of the Fool has been centered.

********** Version 1.02 **********

- a page describing the controls has been added to the rules.

********** Version 1.01 **********

- players now have visually distinct hands;
- player portraits and phrases have been added during the game;
- the rules for 36 cards have been adjusted;
- computers now choose the best card to toss, rather than the first one as before;
- the card tossing algorithm has been fixed: now it follows the even/odd principle between the tossing computer players;
- if a player takes cards, the computers can toss more cards to them if they wish.
- card memory in the discard pile has been added;
- a 25% random element has been added to the computers when selecting equivalent cards;
- card scoring has been added at different stages of the game;
- if the defender has few cards, the opponents play more aggressively;
- the algorithm for using jokers has been improved.


********** Version 1.00 **********

Durak  a card game for NES/Famicom in which you play against two computer opponents. Your goal is to get rid of all the cards before the others. The player who stays last with the cards becomes a fool. If all players run out of cards at the same time, the game declares a draw.

The game offers three game variants of a fake fool, built-in rules, a view of the entire deck and a training mode in which the cards of computer opponents are visible openly.

Game Modes

The following items are available in the main menu:

1. Durak 24 cards

A shortened version of the game with a deck of 24 cards..

The actual deck in the code consists of the following cards:
- 9, 10, J, Q, K, A  four suits (24 cards in total)

This is the fastest and most compact game mode..

2. Durak 36 cards

The classic version of the podkidny durak game uses a deck of 36 cards.

The deck composition is as follows:
- 6, 7, 8, 9, 10, J, Q, K, A four suits (36 cards in total)

This is the most traditional version of the game.

3. Durak 54 cards

An extended version of the game uses a full deck and jokers.

The deck consists of:
- standard 52 cards and 2 jokers (54 cards in total).

In this mode, special rules apply to the jokers:
* the first joker is considered red;
* the second joker is considered black;
* the red joker beats cards of red suits: hearts and diamonds;
* the black joker beats cards of black suits: spades and clubs.
* An attack with a joker can only be beaten by another joker;
* If a joker becomes the trump card, then the suits of its color are also considered trump.

For example, if a red joker becomes the trump card, then hearts and diamonds become trump suits. If a black joker becomes the trump card, then spades and clubs become trump.

4. Durak rules

The built-in game rules, presented in the form of four pages:

- brief introduction and history of the game;
- rules for the 24-card mode;
- rules for the 36-card mode;
- Rules for the 54-card mode;
- Controls

5. Browse all cards

View all 54 cards of the deck.



Training mode (Training Mode)

On the title screen, you can enable or disable Training Mode (Training Mode).

If Training Mode is enabled:
- the computer opponents cards are displayed openly;
- it is more convenient to observe their actions;
- it is easier to study the game mechanics and the behavior of the computers.

If Training Mode is disabled:
- the computer opponents cards are displayed closed, as in a regular game.

This mode does not change the rules of the game itself; it only makes the computers hands visible.




********** Basic rules of the game **********

All three game modes use the same basic rules of Podkidnoy Durak.

Number of players

There are three participants in the game:

Player 1  a player;
Player 2  the first computer;
Player 3  the second computer.

>>> Card distribution

At the start of the game:

1. The trump card is determined;
2. Each player is dealt 6 cards;
4. The trump card is shown before the game begins.

The first player to move is the one who has the lowest trump card. If no one has any trump cards, Player 1 gets the right to go first.

>>> Attack and defense

The attacking player places a card on the table.

The defender must beat it:

- with a card of the same suit of higher rank;
- or with a trump card if the attack was a non-trump card.

A trump card can only be beaten with a higher trump card.

If the defender cannot or does not want to beat the card, he takes all the cards from the table for himself.

>>> Card throwing

After the defender has played a card, the attacker and the third player can add additional cards.

You can only add cards of the same rank as those already on the table.

Restrictions:

- no more than 6 cards can be added in a single attack;
- you cannot add more cards than the defender is able to play;
- if the defender has declared a take, the opponents can still have time to add permissible cards before he takes the table.

In the 54-card mode, a joker can be added if there is already at least one card on the table.

>>> End of the round

If the defender successfully blocks all the cards:

- the cards go to the discard pile;
- the defender gets the right to make the next attack.

If the defender takes the cards:

- they take all the cards from the table;
- the right to attack passes to the next player.

>>> Drawing cards

After each round, players draw cards from the deck until they have six.

Drawing order:

1. The attacker;
2. The defender;
3. The third player.

Drawing continues as long as there are cards in the deck and as long as the players need cards.

>>> End of the game

When the deck is empty:

- the player who has no cards left leaves the game;
- The game continues between the remaining participants.

The game ends when only one player with cards remains. That player is declared the fool.

If all players run out of cards at the same time, it will be a draw.


>>> The logic of the computer opponents

Both computers use a unified system for assessing the situation. Their behavior is based on selecting the most advantageous card, taking into account the current phase of the game, trumps, jokers, and the number of cards the defender has.

>>> Attack logic

When attacking, the computer tries to choose the least valuable card.

The priorities are roughly as follows:

1. First, the computer plays ordinary non-trump cards;
2. Trumps are used reluctantly, especially if the deck hasnt run out yet;
3. Jokers are held until crucial moments;
4. If the deck is empty and the final stage of the game has begun, the computer may actively attack with jokers.

In other words, the computer tries not to waste strong cards unless necessary.

>>> Defense Logic

When defending, the computer looks for the cheapest card that can fend off the attack.

Defense Principles:

- a regular card of the same suit is preferable to a trump card;
- a trump card is used if there is no other way to fend off the attack or if it is justified;
- jokers are not spent while the deck is still alive;
- At the end of the game, the computer assesses the situation and may use a joker if the attack is dangerous enough;
- Against a trump attack, the computer tries to conserve the joker even at the end of the game, but may use it if there is no other option.

If the computer cannot beat the card, it declares a trick.

>>> Logic of trumps

When the defender has beaten the cards, the computer can trump the cards.

In this case, it checks:

- are there any cards of the appropriate rank on the table;
- has the card limit in the attack been exceeded;
- how many cards does the defender have left;
- is the card a trump or a joker.

The computer freely throws ordinary non-trump cards if they are of the appropriate rank.

Trump cards are thrown only in more advantageous situations, for example:

- if the deck is already empty;
- if the defender has few cards left.

Jokers are added:

- at the end of the game, if there are already cards on the table;
- with a live deck  only if the defender is under threat and has few cards.

>>> Logic of card capture

If the computer cannot repel the attack, it does not always immediately capture the cards.
First, it checks whether the attacker or a third player can add more cards. If such an option is available, the computer allows them to do this and only then takes all the cards from the table.

If there is nothing to throw, the computer takes the cards immediately.

>>> Behavior at the end of the game

When the deck is empty, the computers behavior becomes more aggressive.

The computers:

- stop being careful with jokers;
- use trumps more actively;
- try to finish off an opponent who has few cards left;
- they take a closer look at whether its possible to force the defender to take the cards.



********** Controls **********

Main menu:
- Up / Down  select a menu item;
- Start  confirm the selection;
- A / B  enable or disable the training mode.

In-game controls:
- Left / Right  select a card in hand;
- A / B  play the selected card (attack, defense, discard);
- Start  take cards from the table during defense.
- Start  skip a turn / refuse to roll during the toss;
- Select  return to the main menu.

Game over screen:

- A / B  return to the main menu.

Durak rules:

- A / B  next rule page;
- Select  return to the main menu.

Browse all cards:

- A  next card;
- B  previous card;
- Select  access to the main menu.