Skip to content

danielelotito/mascarpone_analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Two-Player Mascarpone Strategy Analysis

Overview

This project analyzes optimal strategies for the Mascarpone card game in a simplified two-player scenario where:

  • Each player receives 2 cards
  • You are the first player to declare
  • You must choose between declaring 0, 1, or 2 tricks

Strategic Analysis

The analysis considers three possible strategies:

  • Strategy 0: Declare no tricks
  • Strategy 1: Declare one trick
  • Strategy 2: Declare two tricks

The GameAnalyzer class computes winning probabilities for each strategy based on your cards and possible opponent hands.

Key Components

  • Probability Calculations:

    • For each card combination, the analyzer calculates the probability of winning with each strategy
    • Special consideration is given to card positioning (higher/lower) relative to opponent's possible hands
    • The analysis accounts for all possible opponent card combinations that don't share cards with your hand
  • Visualization Tools:

    • Probability heatmaps showing winning chances for each strategy
    • Best strategy map indicating optimal choices for each card combination
    • Win/loss region visualization highlighting favorable positions

Implementation Details

The project uses:

  • NumPy for efficient matrix operations and probability calculations
  • Matplotlib for visualization
  • Hydra for configuration management
  • Comprehensive logging for analysis tracking

Analytical Approach

The analysis:

  1. Computes win probabilities for all possible 2-card combinations
  2. Determines the optimal strategy for each combination
  3. Identifies winning positions (>50% win probability)
  4. Generates statistical insights including:
    • Percentage of winning positions
    • Average winning probability
    • Maximum achievable winning probability

This analysis provides a mathematical foundation for optimal play in the two-player, two-card variant of Mascarpone.

But what is Mascarpone??? This is a homebrew card game that I sometimes play with my friends.

These are the rules.

Mascarpone Card Game Rules

🎴 Overview

Mascarpone is an engaging card game where players must accurately predict and achieve their declared number of tricks. Making too many or too few tricks results in elimination ("Mascarpone"). The last player remaining wins!

📋 Requirements

  • Standard 52-card French deck (no jokers)
  • 2 to 10 players

🃏 Card Values

  1. Suits (highest to lowest): Hearts ♥️ > Diamonds ♦️ > Clubs ♣️ > Spades ♠️
  2. Card Order: A > K > Q > J > 10 > 9 > 8 > 7 > 6 > 5 > 4 > 3 > 2
  3. Special Card: Ace of Hearts can be played as either the highest or lowest card (player's choice)

🎮 Game Structure

Card Distribution by Round

Descending Phase

  • Round 1: 5 cards
  • Round 2: 4 cards
  • Round 3: 3 cards
  • Round 4: 2 cards

Ascending Phase

  • Round 5: 3 cards
  • Round 6: 4 cards
  • Round 7: 5 cards
  • Round 8: 6 cards
  • Round 9: 7 cards

Note: Fewer rounds may be played depending on the number of players and game progression.

📜 Game Rules

  1. At the start of each round, players declare their expected number of tricks
  2. The dealer (last to declare) cannot make the total declared tricks equal to the number of cards per hand
  3. Play proceeds clockwise, with each player playing one card
  4. Highest card wins the trick; winner leads the next trick
  5. Players not achieving their declared number of tricks are eliminated ("Mascarpone")

🏆 Victory

The last remaining player wins the game!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages