Re: [公告] 共牌

楼主: meconin (静、云影─迷梦情)   2011-10-29 22:22:29
新功能 ... KRP
不过这次只提供计算用的 code
学资讯的哪位学弟整合一下吧
顺便帮忙看一下有没有 bug
拿来叫牌练习用的范例
sample: http://cmlab.csie.ntu.edu.tw/~meconin/deal319/twohandsinglecolumn.tcl
result: http://cmlab.csie.org/~meconin/deal319/output/twohandsinglecolumn.txt
大牌 牌组品质 分配调整
set KRP [expr [RP north] + [QP north] + [DP north]]
holdingProc -double QP {length A K Q J T x9 x8} {
variable double QUALITY
set QUALITY [expr $A * 4 + $K * 3 + $Q * 2 + $J]
if {$length >= 9} {
if {$Q == 0} {
set QUALITY [expr $QUALITY + 2]
}
if {$J == 0} {set QUALITY [expr $QUALITY + 1]}
}
if {$length == 8} {
if {$Q == 0} {
set QUALITY [expr $QUALITY + 2]
}
if {$Q == 1 && $J == 0} {set QUALITY [expr $QUALITY + 1]}
}
if {$length == 7} {
if {$Q == 0 || $J == 0} {set QUALITY [expr $QUALITY + 1]}
}
if {$length <= 6} {
if {$T == 1} {
if {$A + $K + $Q >= 2 || $J == 1} {
set QUALITY [expr $QUALITY + 1]
} else {set QUALITY [expr $QUALITY + 0.5]}
}
if {$x9 == 1} {
if {$T == 1 || $x8 == 1 || $A + $K + $Q + $J >= 2} {
set QUALITY [expr $QUALITY + 1]
}
}
}
return [expr $QUALITY * $length * 0.1]
}
holdingProc -double RP {length A K Q J T x9 x8} {
if {$length >= 3} {
set counter [expr $A * 3 + $K * 2]
if {$Q == 1} {
if {$A == 1 || $K == 1} {
set counter [expr $counter + 1]
} else {
set counter [expr $counter + 0.75]
}
}
if {$J == 1} {
if {$A + $K + $Q == 2} {
set counter [expr $counter + 0.5]
}
if {$A + $K + $Q == 1} {
set counter [expr $counter + 0.25]
}
}
if {$T == 1} {
if {$A + $K + $Q + $J + $x9 >= 2} {
set counter [expr $counter + 0.25]
}
}
return $counter
}
if {$length == 2} {
set counter [expr $A * 3 + $K * 2]
if {$Q == 1} {
if {$A == 1 || $K == 1} {
set counter [expr $counter + 0.5]
} else {
set counter [expr $counter + 0.25]
}
}
if {$J == 1} {
if {$A + $K + $Q == 2} {
set counter [expr $counter + 0.5]
}
if {$A + $K + $Q == 1} {
set counter [expr $counter + 0.25]
}
}
if {$T == 1} {
if {$A + $K + $Q + $J + $x9 >= 2} {
set counter [expr $counter + 0.25]
}
}
return $counter
}
if {$length == 1} {
return [expr $A * 3 + $K * 0.5]
}
if {$length == 0} {
return 0
}
return 0
}
shapefunc DP {
set ret -1
if { $s * $s + $h * $h + $d * $d + $c * $c == 43} {return -0.5}
if {$s == 0} {set ret [expr $ret + 3]}
if {$h == 0} {set ret [expr $ret + 3]}
if {$d == 0} {set ret [expr $ret + 3]}
if {$c == 0} {set ret [expr $ret + 3]}
if {$s == 1} {set ret [expr $ret + 2]}
if {$h == 1} {set ret [expr $ret + 2]}
if {$d == 1} {set ret [expr $ret + 2]}
if {$c == 1} {set ret [expr $ret + 2]}
if {$s == 2} {set ret [expr $ret + 1]}
if {$h == 2} {set ret [expr $ret + 1]}
if {$d == 2} {set ret [expr $ret + 1]}
if {$c == 2} {set ret [expr $ret + 1]}
return $ret
}
: 第 1 牌,北家开叫,双无身价 第 2 牌,东家开叫,南北身价 第 3 牌,南家开叫,东西身价 第 4 牌,西家开叫,双有身价
: S AQ8 S Q943 S T S A952
: H 75 H 543 H QT953 H QT73
: D Q32 D AK5 D 3 D J
: C KT763 C K92 C A97643 C AK97
: S 654 S T73 S 82 S 765 S 854 S AKQ7 S 863 S KQJ7
: H K H 96432 H 962 H K87 H 42 H KJ8 H A95 H 86
: D KT7 D A984 D 84 D JT976 D QT9872 D AK5 D Q932 D K86
: C AJ9842 C 5 C QT7543 C J8 C KQ C J82 C 632 C QT85
: S KJ92 S AKJT S J9632 S T4
: H AQJT8 H AQJT H A76 H KJ42
: D J65 D Q32 D J64 D AT754
: C Q C A6 C T5 C J4
: C D H S NT C D H S NT C D H S NT C D H S NT
: N 8 8 10 10 10 N 9 11 13 13 13 N 8 2 8 3 2 N 8 7 9 7 7
: E 5 5 3 3 3 E 4 2 0 0 0 E 5 11 4 9 11 E 5 5 3 4 5
: S 8 8 10 10 10 S 9 11 13 13 13 S 8 2 8 3 2 S 8 7 9 7 7
: W 5 5 3 3 3 W 4 2 0 0 0 W 5 11 4 9 10 W 5 5 3 4 5
: 第 5 牌,北家开叫,南北身价 第 6 牌,东家开叫,东西身价 第 7 牌,南家开叫,双有身价 第 8 牌,西家开叫,双无身价
: S K954 S QT643 S JT83 S A7
: H J9852 H KQJ8 H 54 H AQ643
: D 5 D 642 D Q53 D KQ9
: C A53 C 6 C AKJ3 C QT8
: S 6 S J72 S 75 S 98 S K42 S Q965 S J8643 S QT2
: H AK4 H T73 H 762 H AT93 H 9876 H AQJT H JT2 H K85
: D AK876 D JT432 D QT987 D A3 D AT74 D KJ86 D A43 D J86
: C J842 C KT C Q53 C AT982 C 64 C 8 C K5 C 9762
: S AQT83 S AKJ2 S A7 S K95
: H Q6 H 54 H K32 H 97
: D Q9 D KJ5 D 92 D T752
: C Q976 C KJ74 C QT9752 C AJ43
: C D H S NT C D H S NT C D H S NT C D H S NT
: N 7 3 7 9 6 N 7 7 7 10 7 N 9 3 3 5 7 N 9 9 9 7 8
: E 5 10 5 4 7 E 6 6 5 3 4 E 4 10 9 8 5 E 3 4 4 6 4
: S 7 3 7 9 6 S 7 7 8 10 9 S 9 3 3 5 7 S 10 9 9 7 8
: W 5 10 5 4 7 W 6 6 5 3 4 W 4 10 9 8 5 W 3 4 4 6 5
: 第 9 牌,北家开叫,东西身价 第 10 牌,东家开叫,双有身价 第 11 牌,南家开叫,双无身价 第 12 牌,西家开叫,南北身价
: S J98643 S AJ963 S AT832 S AQT
: H J42 H A5 H A542 H Q2
: D 2 D A962 D A83 D A8762
: C 652 C A4 C Q C AT3
: S AQT S 752 S Q4 S 875 S K7 S J94 S J985 S K
: H AKQ3 H 985 H KQJ972 H 643 H KQ3 H T9876 H 653 H AJT9874
: D Q54 D KJT7 D KJ D 84 D KQ952 D T64 D T3 D K5
: C J73 C K94 C K73 C JT952 C 974 C 62 C K742 C Q96
: S K S KT2 S Q65 S 76432
: H T76 H T8 H J H K
: D A9863 D QT753 D J7 D QJ94
: C AQT8 C Q86 C AKJT853 C J85
: C D H S NT C D H S NT C D H S NT C D H S NT
: N 5 4 3 6 3 N 6 11 6 11 9 N 11 6 6 10 11 N 7 10 5 9 6
: E 6 9 7 6 10 E 6 2 7 2 2 E 1 5 6 1 1 E 6 3 8 4 4
: S 6 4 3 6 3 S 7 11 6 11 9 S 11 6 6 10 11 S 7 10 4 9 6
: W 6 8 7 6 9 W 6 2 7 2 2 W 1 5 6 1 1 W 6 3 8 4 4
: 第 13 牌,北家开叫,双有身价 第 14 牌,东家开叫,双无身价 第 15 牌,南家开叫,南北身价 第 16 牌,西家开叫,东西身价
: S AQ5 S QT9 S T S KT8
: H K43 H KT4 H KT32 H T7
: D K73 D T4 D QJT65 D J653
: C QJ53 C AT763 C A74 C KQ73
: S J7643 S 9 S 842 S 76 S K9642 S AQJ83 S
作者: ajt (文旦包包)   0000-00-00 00:00:00
推!

Links booklink

Contact Us: admin [ a t ] ucptt.com