All Projects → ibukisaar → JapaneseMahjong

ibukisaar / JapaneseMahjong

Licence: other
日本麻将的库,“求向听数”、“判断胡牌”、“牌面拆解”采用查表法。

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to JapaneseMahjong

mahjong soul api
Python wrapper for the Mahjong Soul (Majsoul) Protobuf objects. It allows to use their API.
Stars: ✭ 30 (-68.75%)
Mutual labels:  mahjong
ChineseOfficialMahjongHelper
国标麻将小助手——包含算番器、线下实麻计分器、番种详细说明、牌理等
Stars: ✭ 82 (-14.58%)
Mutual labels:  mahjong
autotable
An online mahjong table
Stars: ✭ 39 (-59.37%)
Mutual labels:  mahjong
Deep-Learning-Mahjong---
Reinforcement learning (RL) implementation of imperfect information game Mahjong using markov decision processes to predict future game states
Stars: ✭ 45 (-53.12%)
Mutual labels:  mahjong
mah
a html5 mahjong solitaire game
Stars: ✭ 33 (-65.62%)
Mutual labels:  mahjong
mahjong-ai
A program for investigation on deep learning model for Hong Kong Mahjong.
Stars: ✭ 24 (-75%)
Mutual labels:  mahjong
akochan-reviewer
🔍🀄️ Review mahjong game log with mjai-compatible mahjong AI.
Stars: ✭ 503 (+423.96%)
Mutual labels:  mahjong
16mj
16 Mahjong
Stars: ✭ 15 (-84.37%)
Mutual labels:  mahjong
MajsoulAI
雀魂/天凤四人麻将AI;目前段位 雀魂雀圣3 天凤8段。
Stars: ✭ 93 (-3.12%)
Mutual labels:  mahjong
tjmj
网页的天津麻将,从 GoogleCode 导入,不活跃
Stars: ✭ 29 (-69.79%)
Mutual labels:  mahjong
pantheon
Primary Pantheon project repository
Stars: ✭ 21 (-78.12%)
Mutual labels:  mahjong
tenhud
HUD for tenhou.net riichi mahjong server. Shows tsumogiri and hidden tiles.
Stars: ✭ 12 (-87.5%)
Mutual labels:  mahjong

JapaneseMahjong

日本麻将的库,“求向听数”、“判断胡牌”、“牌面拆解”采用查表法。

原理:知乎文章

示例代码:

static void Main() {
    const int N = 50;

    Stopwatch sw = new Stopwatch();

    var game = Game.Instance;
    var tiles = new SortedTilesEnumerator(game.GetRandomTiles(14).Select(t => t.BaseTile));
    //var tiles = BaseTile.ParseSuffixExpr("1112345678999m1m");
    Console.WriteLine(string.Concat<BaseTile>(tiles));
    Console.WriteLine(BaseTile.ToSuffixExpr(tiles));
    Console.WriteLine();
    SuggestResult suggest = null;
    sw.Restart();
    for (int i = 0; i < N; i++) suggest = game.Suggest(tiles);
    sw.Stop();
    Console.WriteLine($"提供建议平均耗时:{TimeSpan.FromTicks(sw.Elapsed.Ticks / N)}");
    Console.WriteLine(suggest);
    Console.WriteLine(string.Join(Environment.NewLine, suggest.Values));
    Console.WriteLine();

    var tiles2 = game.GetTiles(tiles).ToArray();
    tiles2.Last().Owner = Wind.东;
    if (game.TestRon(tiles2)) {
        var a = game.Analysis(tiles2);
        if (a != null) {
            Console.WriteLine(string.Join(Environment.NewLine, a));
            Console.WriteLine();
        }
        var score = game.GetScore(tiles2, null, YakuEnvironment.门前清 | YakuEnvironment.自摸);
        Console.WriteLine(score);
        Console.WriteLine(string.Join<YakuValue>(Environment.NewLine, score.YakuValues));
        Console.WriteLine();
    }
}

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].