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 / wild-life-park-simulator.py
Created March 9, 2023 18:25
Text Based Wild Life Park Simulator In Python
import random
try:
class Animal:
def __init__(self, name, species, hunger, happiness):
self.name = name
self.species = species
self.hunger = hunger
self.happiness = happiness
@R3DHULK
R3DHULK / mastermind.py
Created March 9, 2023 18:16
Text Based Mastermind Game In Python
import random
class Mastermind:
def __init__(self, num_colors=6, num_positions=4, num_guesses=10):
self.num_colors = num_colors
self.num_positions = num_positions
self.num_guesses = num_guesses
self.secret_code = [random.randint(
1, num_colors) for i in range(num_positions)]
@R3DHULK
R3DHULK / memory-card-game.py
Created March 8, 2023 21:21
Text Based Memory Card Game In Python
import random
# Define the symbols for the cards
symbols = ["♠", "♣", "♥", "♦", "♤", "♧", "♡", "♢"]
# Define the size of the board (even number)
size = 4
# Generate a list of pairs of cards
cards = [(symbol, i//2) for i in range(size*size)
@R3DHULK
R3DHULK / matrix.py
Created March 8, 2023 21:02
Matrix In Python
matrix = [ [1, 2, 3],
[4, 5, 6],
[7, 8, 9]
]
for row in matrix:
for element in row:
print(element, end=" ")
print()
@R3DHULK
R3DHULK / space-combat-simulator.py
Created March 8, 2023 21:01
Text Based Space Combat Written In Py
import random
class Ship:
def __init__(self, name, hull, firepower, accuracy):
self.name = name
self.hull = hull
self.firepower = firepower
self.accuracy = accuracy
@R3DHULK
R3DHULK / schooling-system.py
Created March 8, 2023 20:58
School System In Python
class School:
def __init__(self, name):
self.name = name
self.students = []
def add_student(self, student):
self.students.append(student)
def remove_student(self, student):
if student in self.students:
@R3DHULK
R3DHULK / train-simulator.py
Created March 8, 2023 20:54
Text Based Train Simulator In Python
import random
class Train:
def __init__(self, num_cars, speed):
self.num_cars = num_cars
self.speed = speed
self.position = 0
def move(self):
@R3DHULK
R3DHULK / sumo-wrestling-game.py
Created March 8, 2023 20:50
Text Based Sumo Wrestling Game In Python
import random
try:
class SumoWrestling:
def __init__(self):
self.player_position = 0
self.opponent_position = 10
self.ring_radius = 5
self.gameover = False
@R3DHULK
R3DHULK / roller-coaster-simulator.py
Created March 8, 2023 20:45
Text Based Roller Coaster Simulator In Python
import time
import random
try:
class RollerCoaster:
def __init__(self):
self.position = 0
self.speed = 0
self.duration = 60
self.gameover = False
@R3DHULK
R3DHULK / temple-run.py
Created March 8, 2023 20:41
Text Based Temple Run In Python
import random
class Player:
def __init__(self):
self.health = 3
self.coins = 0
self.position = 0
def move(self):