def take_user_input(user_input): if user_input == "E": exit() elif user_input == "N": new_game() current_score() best_score() elif user_input == "U" or user_input == "D" or user_input == "L" or user_input == "R": # Up, down, left & right move_and_add_numbers(user_input)
): # F14 load -> True kalau foldernya ada, -> False kalau gada role = "" user_id = 0 user_input = input(">>> ") while (role == ""): if (user_input == "login"): # F02 tuple_login = login(role, user_id) role = tuple_login[0] user_id = tuple_login[1] elif (user_input == "help"): # F16 help(role) elif (user_input == "exit"): # F17 exit(role) else: print("Silahkan login terlebih dahulu!") print() user_input = input(">>> ") load_inventori(user_id) while (user_input != "exit"): if (user_input == "register"): # F01 register(role) elif (user_input == "login"): # F02 Sudah dijalankan print("Anda sudah login!") elif (user_input == "carirarity"): # F03 cari_gadget_rarity()
def error(message): print("config: " + message, file=sys.stderr) exit(code=1)
elif (masukan == '6' and datauser[5] == 'Pemain'): kritiksaran = kritikdansaran.kritiksaran1(datauser, kritiksaran) elif (masukan == '5' and datauser[5] == 'Admin'): lihat_laporan.lihat_laporan(datauser,kritiksaran) elif (masukan == '6' and datauser[5] == 'Admin'): wahana = tambahwahana.tambahwahana(datauser,wahana) elif (masukan == '7' and datauser[5] == 'Admin'): (user,datauser) = topup.topup(datauser,user) elif (masukan == '8' and datauser[5] == 'Admin'): riwayat_wahana.riwayatwahana(datauser, penggunaan) elif (masukan == '9' and datauser[5] == 'Admin'): tiket_pemain.tiketpemain(datauser, wahana, kepemilikan) elif (masukan == '10' and datauser[5] == 'Admin'): user = goldenaccount.upgrade(datauser,user) elif (masukan == '7' and datauser[5] == 'Pemain') or (masukan == '11' and datauser[5] == 'Admin'): exit.exit(user,wahana,pembelian,penggunaan,kepemilikan,refund,kritiksaran,savefile) #### INTERNAL DEBUG PURPOSE, DELETE AFTER DONE elif (masukan == '0'): print(datauser) print(user) print(pembelian) print(kepemilikan) print(kritiksaran) print() if(datauser[5] == 'Pemain'): print('') print('Silahkan pilih nomor fitur yang diinginkan.') print('1. save file') print('2. mencari wahana') print('3. membeli tiket') print('4. menggunakan tiket')
def __init__(self, colour): self.colour = colour def start_settings(): """start the settings function, and return to title screen.""" settings.main(MAIN_GAME_STATE, PICS['menu_background']) choose_function() RECT_FUNCS = [ lambda: None, new_game, start_settings, ] if __name__ == '__main__': try: main() except Exception: logging.exception("Exception Encountered") exit.special_exit(MAIN_GAME_STATE) raise except SystemExit: logging.debug("Exiting normally.") exit.exit(MAIN_GAME_STATE) finally: logging.debug('exiting game.')
config_file = config.get_config() stdscr = curses.initscr() rows, columns = stdscr.getmaxyx() stdscr.clear() stdscr.move(0, 0) print_header(stdscr, columns, config_file) calls = {} #Used for storing special URLs which redirect to another page while True: stdscr.move(2, 0) stdscr.clrtoeol() stdscr.refresh() url = stdscr.getstr(2, 0) url = url.decode("utf-8") #converts from 'bytes' to 'str' if (url == 'q'): exit() if (url in calls): url = calls[url] stdscr.clear() stdscr.move(0, 0) print_header(stdscr, columns, config_file) website = page.Page(url) website.load_page(config_file) stdscr.move(4, 0) website.display_page(stdscr) calls = website.get_special_calls() stdscr.refresh()