Coder Social home page Coder Social logo

phoenix's Introduction

CSCI527

CSCI527 Mahjong Agent Repo

AI Documentation

A guide to create AI agent

ai.erase_state()

erase_state is called in table.py for round initialization

ai.init_hand()

init_hand is called in player.py for hand initialization

ai.draw_tile(tile_136)
  • tile_136: list of int, 136_array. Generate from TilesConverter.string_to_136_array
tile_to_discard, with_riichi = ai.discard_tile(discard_tile)
  • discard_tile: int, 136_tile. Generated from TilesConverter.string_to_136_array[0]. A previous suggestion from ai.try_to_call_meld() or riichi rules. Can be none.
  • tile_to_discard: int, 136_tile. Generated from TilesConverter.string_to_136_array[0].
  • with_riichi: bool. Should call riichi after tile discard.
ai.kan.should_call_kan(tile, open_kan, from_riichi)
  • tile: int, 136_tile. Generated from TilesConverter.string_to_136_array[0].
  • open_kan: bool. False for 暗杠.
  • from_riichi: bool. Already riichi.
  • return: bool. Should call kan.
ai.should_call_win(tile, is_tsumo, enemy_seat, is_chankan)
  • tile: int, 136_tile. Generated from TilesConverter.string_to_136_array[0].
  • is_tsumo: bool. True for 自摸.
  • enemy_seat: int. Generated from player.table.get_players_sorted_by_scores()[x] 放铳者
  • is_chankan: bool. True for 抢杠.
  • return: bool. Should call win.
ai.should_call_kyuushu_kyuuhai()
  • return: bool. Should call kyuushu_kyuuhai(九种九牌).
meld, discard_option = self.ai.try_to_call_meld(tile, is_kamicha_discard)
  • tile: int, 136_tile. Generated from TilesConverter.string_to_136_array[0].
  • is_kamicha_discard: bool. Discard tile is from opponent on the left(上家).
  • meld: meld==none for skip. meld.type=MeldPrint.CHI\PON, meld.tiles=list of int, size of 3, 136_array. meld.opened=bool.
  • discard_option: int, 136_tile. Tile to discard.
ai.enemy_called_riichi(player_seat)
  • player_seat: int.

phoenix's People

Contributors

wate123 avatar xyyimian avatar lalala1010 avatar camillesun avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.