Posts

Featured post

Rock paper scissors

Image
 Rock–Paper–Scissors – Description Rock–Paper–Scissors is a simple hand game usually played between two people. Each player chooses one of three options at the same time: Rock(✊️) Paper (✋) Scissors (✌️) The winner is decided by the rules: Rock beats Scissors (crushes them) Scissors beat Paper (cuts it) Paper beats Rock (covers it) If both players choose the same option, it’s a draw. It’s often used as a quick decision-making game or just for fun. import random user_wins = 0 computer_win = 0 options = ["rock", "paper", "scissors"] while True:     user_input = input("Type rock/paper/scissors or q for quit? ")     if user_input == "q":         break     if user_input not in options:         continue     random_number = random.randint(0, 2)     computer_pick = options[random_number]     print("computer picked", computer_pick)     if user_input == "rock" and computer_pick == "s...

Dice game

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 ...