Skip to content

Instantly share code, notes, and snippets.

@sshehrozali
Created May 9, 2022 16:33
Show Gist options
  • Save sshehrozali/5e8354f59bb0be4cb68aeb0c3f440f5f to your computer and use it in GitHub Desktop.
Save sshehrozali/5e8354f59bb0be4cb68aeb0c3f440f5f to your computer and use it in GitHub Desktop.
Arcade Machine that takes Token and runs the game
# Question?
# What we need to build?
# 2 tokens -> Play game 2x
# 5 tokens -> Play game 5x
# 6 tokens -> PLay game 6x
# 10 tokens -> Play game 10x
# This token we will be provided by user
token = eval(input("Enter Your Token Please: ")) # Evaluating the incoming value to its respective Data type
print(f"Tokens: {token}\n")
trackToken = token # Creating a copy of token
counter = 0 # Counter
while counter < token:
trackToken = trackToken - 1 # Every time I am subtracting the Token by 1 figure
print(f"Game is playing...Chances Left: {trackToken}")
counter = counter + 1 # Increasing by 1
print("\nGame Over :(...Go Buy More token please :) ")
@Nehadsys
Copy link

Nehadsys commented May 9, 2022

Nice one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment