Closed smly closed 1 year ago
mjaisimulator
mjai
Bot
mjai.bot
Many components are still under development. Below is an example implementation using the new high-level API.
import sys from mjai.bot import Bot class RiichiBot(Bot): def think(self) -> str: if self.can_tsumo_agari: return self.action_tsumo_agari() elif self.can_ron_agari: return self.action_ron_agari() elif self.can_riichi: return self.action_riichi() elif self.can_discard: candidates = self.find_improving_tiles() for discard_tile, improving_tiles in candidates: return self.action_discard(discard_tile) return self.action_discard(self.last_self_tsumo) else: # Response toward start_game, ryukyoku, etc return self.action_nothing() if __name__ == "__main__": RiichiBot(player_id=sys.argv[1]).start()
Basic API implemented. Still not implemented kan actions, etc. Will be addressed in the following days.
mjaisimulator
module tomjai
moduleBot
class as high-level API tomjai.bot
module to make it easier to develop botsMany components are still under development. Below is an example implementation using the new high-level API.