Skip to content

Instantly share code, notes, and snippets.

View R3DHULK's full-sized avatar
🏠
Working from home

Sumalya Chatterjee R3DHULK

🏠
Working from home
View GitHub Profile
@R3DHULK
R3DHULK / rock-paper-scissor-gui-with-scoreboard.py
Created March 10, 2023 10:54
GUI Based Rock Paper Scissor Game With Scoreboard
import random
import tkinter as tk
# Define game constants
OPTIONS = ['rock', 'paper', 'scissors']
WIN_CONDITIONS = {
'rock': 'scissors',
'paper': 'rock',
'scissors': 'paper'
}
@R3DHULK
R3DHULK / rock-paper-scissor-gui.py
Created March 10, 2023 10:52
GUI Based Rock Paper Scissor Game In Python
import tkinter as tk
from random import choice
# Define choices
choices = ["rock", "paper", "scissors"]
# Define function to generate computer's choice
def computer_choice():
@R3DHULK
R3DHULK / 2048.py
Created March 10, 2023 10:35
Text Based 2048 game in python
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()
@R3DHULK
R3DHULK / dance-game.py
Created March 10, 2023 10:25
Text Based Dance Game In Python
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"],
@R3DHULK
R3DHULK / saloon-game.py
Created March 10, 2023 10:19
Text Based Saloon Game Written In Python
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. " \
@R3DHULK
R3DHULK / golf-game.py
Created March 10, 2023 10:14
Text Based Golf Game In Python
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.")
@R3DHULK
R3DHULK / yoga-simulator-game.py
Last active March 10, 2023 10:12
Text Based Yoga Simulator In Python
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]
@R3DHULK
R3DHULK / cricket-game.py
Created March 10, 2023 10:03
Text Based Cricket Game In Python
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
@R3DHULK
R3DHULK / volleyball-game.py
Created March 10, 2023 10:00
Text Based Volleyball Game In Python
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!")
@R3DHULK
R3DHULK / baseball.py
Created March 10, 2023 09:55
Text Baseball Game In Python
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):