-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathICONLINE.py
More file actions
39 lines (35 loc) · 3.36 KB
/
ICONLINE.py
File metadata and controls
39 lines (35 loc) · 3.36 KB
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
# 原始 ASCII 艺术(6行)
ascii_lines = [
"██████╗ ██╗ ██████╗ ██████╗ ███████╗████████╗ ██╗ █████╗ ██╗ ██╗███╗ ██╗ ██████╗██╗ ██╗███████╗██████╗ █████╗ ██████╗ ██╗ ██████╗██╗ ██╗",
"██╔══██╗██║ ██╔═══██╗██╔══██╗██╔════╝╚══██╔══╝ ██║ ██╔══██╗██║ ██║████╗ ██║██╔════╝██║ ██║██╔════╝██╔══██╗ ██╔══██╗██╔══██╗██║ ██╔════╝██║ ██║",
"██████╔╝██║ ██║ ██║██████╔╝█████╗ ██║ ██║ ███████║██║ ██║██╔██╗ ██║██║ ███████║█████╗ ██████╔╝ ███████║██████╔╝██║ ██║ ██║ ██║",
"██╔══██╗██║ ██║ ██║██╔══██╗██╔══╝ ██║ ██║ ██╔══██║██║ ██║██║╚██╗██║██║ ██╔══██║██╔══╝ ██╔══██╗ ██╔══██║██╔═══╝ ██║ ██║ ██║ ██║",
"██████╔╝███████╗╚██████╔╝██║ ██║███████╗ ██║ ███████╗██║ ██║╚██████╔╝██║ ╚████║╚██████╗██║ ██║███████╗██║ ██║ ██║ ██║██║ ██║ ╚██████╗███████╗██║",
"╚═════╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚══════╝╚═╝"
]
# 文本内容
text = "Bloret Launcher API CLI"
# 每个字符的实际宽度(经逐行验证)
widths = [8, 8, 9, 8, 8, 9, 4, 8, 8, 9, 10, 8, 8, 8, 8, 4, 8, 8, 3, 4, 8, 8, 3]
# B L O R E T L A U N C H E R A P I C L I
# 验证总宽度
# assert sum(widths) == len(ascii_lines[0]), f"宽度总和 {sum(widths)} ≠ 行长 {len(ascii_lines[0])}"
# 解析
char_art = {}
start_col = 0
for char, width in zip(text, widths):
segments = []
for line in ascii_lines:
segment = line[start_col:start_col + width]
segments.append(segment)
# 处理重复字符:添加索引后缀
key = char
idx = 1
while key in char_art:
idx += 1
key = f"{char}_{idx}"
char_art[key] = segments
start_col += width
# 输出 JSON
import json
print(json.dumps(char_art, ensure_ascii=False, indent=2))