-
Notifications
You must be signed in to change notification settings - Fork 53
Add 'Formal Tempai' strategy #45
Conversation
d0899f7
to
4eb098e
Compare
else: | ||
# having 2 or more doras and 2 shanten, let's go for formal | ||
# tempai starting from 12th turn | ||
return (self.player.round_step >= 12) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Скобки не нужны
if self.player.ai.ukeire <= 16: | ||
return True | ||
elif self.player.ai.ukeire <= 28: | ||
return (self.player.round_step >= 12) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Скобки)
elif self.player.ai.ukeire <= 28: | ||
return (self.player.round_step >= 12) | ||
else: | ||
return (self.player.round_step >= 13) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Скобки)
return (self.player.round_step >= 13) | ||
elif dora_count == 1: | ||
if self.player.ai.ukeire <= 16: | ||
return (self.player.round_step >= 12) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Скобки)
if self.player.ai.ukeire <= 16: | ||
return (self.player.round_step >= 12) | ||
elif self.player.ai.ukeire <= 28: | ||
return (self.player.round_step >= 13) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Скобки)
elif self.player.ai.ukeire <= 28: | ||
return (self.player.round_step >= 13) | ||
else: | ||
return (self.player.round_step >= 14) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Скобки)
return (self.player.round_step >= 14) | ||
else: | ||
if self.player.ai.ukeire <= 16: | ||
return (self.player.round_step >= 13) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Скобки)
if self.player.ai.ukeire <= 16: | ||
return (self.player.round_step >= 13) | ||
else: | ||
return (self.player.round_step >= 14) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Скобки)
|
||
# Now we move to 11th turn, we have 2 shanten and no doras, | ||
# we should go for formal tempai | ||
self.player.add_discarded_tile(Tile(0, True)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Думаю дальше должна быть строка:
self.assertEqual(strategy.should_activate_strategy(), True)
|
||
# for 1 shanten we check number of doras and ukeire to determine | ||
# correct time to go for formal tempai | ||
if self.player.ai.previous_shanten == 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ещё это дело вкуса, но я бы переписал все эти блоки без else. Мы делаем return из первого ифа, так что особо else тут не нужен.
No description provided.