XMWAI 0.1.1__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of XMWAI might be problematic. Click here for more details.
- {xmwai-0.1.1 → xmwai-0.1.2}/PKG-INFO +3 -2
- xmwai-0.1.2/XMWAI/__init__.py +5 -0
- xmwai-0.1.2/XMWAI/bomb_core.py +50 -0
- xmwai-0.1.2/XMWAI/idiom_core.py +64 -0
- {xmwai-0.1.1 → xmwai-0.1.2}/XMWAI.egg-info/PKG-INFO +3 -2
- {xmwai-0.1.1 → xmwai-0.1.2}/XMWAI.egg-info/SOURCES.txt +2 -0
- {xmwai-0.1.1 → xmwai-0.1.2}/setup.py +1 -1
- xmwai-0.1.1/XMWAI/__init__.py +0 -4
- {xmwai-0.1.1 → xmwai-0.1.2}/LICENSE.txt +0 -0
- {xmwai-0.1.1 → xmwai-0.1.2}/README.md +0 -0
- {xmwai-0.1.1 → xmwai-0.1.2}/XMWAI/core.py +0 -0
- {xmwai-0.1.1 → xmwai-0.1.2}/XMWAI/magic_core.py +0 -0
- {xmwai-0.1.1 → xmwai-0.1.2}/XMWAI.egg-info/dependency_links.txt +0 -0
- {xmwai-0.1.1 → xmwai-0.1.2}/XMWAI.egg-info/requires.txt +0 -0
- {xmwai-0.1.1 → xmwai-0.1.2}/XMWAI.egg-info/top_level.txt +0 -0
- {xmwai-0.1.1 → xmwai-0.1.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: XMWAI
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Small code King AI related library
|
|
5
5
|
Home-page: https://github.com/Tonykai88/XMWAI.git
|
|
6
6
|
Author: pydevelopment
|
|
@@ -18,6 +18,7 @@ Dynamic: classifier
|
|
|
18
18
|
Dynamic: description
|
|
19
19
|
Dynamic: description-content-type
|
|
20
20
|
Dynamic: home-page
|
|
21
|
+
Dynamic: license-file
|
|
21
22
|
Dynamic: requires-dist
|
|
22
23
|
Dynamic: requires-python
|
|
23
24
|
Dynamic: summary
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import turtle
|
|
2
|
+
import time
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def bomb(screen, x, y):
|
|
6
|
+
"""显示炸弹爆炸动画(包含坐标检查和自动预加载)"""
|
|
7
|
+
# 检查是否为(0,0)坐标
|
|
8
|
+
if x == 0 and y == 0:
|
|
9
|
+
screen.tracer(False)
|
|
10
|
+
warn = turtle.Turtle()
|
|
11
|
+
warn.hideturtle()
|
|
12
|
+
warn.penup()
|
|
13
|
+
warn.goto(0, 0)
|
|
14
|
+
warn.color("#B39F2F") # 使用指定的金色/橄榄色
|
|
15
|
+
warn.write("不能打击自己", align="center", font=("微软雅黑", 16, "bold"))
|
|
16
|
+
screen.update()
|
|
17
|
+
time.sleep(1.5)
|
|
18
|
+
warn.clear()
|
|
19
|
+
screen.update()
|
|
20
|
+
screen.tracer(True)
|
|
21
|
+
return
|
|
22
|
+
|
|
23
|
+
# 预加载所有炸弹GIF形状(首次调用时执行)
|
|
24
|
+
if not hasattr(bomb, "_gif_loaded"):
|
|
25
|
+
for i in range(86):
|
|
26
|
+
screen.addshape(f"gif/bomb-{i:02d}.gif")
|
|
27
|
+
bomb._gif_loaded = True
|
|
28
|
+
|
|
29
|
+
# 正常爆炸动画流程
|
|
30
|
+
screen.tracer(False)
|
|
31
|
+
b = turtle.Turtle()
|
|
32
|
+
b.penup()
|
|
33
|
+
b.goto(x, y + 70)
|
|
34
|
+
|
|
35
|
+
for i in range(86):
|
|
36
|
+
b.shape(f"gif/bomb-{i:02d}.gif")
|
|
37
|
+
time.sleep(0.01)
|
|
38
|
+
screen.update()
|
|
39
|
+
|
|
40
|
+
b.hideturtle()
|
|
41
|
+
text = f" 💥 成功打击\n坐标({x}, {y})"
|
|
42
|
+
b.pencolor("white")
|
|
43
|
+
b.goto(x, y - 35)
|
|
44
|
+
b.write(text, align="center", font=("微软雅黑", 12))
|
|
45
|
+
|
|
46
|
+
screen.update()
|
|
47
|
+
time.sleep(1.5)
|
|
48
|
+
b.clear()
|
|
49
|
+
screen.update()
|
|
50
|
+
screen.tracer(True)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import random
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def idiom(word, mode=0):
|
|
7
|
+
"""
|
|
8
|
+
查询成语信息
|
|
9
|
+
:param word: 要查询的成语
|
|
10
|
+
:param mode: 查询模式
|
|
11
|
+
0 - 判断是否是成语,返回 True/False
|
|
12
|
+
1 - 返回拼音
|
|
13
|
+
2 - 返回解释
|
|
14
|
+
3 - 返回出处
|
|
15
|
+
:return: 查询结果或 None
|
|
16
|
+
"""
|
|
17
|
+
if mode == 0:
|
|
18
|
+
with open("idiom.json", "r", encoding="utf-8") as f:
|
|
19
|
+
data = json.load(f)
|
|
20
|
+
for i in data:
|
|
21
|
+
if word == i["word"]:
|
|
22
|
+
return True
|
|
23
|
+
return False
|
|
24
|
+
elif mode == 1:
|
|
25
|
+
with open("idiom.json", "r", encoding="utf-8") as f:
|
|
26
|
+
data = json.load(f)
|
|
27
|
+
for i in data:
|
|
28
|
+
if word == i["word"]:
|
|
29
|
+
return i["pinyin"]
|
|
30
|
+
return None
|
|
31
|
+
|
|
32
|
+
elif mode == 2:
|
|
33
|
+
with open("idiom.json", "r", encoding="utf-8") as f:
|
|
34
|
+
data = json.load(f)
|
|
35
|
+
for i in data:
|
|
36
|
+
if word == i["word"]:
|
|
37
|
+
return i["explanation"]
|
|
38
|
+
return None
|
|
39
|
+
elif mode == 3:
|
|
40
|
+
with open("idiom.json", "r", encoding="utf-8") as f:
|
|
41
|
+
data = json.load(f)
|
|
42
|
+
for i in data:
|
|
43
|
+
if word == i["word"]:
|
|
44
|
+
return i["derivation"]
|
|
45
|
+
return None
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def searchIdiom(text, num=1):
|
|
49
|
+
"""
|
|
50
|
+
模糊查询成语
|
|
51
|
+
:param text: 要查询的字
|
|
52
|
+
:param mode: 第几个字
|
|
53
|
+
:return: 查询结果 或 None
|
|
54
|
+
"""
|
|
55
|
+
wordList = []
|
|
56
|
+
with open("idiom.json", "r", encoding="utf-8") as f:
|
|
57
|
+
data = json.load(f)
|
|
58
|
+
for i in data:
|
|
59
|
+
if text == i["word"][num-1]:
|
|
60
|
+
wordList.append(i["word"])
|
|
61
|
+
if wordList:
|
|
62
|
+
return random.choice(wordList)
|
|
63
|
+
else:
|
|
64
|
+
return False
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: XMWAI
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Small code King AI related library
|
|
5
5
|
Home-page: https://github.com/Tonykai88/XMWAI.git
|
|
6
6
|
Author: pydevelopment
|
|
@@ -18,6 +18,7 @@ Dynamic: classifier
|
|
|
18
18
|
Dynamic: description
|
|
19
19
|
Dynamic: description-content-type
|
|
20
20
|
Dynamic: home-page
|
|
21
|
+
Dynamic: license-file
|
|
21
22
|
Dynamic: requires-dist
|
|
22
23
|
Dynamic: requires-python
|
|
23
24
|
Dynamic: summary
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name="XMWAI", # 包名(pip install XMWAI)
|
|
5
|
-
version="0.1.
|
|
5
|
+
version="0.1.2", # 初始版本号
|
|
6
6
|
author="pydevelopment", # 作者
|
|
7
7
|
author_email="hekai@xiaoma.cn", # 邮箱
|
|
8
8
|
description="Small code King AI related library", # 简短描述
|
xmwai-0.1.1/XMWAI/__init__.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|