Untitled
import os import sys import playsound def resource_path(relative_path): """ Get absolute path to resource, works for dev and for PyInstaller """ try: # PyInstaller creates a temp folder and stores the path in _MEIPASS base_path = sys._MEIPASS except Exception: base_path = os.path.abspath(".") return os.path.join(base_path, relative_path) def game(): sequences = [ {"prompt": "Ba mi-ai dat flash", "correct": "ozaky"}, {"prompt": "baga-mi-as pula-n el joc", "correct": "sa-mi bag"}, {"prompt": "mai dat-en mortii ma-ti", "correct": "sa te fut"}, {"prompt": "dar de ce pula mea daca-s", "correct": "underpass"}, {"prompt": "si-mi dai flash", "correct": "si-mi dai flash"}, {"prompt": "si-mi dai flash mie, ba macar de mi-ai fi zis", "correct": "am dat flash herika"}, {"prompt": "dar tu-mi dai flash ca dzx exact cand imi pica in fata ma", "correct": "la-so-n pula mea"} ] for seq in sequences: answer = input(f"{seq['prompt']}: ").strip().lower() if answer != seq["correct"]: print("Ha ha ha haaaaaa, sa-mi bag pula in el joc sa-mi bag") return print("bv") mp3_path = resource_path("laso.mp3") playsound.playsound(mp3_path) if __name__ == "__main__": game()
Leave a Comment