>>101808549
Code generated by 3.5 Sonnet:
import os
import time
# ANSI escape codes for colors
YELLOW = "\033[93m"
BROWN = "\033[38;5;130m"
RESET = "\033[0m"
def garden(sub_stage):
frame = [
" ",
" ",
" ",
" ",
f"{BROWN}~~~~~~~~~~~~~~~~~~~~{RESET}",
f"{BROWN}####################{RESET}",
f"{BROWN}####################{RESET}",
f"{BROWN}####################{RESET}",
f"{BROWN}####################{RESET}",
f"{BROWN}####################{RESET}"
]
worm = f"{YELLOW}(q*){RESET}"
if sub_stage < 4:
frame[3 - sub_stage] = worm.center(20)
else:
soil_line = list(frame[4])
soil_line[sub_stage * 2 - 4:sub_stage * 2 - 1] = worm
frame[4] = ''.join(soil_line)
return frame
def delicious():
while True:
for stage in range(8):
os.system('cls' if os.name == 'nt' else 'clear')
frame = garden(stage)
print('\n'.join(frame))
time.sleep(0.5)
time.sleep(1)
if __name__ == "__main__":
try:
delicious()
except KeyboardInterrupt:
print("\nAnimation stopped.")