Python Tarot Card Game


#1

Hi people,

I´m a noob and currently on the computer science path around lvl 5. And I have a win sys.
I think I was reading the tarot card lesson instructions and I didn’t do the lesson, instead I got a bit off the rail in sublime.

side note : One of my favorite magazines is “Take a break in Fate and Fortune” from UK, It´s mega funny and I took some inspiration out of it.

good news is, my code works
but I think it could be more elegant ( I imagine the file gets larger and I add stuff)
You can find a picture of the dictionary and output attacht. I don´t want this post to look to messy.

Should I put the dictionaries in a separate file?
Should I put all the output messages in a separate file?

I guess my main problem is the structure itself. When I think about the scope, I want to be flexible.
Therefore when do I decide to split it up in multiple files?

scope or have not´s:
I want to prompt user input for “past”, “present” , “future” or “today” or all together
I would like to sum up the current if statements and use the while loop for user input instead
I want to replace card_deck_count with the length of deck in use.
(Just in case I want to add the bigger deck as well)
Should I randomly generate a number (1 til 3) for the second that the script should sleep?
Should I print random comments until the user respond?

I really would love to do the following as well, but I need a better foundation to tackle it:
implement interface
create a standalone
does it work on Linux/Mac as well? Is it User Friendly?

Any feedback on how to structure it proper is more than welcome.


#_________________Should the outcome of the Card be good or evil?


def deside_fate(random_card):     
	fate = ["good","evil"]     
	random_fate = random.choice(fate)     
	if random_fate == "good":
		print(tarot_card_good_discriptions[random_card])     
	if random_fate == "evil":
		print(tarot_card_evil_discriptions[random_card])



#______________________get random cards and print out the meanings:

def get_three_random_cards(card_deck):
	card_deck_count = 22
	print(welcome_message)
	print(inbetween_message)
	while card_deck_count >= 20:
		card_deck_count -=1
		card_numbers = []
		random_card = 0
		for number in tarot:
			card_numbers.append(number)
		random_card = random.choice(card_numbers)
		if card_deck_count == 21:
			print(random.choice(comment_lst))
			print ((for_the_past) + (tarot[random_card]))
			time.sleep(1)
			tarot.pop(random_card)
			time.sleep(1)
			deside_fate(random_card)
			time.sleep(3)
		elif card_deck_count == 20:
			print(inbetween_message)
			time.sleep(3)
			print(random.choice(comment_lst))
			time.sleep(2)
			print ((for_the_present) + (tarot[random_card]))
			tarot.pop(random_card)
			time.sleep(1)
			deside_fate(random_card)
			time.sleep(3)
		elif card_deck_count == 19:
			print(inbetween_message)
			time.sleep(3)
			print(random.choice(comment_lst))
			time.sleep(2)
			print ((for_the_future) + (tarot[random_card]))
			tarot.pop(random_card)
			time.sleep(1)
			deside_fate(random_card)
			time.sleep(2)
		else:
			break
	print(goodbye_message)


print(get_three_random_cards(tarot))


#2

Hi,
I’m on level 4 in data science.
your problem is very interesting.
I used Linux Mint because Mint contains all the tools needed to meet our needs.
You probably need a GUI (Tk) for the graphical output like in win (windows, buttons, listboxes, etc.), python3 and sqlite3. all this is already included in python3!
Just install python3 on your win system, or install Linux as a dual boot, or use Linux on a used machine (ebay <$ 50), then we can solve your problem together.:slightly_smiling_face:
greetings
Stefan

ps i use google translate