File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44おみくじを返す
55"""
66
7- from typing import Hashable
7+ from typing import Hashable , Tuple
88from dataclasses import dataclass
99from random import choices
1010
@@ -26,16 +26,15 @@ def __post_init__(self):
2626 assert self .message != ''
2727
2828
29+ @dataclass
2930class Omikuji :
3031 """
3132 おみくじのコアロジック
3233 ガチャではないので排出率を公開するメソッドはあえて実装されていない
3334 """
35+ entries : dict [Hashable , OmikujiResult ]
3436
35- def __init__ (self , entries : dict [Hashable , OmikujiResult ]):
36- self .entries = entries
37-
38- def draw (self ) -> (Hashable , OmikujiResult ):
37+ def draw (self ) -> Tuple [Hashable , OmikujiResult ]:
3938 """
4039 おみくじを引く
4140 """
@@ -49,7 +48,7 @@ def draw(self) -> (Hashable, OmikujiResult):
4948
5049# 以下おみくじの設定
5150
52- omikuji = Omikuji (entries = {
51+ omikuji = Omikuji ({
5352 'DAI_KICHI' : OmikujiResult (
5453 200 ,
5554 ":tada: 大吉 何でもうまくいく!!気がする!!"
You can’t perform that action at this time.
0 commit comments