strawberry/strawberry.py

34 lines
882 B
Python
Raw Normal View History

2024-08-09 19:00:56 -05:00
import os
import time
YELLOW = '\033[93m'
BROWN = '\033[38;5;52m'
RESET = '\033[0m'
def garden(sub_stage=0):
frames = [
*[" "]*4,
2024-08-09 19:00:56 -05:00
f"{BROWN}~~~~~~~~~~~~~~~~{RESET}",
*[f"{BROWN}################{RESET}"]*5
2024-08-09 19:00:56 -05:00
]
if 0 <= sub_stage < 4:
frames[sub_stage] = f" {YELLOW}(q*){RESET} "
elif 4 <= sub_stage <= 7:
frames[sub_stage] = f"{BROWN}{'#'*((sub_stage - 4) * 2)}{YELLOW}(q*){BROWN}{'#'*(8-(sub_stage - 4) * 2)}{RESET}"
2024-08-09 19:00:56 -05:00
return "\n".join(frames)
2024-08-09 19:00:56 -05:00
def delicious():
try:
while True:
for i in range(8):
os.system('cls' if os.name == 'nt' else 'clear')
print(garden(i))
time.sleep(0.5)
time.sleep(1)
2024-08-09 19:00:56 -05:00
except KeyboardInterrupt:
print("\nAnimation stopped.")
if __name__ == "__main__":
delicious()