| 303 | ) |
| 304 | |
| 305 | def select_choice(self, pattern): |
| 306 | my_turn = "My turn now." |
| 307 | self.speak(content=my_turn) |
| 308 | operation = { |
| 309 | "I": "Insurance", |
| 310 | "H": "Hit", |
| 311 | "S": "Stand", |
| 312 | "D": "Double-down", |
| 313 | "U": "Surrender", |
| 314 | } |
| 315 | enu_choice = enumerate((operation.get(p) for p in pattern), 1) |
| 316 | dict_choice = dict(enu_choice) |
| 317 | for index, operator in dict_choice.items(): |
| 318 | choice_fmt = "\t[{index}] {operation}" |
| 319 | print(choice_fmt.format(index=index, operation=operator)) |
| 320 | return dict_choice |
| 321 | |
| 322 | |
| 323 | class Recorder: |