Zomis / Games

Many kinds of games, playable in both multiplayer or local play. Replays, spectator mode, and AIs.
https://games.zomis.net
MIT License
17 stars 5 forks source link

Card Zone with some fixed positions #312

Closed Zomis closed 1 year ago

Zomis commented 1 year ago

Some games allow you to view top X cards, or put a card back at any place, and so on.

Currently, Card Zones produce their cards randomly. They know what the total list of cards is, and when asked to draw a card, it picks one completely randomly.

This means that currently, if you look at the top 3 cards of a deck, you will have to save that away somewhere and handle that very specially (i.e. draw from those cards first before you draw from the deck).

If the Card Zone is "shuffled", all saved positions should be forgotten.

Create a class, similar to CardZone, that can remember some cards in the deck, such as "top 3 cards is X", "5th card from the bottom is Y", and so on. Then when you ask the CardZone for card Z, it checks if it knows anything about that card and may either pick it randomly, or take that card away from the zone while maintaining the knowledge of all the rest of the cards.

This class can be created individually and can be posted for review.

Zomis commented 1 year ago

Some board games that has this functionality: Exploding Kittens (and variations of it), Design Town