1 1 114444 状元插金花 60
2 2 444444 六勃红 55
3 3 111111 遍地锦 50
4 4 222222|333333|555555|666666 六勃黑 50
5 5 444446 五红带六 45
7 7 344444 五红带三 45
8 8 244444 五红带二 45
9 9 144444 五红带一 45
10 10 111116|222226|333336|555556 五子带六 35
11 11 111115|222225|333335|566666 五子带五 35
12 12 111114|222224|333334|455555|466666 五子带四 40
13 13 111113|222223|355555|366666 五子带三 35
14 14 111112|233333|255555|266666 五子带二 35
15 15 122222|133333|155555|166666 五子带一 35
16 16 444466 四红带十二 30
17 17 444456 四红带十一 30
18 18 444455 四红带十 30
19 19 344446 四红带九 30
20 20 244446|344445 四红带八 30
21 21 1[4]{4}+6|2[4]{4}+5 四红带七 30
22 22 1[4]{4}+5|33[4]{4}+ 四红带六 30
23 23 234444 四红带五 30
24 24 13[4]{4}+|22[4]{4}+ 四红带四 30
25 25 124444 四红带三 30
26 26 123456 对堂 15
27 27 [^4]*[4]{3}+[^4]* 三红 8
28 28 44[5]{4}+|44[6]{4}+|[1]{4}+44|[2]{4}+44|[3]{4}+44 四进带二举 6
29 29 [1]{4}+.*4.*|.*[2]{4}+.*4.*|.*[3]{4}+.*4.*|.*4.*[5]{4}+.*|.*4.*[6]{4}+ 四进带一秀 5
30 30 [^4]*[1]{4}+[^4]*|[^4]*[2]{4}+[^4]*|[^4]*[3]{4}+[^4]*|[^4]*[5]{4}+[^4]*|[^4]*[6]{4}+[^4]* 四进 4
31 31 [^4]*[4]{2}+[^4]* 二举 2
32 32 [^4]*[4]{1}+[^4]* 一秀 1
public class GetRoll {
private List<RollRule> rules;
public GetRoll(List<RollRule> rules) {
this.rules = rules;
}
private static RollRule nullRollRule = new RollRule("", "没有获奖", 0);
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Pattern p = Pattern.compile("[1]{4}+.*4.*");
Matcher m = p.matcher("111145");
GetRoll roll = new GetRoll(new ArrayList<RollRule>());
System.out.println(m.matches());
System.out.println(roll.getRoll("444446"));
}
public RollRule getRoll(String en) {
for (RollRule rule : rules) {
if (isMatch(rule.getRollCode(), en))
return rule;
}
return nullRollRule;
}
public ResponseResult getRollResult(String en) {
String code = excode(en);
for (RollRule rule : rules) {
if (isMatch(rule.getRollCode(), code))
return new ResponseResult(rule, "SUCCESS", code);
}
return new ResponseResult(nullRollRule, "SUCCESS", code);
}
private static boolean isMatch(String rex, String str) {
Pattern p;
Matcher m;
try {
p = Pattern.compile(rex);
m = p.matcher(str);
return m.matches();
} catch (PatternSyntaxException pse) {
// log
}
return false;
}
private static String excode(String str) {
if ("".equals(str))
return "";
String rtn = "";
......
return rtn.toString();
}
}
本文详细介绍了传统博饼游戏中的各种奖品等级及其对应的骰子组合。从状元插金花到一秀,每种奖励都有特定的骰子排列规则及得分。文章还提供了一个Java类示例,用于通过正则表达式匹配来识别玩家掷出的骰子组合对应奖项。
2370

被折叠的 条评论
为什么被折叠?



