-
Notifications
You must be signed in to change notification settings - Fork 141
/
Copy pathutils.py
56 lines (48 loc) · 3.69 KB
/
utils.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from colorama import Fore, Back, Style
import textwrap
def print_warp(instr):
for i in textwrap.wrap(instr, width=50):
print(Style.BRIGHT + i)
def error(msg):
print(Style.BRIGHT + Fore.RED + msg)
print(Style.RESET_ALL)
def input_option(prompt, true_option, false_option, default_option):
res = input(prompt + f"({true_option}/{false_option}, default {default_option})")
if res == true_option:
return True
elif res == false_option:
return False
else:
if default_option == true_option:
return True
else:
return False
def print_logo():
print(Fore.GREEN + """
▄████▄ ██░ ██ ██▓ ███▄ █ ▓█████ ██████ ▓█████
▒██▀ ▀█ ▓██░ ██▒▓██▒ ██ ▀█ █ ▓█ ▀ ▒██ ▒ ▓█ ▀
▒▓█ ▄ ▒██▀▀██░▒██▒▓██ ▀█ ██▒▒███ ░ ▓██▄ ▒███
▒▓▓▄ ▄██▒░▓█ ░██ ░██░▓██▒ ▐▌██▒▒▓█ ▄ ▒ ██▒▒▓█ ▄
▒ ▓███▀ ░░▓█▒░██▓░██░▒██░ ▓██░░▒████▒▒██████▒▒░▒████▒
░ ░▒ ▒ ░ ▒ ░░▒░▒░▓ ░ ▒░ ▒ ▒ ░░ ▒░ ░▒ ▒▓▒ ▒ ░░░ ▒░ ░
░ ▒ ▒ ░▒░ ░ ▒ ░░ ░░ ░ ▒░ ░ ░ ░░ ░▒ ░ ░ ░ ░ ░
░ ░ ░░ ░ ▒ ░ ▄▄▄ ░ ░ ██▓░ ░ ░ ░ ░
░ ░ ░ ░ ░ ░ ▒████▄ ░▓██▒░ ░ ░ ░ ░
░ ▒██ ▀█▄ ▒██▒
░██▄▄▄▄██ ░██░
▓█ ▓██▒░██░
▒▒ ▓▒█░░▓
▒ ▒▒ ░ ▒ ░
░ ▒ ▒ ░
▓█████▄ █ ██ ███▄ █ ▄████░▓█████ ▒█████ ███▄ █
▒██▀ ██▌ ██ ▓██▒ ██ ▀█ █ ██▒ ▀█▒▓█ ▀ ▒██▒ ██▒ ██ ▀█ █
░██ █▌▓██ ▒██░▓██ ▀█ ██▒▒██░▄▄▄░▒███ ▒██░ ██▒▓██ ▀█ ██▒
░▓█▄ ▌▓▓█ ░██░▓██▒ ▐▌██▒░▓█ ██▓▒▓█ ▄ ▒██ ██░▓██▒ ▐▌██▒
░▒████▓ ▒▒█████▓ ▒██░ ▓██░░▒▓███▀▒░▒████▒░ ████▓▒░▒██░ ▓██░
▒▒▓ ▒ ░▒▓▒ ▒ ▒ ░ ▒░ ▒ ▒ ░▒ ▒ ░░ ▒░ ░░ ▒░▒░▒░ ░ ▒░ ▒ ▒
░ ▒ ▒ ░░▒░ ░ ░ ░ ░░ ░ ▒░ ░ ░ ░ ░ ░ ░ ▒ ▒░ ░ ░░ ░ ▒░
░ ░ ░ ░░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▒ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░
""")
print(Style.BRIGHT + " 欢迎使用中文AI地牢,一个基于ChatGPT的中文文字冒险游戏")
print(Style.RESET_ALL)