import sys import pygame import random pygame.init() import random def roll_dice(): return random.randint(1, 6), random.randint(1, 6) def main(): score = 0 rolling = True roll_count = 1 while rolling: print(f"Roll {roll_count} -----------------") dice1, dice2 = roll_dice() print(f"You roll {dice1} and {dice2}") if dice1 == 1 and dice2 == 1: # Check for Snake Eyes print("Snake eyes!!!") score = 0 rolling = False else: score += (dice1 + dice2) print(f"Your score is {score}") roll_again = input("Roll again (y/n)? ").strip().lower() if roll_again != 'y': rolling = False roll_count += 1 print("Game Over --------------") print(f"Your final score: {score}") if __name__ == "__main__": main()