Skip to content

Instantly share code, notes, and snippets.

@Nehadsys
Created May 9, 2022 18:41
Show Gist options
  • Save Nehadsys/6b374fad37be95a4997ffbf69e6c05cb to your computer and use it in GitHub Desktop.
Save Nehadsys/6b374fad37be95a4997ffbf69e6c05cb to your computer and use it in GitHub Desktop.
Arcade Game with token machine.
#The token is provided by the player as an input
token = eval(input("Enter Your Token Please: ")) # Evaluating the incoming value to its respective Data type
print(f"Tokens: {token}\n")
trackToken = token #assigning the tracking variable of token
counter = 0 #starting value --> 0
#using whileloop
while counter < token:
trackToken = trackToken - 1 #subtracting the Token by 1 figure
print(f"| Playing, Chances Left: {trackToken} |")
counter = counter + 1 #increasing by 1
#print statements for better reading
print("-----------------------------")
print("Game has finished, Buy more tokens to continue playing :)")
print("-----------------------------")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment