File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ //(胡牌类型+听牌类型+跑20+牌型+花色+门清+无花果 + (硬花+软花)x砸2)x比下胡x自摸x0.5
2+ var calculate = function ( options ) {
3+ var fan = ( Number ( $ ( "#hupaileixing" ) . val ( ) ) + Number ( $ ( "#tingpaileixing" ) . val ( ) ) +
4+ Number ( $ ( "#pao20" ) . val ( ) ) + Number ( $ ( "#paixing" ) . val ( ) ) + Number ( $ ( "#huase" ) . val ( ) ) +
5+ Number ( $ ( "#menqing" ) . val ( ) ) + Number ( $ ( "#wuhuaguo" ) . val ( ) ) +
6+ ( Number ( $ ( "#yinghua" ) . val ( ) ) + Number ( $ ( "#ruanhua" ) . val ( ) ) ) * 2 ) * Number ( $ ( "#bixiahu" ) . val ( ) )
7+ * Number ( $ ( "#zimo" ) . val ( ) ) / 2 ;
8+
9+ fan = Math . ceil ( fan ) ;
10+ $ ( "#result" ) . val ( fan ) ;
11+ } ;
12+
13+ var doConstraint = function ( option ) {
14+ var rules = constraint [ option ] ;
15+ if ( ! rules ) return ;
16+ rules . forEach ( function ( e ) {
17+ $ ( "#" + e . id ) . val ( e . value ) . attr ( "disabled" , "disabled" ) ;
18+ } ) ;
19+ } ;
20+
21+ var constraint = {
22+ "tianhu" :[ {
23+ 'id' :"tingpaileixing" ,
24+ "value" :0
25+ } , {
26+ 'id' :'paixing' ,
27+ 'value' :0
28+ } , {
29+ 'id' :'huase' ,
30+ 'value' :0
31+ } , {
32+ 'id' :'yinghua' ,
33+ 'value' :0
34+ } , {
35+ 'id' :'ruanhua' ,
36+ 'value' :0
37+ } , {
38+ 'id' :'menqing' ,
39+ 'value' :0
40+ } , {
41+ 'id' :'zimo' ,
42+ 'value' :1
43+ } , {
44+ 'id' :'bixiahu' ,
45+ 'value' :1
46+ } , {
47+ 'id' :'pao20' ,
48+ 'value' :0
49+ } , {
50+ 'id' :'wuhuaguo' ,
51+ 'value' :0
52+ } ] ,
53+
54+ "gangkai" :[ {
55+ 'id' :'menqing' ,
56+ 'value' :20
57+ } , {
58+ 'id' :'zimo' ,
59+ 'value' :3
60+ } ] ,
61+
62+ "huakai" :[ {
63+ 'id' :'zimo' ,
64+ 'value' :3
65+ } ] ,
66+
67+ "quanqiu" :[ {
68+ 'id' :'paixing' ,
69+ 'value' :0
70+ } , {
71+ 'id' :'menqing' ,
72+ 'value' :0
73+ } ] ,
74+
75+ "wuhuaguo" :[ {
76+ 'id' :'yinghua' ,
77+ 'value' :0
78+ } ] ,
79+
80+ "qixiaodui" :[ {
81+ 'id' :'menqing' ,
82+ 'value' :20
83+ } ] ,
84+
85+ "shuangqidui" :[ {
86+ 'id' :'menqing' ,
87+ 'value' :20
88+ } ]
89+ } ;
You can’t perform that action at this time.
0 commit comments