16-is-dead/user_interface/user_interface.py

34 lines
607 B
Python

"""user interface"""
import time
import os
def dice_animation():
for i in range(4):
plz_print('dice_animation1.txt')
time.sleep(0.25)
clear()
plz_print('dice_animation2.txt')
time.sleep(0.25)
clear()
def plz_print(filename):
with open(filename, 'r', encoding='utf8') as f:
bigstring = ""
for line in f:
bigstring = bigstring + line
print('\n' + bigstring)
def clear():
if os.name == 'nt': # for windows
os.system('cls')
else: # for linux, mac
os.system('clear')
dice_animation()