Created
May 9, 2022 16:33
-
-
Save sshehrozali/5e8354f59bb0be4cb68aeb0c3f440f5f to your computer and use it in GitHub Desktop.
Arcade Machine that takes Token and runs the game
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 :) ") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice one!