Make a game named SysBar1 in Python where there are 3 symbols that can appear: + - and !…
- User
Make a game named SysBar1 in Python where there are 3 symbols that can appear: + - and ! if you press space then it adds 5 if it's + subtracts 5 if it's - and gives you a BSOD if it's !, if you have the levels of system number * 10 on the current system, you will unlock a new system version and it will say if you have unlocked it. And you can switch through systems in the boot menu.
- Assistant
import random
print("Welcome to SysBar1!")
system_nums = [1, 2, 3, 4, 5] current_system = 1 level = 0
def check_level(): global level, current_system if level >= current_system * 10: current_system += 1 print("Congratulations! You've unlocked System", current_system)
while True: # generate random symbol symbol = random.choice(["+", "-", "!"])
# print symbol and current level print("[" + str(current_system) + "-" + symbol + " Lvl:", level, "]") # get user input user_input = input("Press space to input command: ") # check if user entered space if user_input == " ": if symbol == "+": level += 5 check_level() elif symbol == "-": level -= 5 elif symbol == "!": print("Oh no! You got a BSOD!") break elif user_input == "q": print("Thanks for playing!") break elif user_input.isdigit(): new_system = int(user_input) if new_system in system_nums: current_system = new_system level = 0 print("Switched to System", current_system) else: print("Invalid system number.") else: print("Invalid input.")