# Compare frequency of 1NT openings at various strengths. # # To execute: # deal -i ex/compare1NT.tcl [num] ######################################################### # # Use "format/none" if not displaying deals. # source format/none # # Allow a 6-card minor in NT openings # shapecond strongNT {(($s*$s+$h*$h+$d*$d+$c*$c)<=47) || (($h<4)&&($s<4)&&($s*$s+$h*$h+$d*$d+$c*$c)==53)} shapecond weakNT {(($h<5)&&($s<5)&&($s*$s+$h*$h+$d*$d+$c*$c)<=47) || (($h<4)&&($s<4)&&($s*$s+$h*$h+$d*$d+$c*$c)==53)} # # Declare the statistical collectors # set deals 0 set Num1517 0 set Num1416 0 set Num1315 0 set Num1214 0 set Num1113 0 set Num1012 0 proc 1517 {hand} { set hc [hcp $hand] reject unless {[strongNT $hand]} if { $hc < 15 || $hc > 17 } { return 0 } return 1 } proc 1416 {hand} { set hc [hcp $hand] reject unless {[strongNT $hand]} if { $hc < 14 || $hc > 16 } { return 0 } return 1 } proc 1315 {hand} { set hc [hcp $hand] reject unless {[weakNT $hand]} if { $hc < 13 || $hc > 15 } { return 0 } return 1 } proc 1214 {hand} { set hc [hcp $hand] reject unless {[weakNT $hand]} if { $hc < 12 || $hc > 14 } { return 0 } return 1 } proc 1113 {hand} { set hc [hcp $hand] reject unless {[weakNT $hand]} if { $hc < 11 || $hc > 13 } { return 0 } return 1 } proc 1012 {hand} { set hc [hcp $hand] reject unless {[weakNT $hand]} if { $hc < 10 || $hc > 12 } { return 0 } return 1 } main { incr deals if {[1517 north]} { incr Num1517 } if {[1416 north]} { incr Num1416 } if {[1315 north]} { incr Num1315 } if {[1214 north]} { incr Num1214 } if {[1113 north]} { incr Num1113 } if {[1012 north]} { incr Num1012 } accept } deal_finished { puts "# deals = $deals" puts "# 1517 = $Num1517" puts "# 1416 = $Num1416" puts "# 1315 = $Num1315" puts "# 1214 = $Num1214" puts "# 1113 = $Num1113" puts "# 1012 = $Num1012" }