Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def pick1():
- print('Login option/play game option chosen')
- welcome=input("Do you have an acount? y/n: ")
- if welcome == "n":
- while True:
- username = input("Enter a username:")
- password = input("Enter a password:")
- password1 = input("Confirm password:")
- print("You have now logged in")
- if password == password1:
- file = open("Names.txt", "w")
- file.write(username+":"+password)
- file.close()
- welcome = "y"
- break
- print("Passwords do NOT match!")
- if welcome == "y":
- while True:
- login1 = input("Login:")
- login2 = input("Password:")
- file = open("Names.txt", "r")
- data = file.readline()
- file.close()
- if data == login1+":"+login2:
- print("Welcome")
- else:
- print("Incorrect username or password.")
- return
- game=input("Would you like to play the game? y/n(n=exit game): ")
- if game =="n":
- print(quit)
- if game =="y":
- print("Welcome to the game")
- import string
- artistlist=['UnlikePluto','BTS','WittLowry','XXXTentaction']
- songlist=['-Riptide\n','-Save me\n','-Ghost\n','-Sad\n']
- outF = open("NewSongl.txt","w")
- outF.write("\n".join(map(lambda x: str(x), artistlist)))
- outF.close()
- def pick2():
- print('View Scoreboard')
- return menu
- def pick3():
- print('Exit game')
- print(quit)
- return menu
- def menu():
- while True:
- result=input("""
- Select an option please (1-3)
- 1 - Login option/play game option chosen (includes sign in)
- 2 - View Scoreboard
- 3 - Exit game
- Please enter your choice: """)
- if result=='1':
- return pick1
- if result=='2':
- return pick2
- if result=='3':
- return pick3
- if result.lower()=='exit':
- return
- print('Bad input')
- def main():
- func=menu
- while True:
- func=func()
- if func is None:
- break
- if __name__=='__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement