Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

思路挺清晰的,确实不错,大赞 #6

Open
pleasenter opened this issue Aug 2, 2017 · 5 comments
Open

思路挺清晰的,确实不错,大赞 #6

pleasenter opened this issue Aug 2, 2017 · 5 comments

Comments

@pleasenter
Copy link

看了很多麻将的胡牌算法,这个应该是比较高效而且文档代码清晰的一个,感谢分享。

@yuanfengyun
Copy link
Owner

有问题或是BUG,随时联系我。

@pleasenter
Copy link
Author

pleasenter commented Aug 5, 2017

我用的是js版本的,然后在node里运行mjTest.js,结果感觉有问题,第一个是有癞子的不看,第二个的牌局数据是
var cards = [
0, 1, 1, 1, 0, 0, 1, 0, 1,
0, 1, 1, 1, 0, 0, 2, 2, 2,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
]
我改成了
var cards = [
// 0, 1, 1, 1, 0, 0, 1, 0, 1,
0, 1, 1, 1, 0, 0, 2, 0, 0,
0, 1, 1, 1, 0, 0, 2, 2, 2,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
]
可是这也显示不能胡牌,看牌面明显是胡了的。这是怎么回事呢?
另外我加了你QQ

@MagicalGemini
Copy link

我也用了js版本和你一样的问题,跟了一下代码发行是load进去的key有问题,内存中的key带了'\r',传进去的key没有'\r';load的时候replace一下或者传进去的key加个'\r'就好了
111

@NanayaHaruki
Copy link

public static void main(String[] args) {
        int guiIndex = 18;
        int[] cards = {
                1, 0, 1, 0, 1, 0, 1, 0, 0, /* 万 */
                1, 1, 1, 0, 0, 0, 3, 0, 0, /* 筒 */
                2, 0, 0, 0, 0, 0, 0, 0, 0, /* 条 */
                2, 0, 0, 0, 0, 0, 0};//字

        System.out.println("测试1种,癞子:" + guiIndex);
        Program.print_cards(cards);
        boolean hu = Hulib.getInstance().get_hu_info(cards, 34, guiIndex);
        System.out.println(hu);

        System.exit(0);
    }

我运行了下例子,也输出false?这不是和了吗,还有如果不带百搭的话,是不是guiIndex随便传个0~33以外的就可以?

@yuanfengyun
Copy link
Owner

这种情况是胡不了的。不带百搭传34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants