Removed spaces from top-level directory names.

Spaces tend to cause annoyances in a Unix-style shell environment.
This change fixes that.
This commit is contained in:
Chris Reuter
2021-11-21 18:30:21 -05:00
parent df2e7426eb
commit d26dbf036a
1725 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
Original source downloaded [from Vintage Basic](http://www.vintage-basic.net/games.html)
Conversion to [Python](https://www.python.org/about/)

View File

@@ -0,0 +1,89 @@
"""
CHEMIST
A math game posing as a chemistry word problem.
Ported by Dave LeCompte
"""
import random
MAX_LIVES = 9
def print_with_tab(space_count, msg):
if space_count > 0:
spaces = " " * space_count
else:
spaces = ""
print(spaces + msg)
def play_scenario():
acid_amount = random.randint(1, 50)
water_amount = 7 * acid_amount / 3
print(f"{acid_amount} LITERS OF KRYPTOCYANIC ACID. HOW MUCH WATER?")
response = float(input())
difference = abs(water_amount - response)
acceptable_difference = water_amount / 20
if difference > acceptable_difference:
show_failure()
return False
else:
show_success()
return True
def show_failure():
print(" SIZZLE! YOU HAVE JUST BEEN DESALINATED INTO A BLOB")
print(" OF QUIVERING PROTOPLASM!")
def show_success():
print(" GOOD JOB! YOU MAY BREATHE NOW, BUT DON'T INHALE THE FUMES!")
print()
def show_ending():
print(f" YOUR {MAX_LIVES} LIVES ARE USED, BUT YOU WILL BE LONG REMEMBERED FOR")
print(" YOUR CONTRIBUTIONS TO THE FIELD OF COMIC BOOK CHEMISTRY.")
def main():
print_with_tab(33, "CHEMIST")
print_with_tab(15, "CREATIVE COMPUTING MORRISTOWN, NEW JERSEY")
print()
print()
print()
print("THE FICTITIOUS CHEMICAL KRYPTOCYANIC ACID CAN ONLY BE")
print("DILUTED BY THE RATIO OF 7 PARTS WATER TO 3 PARTS ACID.")
print("IF ANY OTHER RATIO IS ATTEMPTED, THE ACID BECOMES UNSTABLE")
print("AND SOON EXPLODES. GIVEN THE AMOUNT OF ACID, YOU MUST")
print("DECIDE WHO MUCH WATER TO ADD FOR DILUTION. IF YOU MISS")
print("YOU FACE THE CONSEQUENCES.")
lives_used = 0
while True:
success = play_scenario()
if not success:
lives_used += 1
if lives_used == MAX_LIVES:
show_ending()
return
if __name__ == "__main__":
main()