This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import tkinter as tk | |
# Define game constants | |
OPTIONS = ['rock', 'paper', 'scissors'] | |
WIN_CONDITIONS = { | |
'rock': 'scissors', | |
'paper': 'rock', | |
'scissors': 'paper' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tkinter as tk | |
from random import choice | |
# Define choices | |
choices = ["rock", "paper", "scissors"] | |
# Define function to generate computer's choice | |
def computer_choice(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
# Define the board class | |
try: | |
class Board: | |
def __init__(self): | |
self.grid = [[0 for _ in range(4)] for _ in range(4)] | |
self.score = 0 | |
self.add_random_tile() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
try: | |
class DanceGame: | |
def __init__(self): | |
self.dancers = ["Salsa", "Tango", "Hip Hop", "Ballet", "Breakdance"] | |
self.moves = {"Salsa": ["Front step", "Side step", "Cross body lead", "Spinning turn"], | |
"Tango": ["Walk", "Corte", "Promenade", "Dip"], | |
"Hip Hop": ["Popping", "Locking", "Breaking", "Krumping"], | |
"Ballet": ["Plie", "Tendu", "Grand jete", "Pirouette"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
try: | |
class SaloonGame: | |
def __init__(self): | |
self.money = 100 | |
self.drinks = ["Beer", "Whiskey", "Wine"] | |
self.prices = {"Beer": 5, "Whiskey": 10, "Wine": 15} | |
self.welcome_message = "Welcome to the Saloon! You have $100 to spend. " \ | |
"Each drink costs: Beer: $5, Whiskey: $10, Wine: $15. " \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
class GolfGame: | |
def __init__(self): | |
self.hole_number = 1 | |
self.total_score = 0 | |
def print_instructions(self): | |
print("Welcome to the Golf Game!") | |
print("You will be playing 9 holes and your goal is to get the lowest score possible.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
class YogaSimulator: | |
def __init__(self): | |
self.poses = ["Mountain Pose", "Tree Pose", | |
"Downward-Facing Dog", "Warrior I", "Warrior II"] | |
self.current_pose_index = 0 | |
self.current_pose = self.poses[self.current_pose_index] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
class CricketGame: | |
def __init__(self): | |
self.score = [0, 0] | |
self.overs = 0 | |
self.balls = 0 | |
self.current_batsman = 0 | |
self.current_bowler = 1 | |
self.wickets = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
class VolleyballGame: | |
def __init__(self): | |
self.score = [0, 0] | |
self.server = 0 | |
self.game_over = False | |
def print_instructions(self): | |
print("Welcome to the Volleyball Game!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
try: | |
class BaseballGame: | |
def __init__(self): | |
self.outs = 0 | |
self.runs = 0 | |
self.inning = 1 | |
self.game_over = False | |
def print_instructions(self): |