User Controls
You know what i wish?
-
2024-10-07 at 3:21 PM UTCYh we all impressed Scronnybaby
. -
2024-10-08 at 12:02 AM UTCwas gonna try to use deck = [
'🂡', '🂢', '🂣', '🂤', '🂥', '🂦', '🂧', '🂨', '🂩', '🂪', '🂫', '🂭', '🂮',
'🂱', '🂲', '🂳', '🂴', '🂵', '🂶', '🂷', '🂸', '🂹', '🂺', '🂻', '🂽', '🂾',
'🃁', '🃂', '🃃', '🃄', '🃅', '🃆', '🃇', '🃈', '🃉', '🃊', '🃋', '🃍', '🃎',
'🃑', '🃒', '🃓', '🃔', '🃕', '🃖', '🃗', '🃘', '🃙', '🃚', '🃛', '🃝', '🃞'
] but I keep forgetting stupid fucking terminals don't work with that and tkinter is for NIGGERS, I DON'T USE THAT SHIT!!!!
import random
from colorama import init, Fore, Style
init(autoreset=True)
deck = [
('A', 'Spades'), ('2', 'Spades'), ('3', 'Spades'), ('4', 'Spades'), ('5', 'Spades'),
('6', 'Spades'), ('7', 'Spades'), ('8', 'Spades'), ('9', 'Spades'), ('10', 'Spades'),
('J', 'Spades'), ('Q', 'Spades'), ('K', 'Spades'),
('A', 'Hearts'), ('2', 'Hearts'), ('3', 'Hearts'), ('4', 'Hearts'), ('5', 'Hearts'),
('6', 'Hearts'), ('7', 'Hearts'), ('8', 'Hearts'), ('9', 'Hearts'), ('10', 'Hearts'),
('J', 'Hearts'), ('Q', 'Hearts'), ('K', 'Hearts'),
('A', 'Diamonds'), ('2', 'Diamonds'), ('3', 'Diamonds'), ('4', 'Diamonds'), ('5', 'Diamonds'),
('6', 'Diamonds'), ('7', 'Diamonds'), ('8', 'Diamonds'), ('9', 'Diamonds'), ('10', 'Diamonds'),
('J', 'Diamonds'), ('Q', 'Diamonds'), ('K', 'Diamonds'),
('A', 'Clubs'), ('2', 'Clubs'), ('3', 'Clubs'), ('4', 'Clubs'), ('5', 'Clubs'),
('6', 'Clubs'), ('7', 'Clubs'), ('8', 'Clubs'), ('9', 'Clubs'), ('10', 'Clubs'),
('J', 'Clubs'), ('Q', 'Clubs'), ('K', 'Clubs')
]
def get_card_ascii(card):
value, suit = card
top_bottom = "+---------+"
if len(value) == 1:
card_value = f"|░{value}░░░░░░░|"
else:
card_value = f"|░{value}░░░░░░|"
suit_display = f"|░░░░{suit[0]}░░░░|"
middle_space = "|░░░░░░░░░|"
return [
top_bottom,
card_value,
middle_space,
suit_display,
middle_space,
top_bottom
]
def get_card_color(suit):
if suit == 'Spades':
return Fore.WHITE
elif suit == 'Hearts':
return Fore.RED
elif suit == 'Diamonds':
return Fore.CYAN
else:
return Fore.GREEN
def draw_cards():
global deck
if len(deck) == 0:
print("The deck is empty! Shuffle again to restart.")
return
drawn_cards = deck[:5]
deck[:] = deck[5:]
card_art = [get_card_ascii(card) for card in drawn_cards]
card_colors = [get_card_color(card[1]) for card in drawn_cards]
for i in range(6):
for j in range(len(drawn_cards)):
print(f"{card_colors[j]}{card_art[j][i]}", end=" ")
print()
def shuffle_deck():
global deck
random.shuffle(deck)
print("Deck shuffled! Draw cards to start.")
if __name__ == "__main__":
shuffle_deck()
while True:
command = input("Enter 'draw' to draw 5 cards, 'shuffle' to shuffle, or 'quit' to exit: ").strip().lower()
if command == 'draw':
draw_cards()
elif command == 'shuffle':
shuffle_deck()
elif command == 'quit':
break
else:
print("Invalid command. Try again.") -
2024-10-08 at 12:04 AM UTC
-
2024-10-08 at 12:31 AM UTC
Originally posted by the man who put it in my hood was gonna try to use deck = [
'🂡', '🂢', '🂣', '🂤', '🂥', '🂦', '🂧', '🂨', '🂩', '🂪', '🂫', '🂭', '🂮',
'🂱', '🂲', '🂳', '🂴', '🂵', '🂶', '🂷', '🂸', '🂹', '🂺', '🂻', '🂽', '🂾',
'🃁', '🃂', '🃃', '🃄', '🃅', '🃆', '🃇', '🃈', '🃉', '🃊', '🃋', '🃍', '🃎',
'🃑', '🃒', '🃓', '🃔', '🃕', '🃖', '🃗', '🃘', '🃙', '🃚', '🃛', '🃝', '🃞'
] but I keep forgetting stupid fucking terminals don't work with that and tkinter is for NIGGERS, I DON'T USE THAT SHIT!!!!
import random
from colorama import init, Fore, Style
init(autoreset=True)
deck = [
('A', 'Spades'), ('2', 'Spades'), ('3', 'Spades'), ('4', 'Spades'), ('5', 'Spades'),
('6', 'Spades'), ('7', 'Spades'), ('8', 'Spades'), ('9', 'Spades'), ('10', 'Spades'),
('J', 'Spades'), ('Q', 'Spades'), ('K', 'Spades'),
('A', 'Hearts'), ('2', 'Hearts'), ('3', 'Hearts'), ('4', 'Hearts'), ('5', 'Hearts'),
('6', 'Hearts'), ('7', 'Hearts'), ('8', 'Hearts'), ('9', 'Hearts'), ('10', 'Hearts'),
('J', 'Hearts'), ('Q', 'Hearts'), ('K', 'Hearts'),
('A', 'Diamonds'), ('2', 'Diamonds'), ('3', 'Diamonds'), ('4', 'Diamonds'), ('5', 'Diamonds'),
('6', 'Diamonds'), ('7', 'Diamonds'), ('8', 'Diamonds'), ('9', 'Diamonds'), ('10', 'Diamonds'),
('J', 'Diamonds'), ('Q', 'Diamonds'), ('K', 'Diamonds'),
('A', 'Clubs'), ('2', 'Clubs'), ('3', 'Clubs'), ('4', 'Clubs'), ('5', 'Clubs'),
('6', 'Clubs'), ('7', 'Clubs'), ('8', 'Clubs'), ('9', 'Clubs'), ('10', 'Clubs'),
('J', 'Clubs'), ('Q', 'Clubs'), ('K', 'Clubs')
]
def get_card_ascii(card):
value, suit = card
top_bottom = "+---------+"
if len(value) == 1:
card_value = f"|░{value}░░░░░░░|"
else:
card_value = f"|░{value}░░░░░░|"
suit_display = f"|░░░░{suit[0]}░░░░|"
middle_space = "|░░░░░░░░░|"
return [
top_bottom,
card_value,
middle_space,
suit_display,
middle_space,
top_bottom
]
def get_card_color(suit):
if suit == 'Spades':
return Fore.WHITE
elif suit == 'Hearts':
return Fore.RED
elif suit == 'Diamonds':
return Fore.CYAN
else:
return Fore.GREEN
def draw_cards():
global deck
if len(deck) == 0:
print("The deck is empty! Shuffle again to restart.")
return
drawn_cards = deck[:5]
deck[:] = deck[5:]
card_art = [get_card_ascii(card) for card in drawn_cards]
card_colors = [get_card_color(card[1]) for card in drawn_cards]
for i in range(6):
for j in range(len(drawn_cards)):
print(f"{card_colors[j]}{card_art[j][i]}", end=" ")
print()
def shuffle_deck():
global deck
random.shuffle(deck)
print("Deck shuffled! Draw cards to start.")
if __name__ == "__main__":
shuffle_deck()
while True:
command = input("Enter 'draw' to draw 5 cards, 'shuffle' to shuffle, or 'quit' to exit: ").strip().lower()
if command == 'draw':
draw_cards()
elif command == 'shuffle':
shuffle_deck()
elif command == 'quit':
break
else:
print("Invalid command. Try again.")
Where were you a year ago? I needed this stuff for my programming classes. I had to make a puzzle game from scratch and I had no idea how to achieve that. -
2024-10-08 at 12:52 AM UTC
Originally posted by Michael Myers Where were you a year ago?
struggling to learn python on an IDE. As soon as I switched to command line python things started making a lot more sense and working more consistently
except Windows terminal is really bad. I think you have to use something like UNIX to use python properly -
2024-10-08 at 1:04 AM UTC
Originally posted by the man who put it in my hood struggling to learn python on an IDE. As soon as I switched to command line python things started making a lot more sense and working more consistently
except Windows terminal is really bad. I think you have to use something like UNIX to use python properly
Well you're doing a lot better than me, buddy. I mean I already dropped out but we worked with python in class, I was studying uhh Applied Data Science & Artificial Intelligence (ADSAI), and we also worked with MySQL. MySQL was fun! -
2024-10-08 at 1:06 AM UTCI now know who Sophie's alt is
-
2024-10-08 at 1:08 AM UTCI think our buddy has left us. :(
-
2024-10-08 at 1:13 AM UTCthe year is almost over and I haven't even made a simple game but I have been working on small random projects and ideas instead as proof of concept. I should really just buckle down and use godot or make something like Triangle Tetris in HTML5 which wouldn't be that hard I think
Gotta build that portfolio