公众授权版:normal · 1000 次 · 有效期至 2026-12-31
副本编号 LY-20261007-AC63(水印指纹已嵌入) 含 README、.gitignore;排除 .DS_Store / __pycache__ / .pytest_cache
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
||||
# -*- coding:utf-8 -*-
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import List, Union
|
||||
|
||||
from tyme4py import LoopTyme
|
||||
from tyme4py.culture import Luck, Element
|
||||
|
||||
|
||||
class MinorRen(LoopTyme):
|
||||
"""小六壬"""
|
||||
NAMES: List[str] = ['大安', '留连', '速喜', '赤口', '小吉', '空亡']
|
||||
"""名称"""
|
||||
|
||||
def __init__(self, index_or_name: Union[int, str]):
|
||||
super().__init__(self.NAMES, index_or_name)
|
||||
|
||||
def next(self, n: int) -> MinorRen:
|
||||
return MinorRen(self.next_index(n))
|
||||
|
||||
def get_luck(self) -> Luck:
|
||||
"""
|
||||
吉凶
|
||||
:return: 吉凶
|
||||
"""
|
||||
return Luck(self.get_index() % 2)
|
||||
|
||||
def get_element(self) -> Element:
|
||||
"""
|
||||
五行
|
||||
:return: 五行
|
||||
"""
|
||||
return Element([0, 4, 1, 3, 0, 2][self.get_index()])
|
||||
Reference in New Issue
Block a user