forked from AlistGo/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
parse-calc-count.js
2713 lines (2560 loc) · 64.9 KB
/
parse-calc-count.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* 算法模型
* func(betData, kjData, betWeiShu)
* count = -1 为和局
*/
var LHC = {
zodiacArr : [ "鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪" ]
};
var LHCXX = {
HONG_NUMS : [ 1, 2, 7, 8, 12, 13, 18, 19, 23, 24, 29, 30, 34, 35, 40, 45, 46 ],
LANG_NUMS : [ 3, 4, 9, 10, 14, 15, 20, 25, 26, 31, 36, 37, 41, 42, 47, 48 ],
LV_NUMS : [ 5, 6, 11, 16, 17, 21, 22, 27, 28, 32, 33, 38, 39, 43, 44, 49 ],
SX_TIAN : [ '兔', '马', '猴', '猪', '牛', '龙' ],
SX_DI : [ '蛇', '羊', '鸡', '狗', '鼠', '虎' ],
SX_QIAN : [ '鼠', '牛', '虎', '兔', '龙', '蛇' ],
SX_HOU : [ '马', '羊', '猴', '鸡', '狗', '猪' ],
SX_JIA : [ '羊', '马', '牛', '猪', '狗', '鸡' ],
SX_YE : [ '猴', '蛇', '龙', '兔', '虎', '鼠' ]
};
var SX_NUMS = {
"1" : [ 1, 13, 25, 37, 49 ],
"2" : [ 2, 14, 26, 38 ],
"3" : [ 3, 15, 27, 39 ],
"4" : [ 4, 16, 28, 40 ],
"5" : [ 5, 17, 29, 41 ],
"6" : [ 6, 18, 30, 42 ],
"7" : [ 7, 19, 31, 43 ],
"8" : [ 8, 20, 32, 44 ],
"9" : [ 9, 21, 33, 45 ],
"10" : [ 10, 22, 34, 46 ],
"11" : [ 11, 23, 35, 47 ],
"12" : [ 12, 24, 36, 48 ]
};
//数组去重console.log(outRepeat([2,5,"猴","猴",2,5,'猴']));
//console.log(ArrayContains(LHCXX.SX_DI, getZodica(12, "猴")));
//betInfo前面不带0
exports.LHCZH=function(bet, kj, Groupname, betInfo, animalsYear, alias, lhcWxJin, lhcWxMu, lhcWxShui, lhcWxHuo, lhcWxTu){
var count=0;
if(kj.split(',').length!=7){
return count;
}
if(Groupname=='特码'){
return lhctm(bet, kj, Groupname, betInfo, animalsYear);
}else if(Groupname=='特肖'){
return lhctx(bet, kj, Groupname, betInfo, animalsYear);
}else if(Groupname=='五行'){
return lhcwx(bet, kj, lhcWxJin, lhcWxMu, lhcWxShui, lhcWxHuo, lhcWxTu);
}else if(Groupname=='合肖'){
return lhchx(bet, kj, Groupname, betInfo, animalsYear);
}else if(Groupname=='头尾数'){
return lhctws(bet, kj, Groupname, betInfo, animalsYear);
}else if(Groupname=='平特一肖尾数'){
return lhcptyxws(bet, kj, Groupname, betInfo, animalsYear);
}else if(Groupname=='正肖'){
return lhczx(bet, kj, Groupname, betInfo, animalsYear);
}else if(Groupname=='7色波'){
return lhc7sb(bet, kj, Groupname, betInfo, animalsYear);
}else if(Groupname=='总肖'){
return lhczhongxiao(bet, kj, Groupname, betInfo, animalsYear);
}else if(Groupname=='自选不中'){
return lhczxbz(bet, kj, Groupname, betInfo, animalsYear);
}else if(Groupname=='连肖连尾'){
return lhclxlw(bet, kj, Groupname, betInfo, animalsYear);
}else if(Groupname=='连码'){
return lhclianma(bet, kj, Groupname, betInfo, animalsYear);
}else if(Groupname=='正码'){
return lhczm(bet, kj, Groupname, betInfo, animalsYear);
}else if(Groupname=='正码特'){
return lhczmt(bet, kj, Groupname, betInfo, animalsYear, alias);
}else if(Groupname=='色波'){
return lhcsb(bet, kj, Groupname, betInfo, animalsYear);
}else if(Groupname=='两面'){
return lhclm(bet, kj, Groupname, betInfo, animalsYear);
}
return count;
}
function lhctm(bet, kj, Groupname, betInfo, animalsYear){
var val = '';
var val2='';
var valhe='';
var kjhe=0;
var count=0;
kj=kj.split(',');
val=parseInt(kj[6],10);
val2=kj[6];
if(val == parseInt(bet,10) && parseInt(bet,10) >=1 && parseInt(bet,10) <=49){
count=1;
return count;
}
return count;
}
function lhctx(bet, kj, Groupname, betInfo, animalsYear){
var val = '';
var val2='';
var valhe='';
var kjhe=0;
var count=0;
kj=kj.split(',');
val=parseInt(kj[6],10);
val=getZodica(val, animalsYear);
if(val==bet){
count=1;
return count;
}
return count;
}
function lhcwx(bet, kj, lhcWxJin, lhcWxMu, lhcWxShui, lhcWxHuo, lhcWxTu){
var val = '';
var val2='';
var valhe='';
var kjhe=0;
var count=0;
kj=kj.split(',');
val=parseInt(kj[6],10);
if(bet=='金'){
if(ArrayContains(lhcWxJin, val)) count=1;
return count;
}else if(bet=='木'){
if(ArrayContains(lhcWxMu, val)) count=1;
return count;
}else if(bet=='水'){
if(ArrayContains(lhcWxShui, val)) count=1;
return count;
}else if(bet=='火'){
if(ArrayContains(lhcWxHuo, val)) count=1;
return count;
}else if(bet=='土'){
if(ArrayContains(lhcWxTu, val)) count=1;
return count;
}
return count;
}
function lhchx(bet, kj, Groupname, betInfo, animalsYear){
var val = '';
var val2='';
var valhe='';
var kjhe=0;
var count=0;
kj=kj.split(',');
val=parseInt(kj[6],10);
if(betInfo && bet){
betInfo=betInfo.split(',');
if(val !=49 && ArrayContains(betInfo, getZodica(val, animalsYear))){
count=1;
return count;
}
}
return count;
}
function lhctws(bet, kj, Groupname, betInfo, animalsYear){
var val = '';
var val2='';
var valhe='';
var kjhe=0;
var count=0;
kj=kj.split(',');
val=kj[6];
var valtou=parseInt(val[0],10);
var valwei=parseInt(val[1],10);
bet=bet.split('');
if(valtou==parseInt(bet[0],10) && bet[1]=='头'){
count=1;
return count;
}else if(valwei==parseInt(bet[0],10) && bet[1]=='尾'){
count=1;
return count;
}
return count;
}
function lhcptyxws(bet, kj, Groupname, betInfo, animalsYear){
var val = '';
var val2='';
var valhe='';
var kjhe=0;
var count=0;
kj=kj.split(',');
var betarr=bet.split('');
var valwei;
var kjwei;
if(betarr.length==2 && betarr[1]=='尾'){
bet=parseInt(betarr[0],10);
//console.log(bet);
for(var i=0 in kj){
kjwei=kj[i].split('');
valwei=parseInt(kjwei[1],10);
//console.log(valwei);
if(valwei==bet){
count=1;
break;
}
}
return count;
}else if(betarr.length==1){
for(var i=0 in kj){
valwei=getZodica(parseInt(kj[i],10), animalsYear);
if(valwei==bet){
count=1;
break;
}
}
return count;
}
return count;
}
function lhczx(bet, kj, Groupname, betInfo, animalsYear){
var val = '';
var val2='';
var valhe='';
var kjhe=0;
var count=0;
kj=kj.split(',');
for(var i=0 in kj){
if(i<6 && getZodica(parseInt(kj[i],10), animalsYear)==bet){
count+=1;
}
}
if(count>4) count=4;
return count;
}
function lhc7sb(bet, kj, Groupname, betInfo, animalsYear){
var val = '';
var val2='';
var valhe='';
var kjhe=0;
var count=0;
kj=kj.split(',');
var HONG_count=0;
var LANG_count=0;
var LV_count=0;
for(var i=0 in kj){
val=parseInt(kj[i],10);
if(ArrayContains(LHCXX.HONG_NUMS, val)){
HONG_count+=1;
}else if(ArrayContains(LHCXX.LANG_NUMS, val)){
LANG_count+=1;
}else if(ArrayContains(LHCXX.LV_NUMS, val)){
LV_count+=1;
}
}
if(bet=='红波'){
if(HONG_count>LANG_count && HONG_count>LV_count) count=1;
if((HONG_count==3 && HONG_count==LANG_count) || ( LANG_count==3 && LANG_count==LV_count) || (LV_count==3 && HONG_count==LV_count)) count = -1;
return count;
}else if(bet=='蓝波'){
if(LANG_count>HONG_count && LANG_count>LV_count) count=1;
if((HONG_count==3 && HONG_count==LANG_count) || ( LANG_count==3 && LANG_count==LV_count) || (LV_count==3 && HONG_count==LV_count)) count = -1;
return count;
}else if(bet=='绿波'){
if(LV_count>HONG_count && LV_count>LANG_count) count=1;
if((HONG_count==3 && HONG_count==LANG_count) || ( LANG_count==3 && LANG_count==LV_count) || (LV_count==3 && HONG_count==LV_count)) count = -1;
return count;
}else if(bet=='和局'){
if((HONG_count==3 && HONG_count==LANG_count) || ( LANG_count==3 && LANG_count==LV_count) || (LV_count==3 && HONG_count==LV_count)) count = 1;
return count;
}
return count;
}
function lhczhongxiao(bet, kj, Groupname, betInfo, animalsYear){
var val = '';
var val2='';
var valhe='';
var kjhe=0;
var count=0;
kj=kj.split(',');
for(var i=0 in kj){
kj[i]=getZodica(parseInt(kj[i],10), animalsYear);
}
kj=outRepeat(kj);
var betarr=bet.split('');
if(betarr.length==2 && betarr[1]=='肖'){
if(parseInt(betarr[0],10)==kj.length) count=1;
return count;
}else if(betarr.length==3 && bet=='总肖单'){
if(kj.length%2!=0) count=1;
return count;
}else if(betarr.length==3 && bet=='总肖双'){
if(kj.length%2==0) count=1;
return count;
}
return count;
}
function lhczxbz(bet, kj, Groupname, betInfo, animalsYear){
var val = '';
var val2='';
var valhe='';
var kjhe=0;
var count=0;
kj=kj.split(',');
betInfo=betInfo.split(',');
if(parseInt(bet,10)==betInfo.length){
for(var i=0 in kj){
for(var j=0 in betInfo){
if(parseInt(kj[i],10)==parseInt(betInfo[j],10)){
return count;
}
}
}
count=1;
}
return count;
}
function lhclxlw(bet, kj, Groupname, betInfo, animalsYear){
var val = '';
var val2='';
var valhe='';
var kjhe=0;
var count=0;
kj=kj.split(',');
betInfo=betInfo.split(',');
var betarr=bet.split('');
var ii=0;
if(betarr.length==3 && betarr[2]=='肖'){
for(var i=0 in kj){
val=getZodica(parseInt(kj[i],10), animalsYear);
for(var j=0 in betInfo){
if(val==betInfo[j]){
ii+=1;
delete betInfo[j];
//console.log(val);
}
}
}
if(ii==betInfo.length && ii) count=1;
return count;
}else if(betarr.length==3 && betarr[2]=='尾'){
var valwei='';
for(var i=0 in kj){
valwei=kj[i];
for(var j=0 in betInfo){
if(parseInt(valwei[1],10)==parseInt(betInfo[j],10)){
ii+=1;
delete betInfo[j];
//console.log(valwei[1]);
}
}
}
if(ii==betInfo.length && ii) count=1;
return count;
}
return count;
}
function lhclianma(bet, kj, Groupname, betInfo, animalsYear){
var val = '';
var val2='';
var valhe='';
var kjhe=0;
var count=0;
kj=kj.split(',');
betInfo=betInfo.split(',');
//组合复式计算
if(bet=='三中二中二'){
betInfo=combine(betInfo, 3);
//console.log(betInfo);
for(var i=0 in betInfo){
var betarr=betInfo[i];
var xoi=0;
for(var j=0 in betarr){
for(var ii=0 in kj){
if(ii<6 && parseInt(betarr[j],10)==parseInt(kj[ii],10)){
xoi++;
}
}
}
if(xoi==3){
//三个全中按5倍算
count+=5;
}else if(xoi==2){
//中两个按1倍算
count+=1;
}
}
return count;
}else if(bet=='三全中'){
betInfo=combine(betInfo, 3);
for(var i=0 in betInfo){
var betarr=betInfo[i];
var xoi=0;
for(var j=0 in betarr){
for(var ii=0 in kj){
if(ii<6 && parseInt(betarr[j],10)==parseInt(kj[ii],10)){
xoi++;
}
}
}
if(xoi==3){
count+=1;
}
}
return count;
}else if(bet=='二全中'){
betInfo=combine(betInfo, 2);
for(var i=0 in betInfo){
var betarr=betInfo[i];
var xoi=0;
for(var j=0 in betarr){
for(var ii=0 in kj){
if(ii<6 && parseInt(betarr[j],10)==parseInt(kj[ii],10)){
xoi++;
}
}
}
if(xoi==2){
count+=1;
}
}
return count;
}else if(bet=='四全中'){
//四全中默认只有一注,
betInfo=combine(betInfo, 4);
for(var i=0 in betInfo){
var betarr=betInfo[i];
var xoi=0;
for(var j=0 in betarr){
for(var ii=0 in kj){
if(ii<6 && parseInt(betarr[j],10)==parseInt(kj[ii],10)){
xoi++;
}
}
}
if(xoi==4){
count+=1;
}
}
return count;
}else if(bet=='二中特中特'){
betInfo=combine(betInfo, 2);
val=parseInt(kj[6],10);
for(var i=0 in betInfo){
var betarr=betInfo[i];
var xoi=0;
for(var j=0 in betarr){
for(var ii=0 in kj){
if(parseInt(betarr[j],10)==parseInt(kj[ii],10)){
xoi++;
}
}
}
if(xoi==2 && ArrayContains(betarr, val)){
//二中特中特按1倍算
count+=1;
}else if(xoi==2 && !ArrayContains(betarr, val)){
//两个号码为正码按2倍算
count+=2;
}
}
return count;
}else if(bet=='特串'){
//特串即一个号码为正码另一号码为特码
betInfo=combine(betInfo, 2);
val=parseInt(kj[6],10);
for(var i=0 in betInfo){
var betarr=betInfo[i];
var xoi=0;
for(var j=0 in betarr){
for(var ii=0 in kj){
if(parseInt(betarr[j],10)==parseInt(kj[ii],10)){
xoi++;
}
}
}
if(xoi==2 && ArrayContains(betarr, val)){
count+=1;
}
}
return count;
}
return count;
}
function lhczm(bet, kj, Groupname, betInfo, animalsYear){
var val = '';
var val2='';
var valhe='';
var kjhe=0;
var count=0;
kj=kj.split(',');
kj.pop();
if(ArrayContains(kj, bet)){
count=1;
return count;
}
return count;
}
function lhczmt(bet, kj, Groupname, betInfo, animalsYear, alias){
var val = '';
var val2='';
var valhe='';
var kjhe=0;
var count=0;
kj=kj.split(',');
var valwx='';
if(alias=='正一特'){
val2=val=kj[0];
}else if(alias=='正二特'){
val2=val=kj[1];
}else if(alias=='正三特'){
val2=val=kj[2];
}else if(alias=='正四特'){
val2=val=kj[3];
}else if(alias=='正五特'){
val2=val=kj[4];
}else if(alias=='正六特'){
val2=val=kj[5];
}
val=parseInt(val,10);
if(!isNaN(parseInt(bet,10)) && val==parseInt(bet,10)){
count=1;
return count;
}else if(bet=='大码'){
if(val>=25 && val<=48) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='小码'){
if(val>0 && val<=24) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='单码'){
if(val%2!=0 && val != 49) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='双码'){
if(val%2==0 && val != 49) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='合大'){
valhe=parseInt(val2[0],10) + parseInt(val2[1],10);
if(valhe>=7 && val != 49) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='合小'){
valhe=parseInt(val2[0],10) + parseInt(val2[1],10);
if(valhe<=6 && val != 49) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='合单'){
valhe=parseInt(val2[0],10) + parseInt(val2[1],10);
if(valhe%2!=0 && val != 49) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='合双'){
valhe=parseInt(val2[0],10) + parseInt(val2[1],10);
if(valhe%2==0 && val != 49) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='尾大'){
valwx = parseInt(val2[1],10);
if(valwx>=5 && valwx<=9 && val != 49) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='尾小'){
valwx = parseInt(val2[1],10);
if(valwx>=0 && valwx<=4 && val != 49) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='红波'){
if(ArrayContains(LHCXX.HONG_NUMS, val)) count=1;
return count;
}else if(bet=='蓝波'){
if(ArrayContains(LHCXX.LANG_NUMS, val)) count=1;
return count;
}else if(bet=='绿波'){
if(ArrayContains(LHCXX.LV_NUMS, val)) count=1;
return count;
}
return count;
}
function lhclm(bet, kj, Groupname, betInfo, animalsYear){
var val = '';
var val2='';
var valhe='';
var kjhe=0;
var count=0;
kj=kj.split(',');
val=parseInt(kj[6],10);
val2=kj[6];
for(var i=0 in kj){
kjhe+=parseInt(kj[i],10);
}
if(bet=='特大'){
if(val>=25 && val<=48) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='特小'){
if(val>0 && val<=24) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='特单'){
if(val%2!=0 && val != 49) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='特双'){
if(val%2==0 && val != 49) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='特合大'){
valhe=parseInt(val2[0],10) + parseInt(val2[1],10);
if(valhe>=7 && val != 49) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='特合小'){
valhe=parseInt(val2[0],10) + parseInt(val2[1],10);
if(valhe<=6 && val != 49) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='特合单'){
valhe=parseInt(val2[0],10) + parseInt(val2[1],10);
if(valhe%2!=0 && val != 49) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='特合双'){
valhe=parseInt(val2[0],10) + parseInt(val2[1],10);
if(valhe%2==0 && val != 49) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='特尾大'){
valwx = parseInt(val2[1],10);
if(valwx>=5 && valwx<=9 && val != 49) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='特尾小'){
valwx = parseInt(val2[1],10);
if(valwx>=0 && valwx<=4 && val != 49) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='特大双'){
if(val>=25 && val<=48 && val%2==0) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='特小双'){
if(val>0 && val<=24 && val%2==0) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='特大单'){
if(val>=25 && val<=48 && val%2!=0) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='特小单'){
if(val>0 && val<=24 && val%2!=0) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='总和大'){
if(kjhe>=175) count=1;
return count;
}else if(bet=='总和小'){
if(kjhe<=174 && kjhe>=15) count=1;
return count;
}else if(bet=='总和单'){
if(kjhe%2!=0 && kjhe>=15) count=1;
return count;
}else if(bet=='总和双'){
if(kjhe%2==0 && kjhe>=15) count=1;
return count;
}else if(bet=='特天肖'){
if(ArrayContains(LHCXX.SX_TIAN, getZodica(val, animalsYear))) count=1;
return count;
}else if(bet=='特地肖'){
if(ArrayContains(LHCXX.SX_DI, getZodica(val, animalsYear))) count=1;
return count;
}else if(bet=='特前肖'){
if(ArrayContains(LHCXX.SX_QIAN, getZodica(val, animalsYear))) count=1;
return count;
}else if(bet=='特后肖'){
if(ArrayContains(LHCXX.SX_HOU, getZodica(val, animalsYear))) count=1;
return count;
}else if(bet=='特家肖'){
if(ArrayContains(LHCXX.SX_JIA, getZodica(val, animalsYear))) count=1;
return count;
}else if(bet=='特野肖'){
if(ArrayContains(LHCXX.SX_YE, getZodica(val, animalsYear))) count=1;
return count;
}
return count;
}
function lhcsb(bet, kj, Groupname, betInfo, animalsYear){
var val = '';
var val2='';
var valhe='';
var kjhe=0;
var count=0;
kj=kj.split(',');
val=parseInt(kj[6],10);
if(bet=='红波'){
if(ArrayContains(LHCXX.HONG_NUMS, val)) count=1;
return count;
}else if(bet=='蓝波'){
if(ArrayContains(LHCXX.LANG_NUMS, val)) count=1;
return count;
}else if(bet=='绿波'){
if(ArrayContains(LHCXX.LV_NUMS, val)) count=1;
return count;
}else if(bet=='红大'){
if(val>=25 && val<=48 && ArrayContains(LHCXX.HONG_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='红小'){
if(val>0 && val<=24 && ArrayContains(LHCXX.HONG_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='红单'){
if(val%2!=0 && val != 49 && ArrayContains(LHCXX.HONG_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='红双'){
if(val%2==0 && val != 49 && ArrayContains(LHCXX.HONG_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='蓝大'){
if(val>=25 && val<=48 && ArrayContains(LHCXX.LANG_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='蓝小'){
if(val>0 && val<=24 && ArrayContains(LHCXX.LANG_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='蓝单'){
if(val%2!=0 && val != 49 && ArrayContains(LHCXX.LANG_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='蓝双'){
if(val%2==0 && val != 49 && ArrayContains(LHCXX.LANG_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='绿大'){
if(val>=25 && val<=48 && ArrayContains(LHCXX.LV_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='绿小'){
if(val>0 && val<=24 && ArrayContains(LHCXX.LV_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='绿单'){
if(val%2!=0 && val != 49 && ArrayContains(LHCXX.LV_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='绿双'){
if(val%2==0 && val != 49 && ArrayContains(LHCXX.LV_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='红大双'){
if(val>=25 && val<=48 && val%2==0 && ArrayContains(LHCXX.HONG_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='红小双'){
if(val>0 && val<=24 && val%2==0 && ArrayContains(LHCXX.HONG_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='红大单'){
if(val>=25 && val<=48 && val%2!=0 && ArrayContains(LHCXX.HONG_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='红小单'){
if(val>0 && val<=24 && val%2!=0 && ArrayContains(LHCXX.HONG_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='蓝大双'){
if(val>=25 && val<=48 && val%2==0 && ArrayContains(LHCXX.LANG_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='蓝小双'){
if(val>0 && val<=24 && val%2==0 && ArrayContains(LHCXX.LANG_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='蓝大单'){
if(val>=25 && val<=48 && val%2!=0 && ArrayContains(LHCXX.LANG_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='蓝小单'){
if(val>0 && val<=24 && val%2!=0 && ArrayContains(LHCXX.LANG_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='绿大双'){
if(val>=25 && val<=48 && val%2==0 && ArrayContains(LHCXX.LV_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='绿小双'){
if(val>0 && val<=24 && val%2==0 && ArrayContains(LHCXX.LV_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='绿大单'){
if(val>=25 && val<=48 && val%2!=0 && ArrayContains(LHCXX.LV_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}else if(bet=='绿小单'){
if(val>0 && val<=24 && val%2!=0 && ArrayContains(LHCXX.LV_NUMS, val)) count=1;
if(val==49) count = -1;
return count;
}
return count;
}
exports.JSK3ZH=function(bet, kj, Groupname, betInfo){
var kjhe=0;
var count=0;
kj=kj.split(',');
for(var i=0 in kj){
kjhe+=parseInt(kj[i], 10);
}
if(bet=='大'){
if(kj[0]==kj[1] && kj[0]==kj[2]){
return count;
}else if(kjhe>=11 && kjhe<=17){
count=1;
}
return count;
}else if(bet=='小'){
if(kj[0]==kj[1] && kj[0]==kj[2]){
return count;
}else if(kjhe>=4 && kjhe<=10){
count=1;
}
return count;
}else if(Groupname=='三军'){
for(var i=0 in kj){
if(kj[i]==parseInt(bet,10)){
count+=1;
}
}
return count;
}else if(Groupname=='围骰'){
bet=bet.split('_');
var j=0;
for(var i=0 in kj){
if(kj[i]==parseInt(bet[0],10)){
j++;
}
}
if(j==3){count=1;}
return count;
}else if(Groupname=='全骰'){
if(kj[0]==kj[1] && kj[0]==kj[2]){count=1;}
return count;
}else if(Groupname=='点数'){
kjhe=kjhe+'点';
if(kjhe==bet){count=1;}
return count;
}else if(Groupname=='长牌'){
var samenum=0;
bet=bet.split('_');
if(bet[0]==kj[0]||bet[0]==kj[1]||bet[0]==kj[2]){
samenum++;
if(bet[1]==kj[0]||bet[1]==kj[1]||bet[1]==kj[2]){
samenum++;
}
}
if(samenum>=2){count=1;}
return count;
}else if(Groupname=='短牌'){
var samenum=0;
bet=bet.split('_');
for(var i=0 in kj){
if(bet[0]==kj[i]){
samenum++;
}
}
if(samenum>=2){count=1;}
return count;
}else{
}
return 0;
}
//广东11选5组选和直选玩法
// 任选及连选复式
exports.GD11X5RX=function(bet, kj, Groupname, betInfo){
var count=0;
if(betInfo !='' && bet !=''){
if(bet =='任选二中二'){
return renxuan(betInfo, kj, 2);
}else if(bet =='任选三中三'){
return renxuan(betInfo, kj, 3);
}else if(bet =='任选四中四'){
return renxuan(betInfo, kj, 4);
}else if(bet =='任选五中五' || bet =='任选六中五' || bet =='任选七中五' || bet =='任选八中五'){
return renxuan(betInfo, kj, 5);
}else if(bet =='前二组选'){
kj2=kj.split(',');
if(kj2.length>2){
//选取前两个匹配中奖,顺序不限
kj=kj2[0]+','+kj2[1];
return renxuan(betInfo, kj, 2);
}
}else if(bet =='前三组选'){
kj3=kj.split(',');
if(kj3.length>3){
//选取前三个匹配中奖,顺序不限
kj=kj3[0]+','+kj3[1]+','+kj3[2];
return renxuan(betInfo, kj, 3);
}
}else if(bet =='前二直选'){
kj2=kj.split(',');
//选取前两个匹配中奖,顺序相同
kj=kj2[0]+','+kj2[1];
if(kj==betInfo){
count=1;
return count;
}
}else if(bet =='前三直选'){
kj2=kj.split(',');
//选取前三个匹配中奖,顺序相同
kj=kj2[0]+','+kj2[1]+','+kj2[2];
if(kj==betInfo){
count=1;
return count;
}
}
}
return 0;
}
//广东11选5综合玩法
//号码为1到11,1-5为小,6到10为大,11为和
exports.GD11X5ZH=function(betData, kjData, Groupname){
var kjhe=0,val='';
var count=0;
var bet=betData;
var kj=kjData.split(',');
for(var i=0 in kj){
kjhe+=parseInt(kj[i],10);
}
var str=kjhe.toString();
var val2=parseInt(str.substr(-1),10);
if(Groupname=='第一球'){
val=parseInt(kj[0],10);
}else if(Groupname=='第二球'){
val=parseInt(kj[1],10);
}else if(Groupname=='第三球'){
val=parseInt(kj[2],10);
}else if(Groupname=='第四球'){
val=parseInt(kj[3],10);
}else if(Groupname=='第五球'){
val=parseInt(kj[4],10);
}else if(Groupname=='一中一'){
for(var i=0 in kj){
if(parseInt(bet,10)==parseInt(kj[i],10)){
count=1;
break;
}
}
return count;
}
if(val == parseInt(bet,10)){
count=1;
return count;
}else if(bet=='大'){
if(val>=6 && val<11) count=1;
if(val == 11) count = -1;
return count;
}else if(bet=='小'){
if(val>0 && val<=5) count=1;
if(val == 11) count = -1;
return count;
}else if(bet=='单'){
if(val%2!=0 && val != 11) count=1;
if(val == 11) count = -1;
return count;
}else if(bet=='双'){
if(val%2==0 && val != 11) count=1;
if(val == 11) count = -1;
return count;
}else if(bet=='总和大'){
if(kjhe>30) count=1;
if(kjhe==30) count = -1;
return count;
}else if(bet=='总和小'){
if(kjhe<30) count=1;
if(kjhe==30) count = -1;
return count;
}else if(bet=='总和30'){
if(kjhe==30) count=1;
return count;
}else if(bet=='总和单'){
if(kjhe%2!=0) count=1;
return count;
}else if(bet=='总和双'){
if(kjhe%2==0) count=1;
return count;
}else if(bet=='总和尾大'){
if(val2>4) count=1;
return count;
}else if(bet=='总和尾小'){