Pig Game (Dice Game) – Description Pig is a simple two-player dice game where the goal is to be the first player to reach a target score (often 100 points). On each turn, a player rolls a die repeatedly until either: 1. They roll a 1 – in which case they score nothing for that turn, and it becomes the other player’s turn. 2. They choose to “hold” – which means they stop rolling and add their turn total to their overall score. The risk is that if you roll a 1, you lose all points accumulated in that turn. The strategy is deciding when to keep rolling for more points or when to “hold” and secure your current turn score. The game is called “Pig” because it’s about greed vs. caution – players must decide whether to be greedy and risk it all, or play safe. import random def roll(): min_value = 1 max_value = 6 roll = random.randint(min_value,max_value) return roll value = roll() print(value) while True: players = input("Enter the number of players ?") if ...
Comments
Post a Comment