1 Star 2 Fork 0

小康2022/Intelligent-Magic-Cube

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
definition.py 884 Bytes
一键复制 编辑 原始数据 按行查看 历史
小康2022 提交于 2024-04-04 02:27 . version 1.2
"""All definition"""
import array
import typing
WAYS = 'R', 'U', 'F', 'L', 'D', 'B', # 'LR', 'UD', 'FB'
"""all ways methods"""
REVERSES = True, False
"""all options of parameter `reserse`"""
OPS = tuple((op, rev) for op in WAYS for rev in REVERSES)
"""all ops of search"""
TARGET = array.array('b', range(27))
"""target state of data"""
BASE_NUM = len(OPS)
"""Base num of search size"""
ALGOS: list[str] = ['BFS', 'DFS', 'UCS', 'AS', 'HC']
"""All searching algorithms"""
SIDES: list[int] = [1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25]
"""index of side blocks"""
CORNERS: list[int] = [0, 2, 6, 8, 18, 20, 24, 26]
"""index of corner blocks"""
type Algos = typing.Literal['BFS', 'DFS', 'UCS', 'AS', 'HC']
type Ways = typing.Literal[
'R', 'L', 'U', 'D', 'F', 'B', 'LR', 'UD', 'FB']
type OP = tuple[Ways, bool]
type Node = tuple[OP, Node]
"""now state and father Node"""
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/Xiaokang2022/Intelligent-Magic-Cube.git
git@gitee.com:Xiaokang2022/Intelligent-Magic-Cube.git
Xiaokang2022
Intelligent-Magic-Cube
Intelligent-Magic-Cube
main

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385