#
# This an input file to test dealer.  It generates a million hands without
# any constraints, then prints the frequency of the various suit lengths
# and hcp holdings.  The output can be piped into a perl-script to compare
# it against the theoretical holdings.  It should give a quick check if
# the deals you are producing are sort-of random.
#
generate 10000000

action 
        frequency  "HCP N"  (hcp(north), 0, 37),
        frequency  "HCP E"  (hcp(east),  0, 37),
        frequency  "HCP S"  (hcp(south), 0, 37),
        frequency  "HCP W"  (hcp(west),  0, 37),
        frequency  "Spades N"    (spades(north), 0, 13),
        frequency  "Spades E"    (spades(east), 0, 13),
        frequency  "Spades S"    (spades(south), 0, 13),
        frequency  "Spades W"    (spades(west), 0, 13),
        frequency  "Hearts N"    (hearts(north), 0, 13),
        frequency  "Hearts E"    (hearts(east), 0, 13),
        frequency  "Hearts S"    (hearts(south), 0, 13),
        frequency  "Hearts W"    (hearts(west), 0, 13),
        frequency  "Diamonds N"  (diamonds(north), 0, 13),
        frequency  "Diamonds E"  (diamonds(east), 0, 13),
        frequency  "Diamonds S"  (diamonds(south), 0, 13),
        frequency  "Diamonds W"  (diamonds(west), 0, 13),
        frequency  "Clubs N"     (clubs(north), 0, 13),
        frequency  "Clubs E"     (clubs(east), 0, 13),
        frequency  "Clubs S"     (clubs(south), 0, 13),
        frequency  "Clubs W"     (clubs(west), 0, 13),
        frequency  "Card N SA"   (hascard(north, AS), 0, 1),
        frequency  "Card N SK"   (hascard(north, KS), 0, 1),
        frequency  "Card N SQ"   (hascard(north, QS), 0, 1),
        frequency  "Card N SJ"   (hascard(north, JS), 0, 1),
        frequency  "Card N ST"   (hascard(north, TS), 0, 1),
        frequency  "Card N S9"   (hascard(north, 9S), 0, 1),
        frequency  "Card N S8"   (hascard(north, 8S), 0, 1),
        frequency  "Card N S7"   (hascard(north, 7S), 0, 1),
        frequency  "Card N S6"   (hascard(north, 6S), 0, 1),
        frequency  "Card N S5"   (hascard(north, 5S), 0, 1),
        frequency  "Card N S4"   (hascard(north, 4S), 0, 1),
        frequency  "Card N S3"   (hascard(north, 3S), 0, 1),
        frequency  "Card N S2"   (hascard(north, 2S), 0, 1),
        frequency  "Card N HA"   (hascard(north, AH), 0, 1),
        frequency  "Card N HK"   (hascard(north, KH), 0, 1),
        frequency  "Card N HQ"   (hascard(north, QH), 0, 1),
        frequency  "Card N HJ"   (hascard(north, JH), 0, 1),
        frequency  "Card N HT"   (hascard(north, TH), 0, 1),
        frequency  "Card N H9"   (hascard(north, 9H), 0, 1),
        frequency  "Card N H8"   (hascard(north, 8H), 0, 1),
        frequency  "Card N H7"   (hascard(north, 7H), 0, 1),
        frequency  "Card N H6"   (hascard(north, 6H), 0, 1),
        frequency  "Card N H5"   (hascard(north, 5H), 0, 1),
        frequency  "Card N H4"   (hascard(north, 4H), 0, 1),
        frequency  "Card N H3"   (hascard(north, 3H), 0, 1),
        frequency  "Card N H2"   (hascard(north, 2H), 0, 1),
        frequency  "Card N DA"   (hascard(north, AD), 0, 1),
        frequency  "Card N DK"   (hascard(north, KD), 0, 1),
        frequency  "Card N DQ"   (hascard(north, QD), 0, 1),
        frequency  "Card N DJ"   (hascard(north, JD), 0, 1),
        frequency  "Card N DT"   (hascard(north, TD), 0, 1),
        frequency  "Card N D9"   (hascard(north, 9D), 0, 1),
        frequency  "Card N D8"   (hascard(north, 8D), 0, 1),
        frequency  "Card N D7"   (hascard(north, 7D), 0, 1),
        frequency  "Card N D6"   (hascard(north, 6D), 0, 1),
        frequency  "Card N D5"   (hascard(north, 5D), 0, 1),
        frequency  "Card N D4"   (hascard(north, 4D), 0, 1),
        frequency  "Card N D3"   (hascard(north, 3D), 0, 1),
        frequency  "Card N D2"   (hascard(north, 2C), 0, 1),
        frequency  "Card N CA"   (hascard(north, AC), 0, 1),
        frequency  "Card N CK"   (hascard(north, KC), 0, 1),
        frequency  "Card N CQ"   (hascard(north, QC), 0, 1),
        frequency  "Card N CJ"   (hascard(north, JC), 0, 1),
        frequency  "Card N CT"   (hascard(north, TC), 0, 1),
        frequency  "Card N C9"   (hascard(north, 9C), 0, 1),
        frequency  "Card N C8"   (hascard(north, 8C), 0, 1),
        frequency  "Card N C7"   (hascard(north, 7C), 0, 1),
        frequency  "Card N C6"   (hascard(north, 6C), 0, 1),
        frequency  "Card N C5"   (hascard(north, 5C), 0, 1),
        frequency  "Card N C4"   (hascard(north, 4C), 0, 1),
        frequency  "Card N C3"   (hascard(north, 3C), 0, 1),
        frequency  "Card N C2"   (hascard(north, 2C), 0, 1),
        frequency  "Card E SA"   (hascard(east, AS), 0, 1),
        frequency  "Card E SK"   (hascard(east, KS), 0, 1),
        frequency  "Card E SQ"   (hascard(east, QS), 0, 1),
        frequency  "Card E SJ"   (hascard(east, JS), 0, 1),
        frequency  "Card E ST"   (hascard(east, TS), 0, 1),
        frequency  "Card E S9"   (hascard(east, 9S), 0, 1),
        frequency  "Card E S8"   (hascard(east, 8S), 0, 1),
        frequency  "Card E S7"   (hascard(east, 7S), 0, 1),
        frequency  "Card E S6"   (hascard(east, 6S), 0, 1),
        frequency  "Card E S5"   (hascard(east, 5S), 0, 1),
        frequency  "Card E S4"   (hascard(east, 4S), 0, 1),
        frequency  "Card E S3"   (hascard(east, 3S), 0, 1),
        frequency  "Card E S2"   (hascard(east, 2S), 0, 1),
        frequency  "Card E HA"   (hascard(east, AH), 0, 1),
        frequency  "Card E HK"   (hascard(east, KH), 0, 1),
        frequency  "Card E HQ"   (hascard(east, QH), 0, 1),
        frequency  "Card E HJ"   (hascard(east, JH), 0, 1),
        frequency  "Card E HT"   (hascard(east, TH), 0, 1),
        frequency  "Card E H9"   (hascard(east, 9H), 0, 1),
        frequency  "Card E H8"   (hascard(east, 8H), 0, 1),
        frequency  "Card E H7"   (hascard(east, 7H), 0, 1),
        frequency  "Card E H6"   (hascard(east, 6H), 0, 1),
        frequency  "Card E H5"   (hascard(east, 5H), 0, 1),
        frequency  "Card E H4"   (hascard(east, 4H), 0, 1),
        frequency  "Card E H3"   (hascard(east, 3H), 0, 1),
        frequency  "Card E H2"   (hascard(east, 2H), 0, 1),
        frequency  "Card E DA"   (hascard(east, AD), 0, 1),
        frequency  "Card E DK"   (hascard(east, KD), 0, 1),
        frequency  "Card E DQ"   (hascard(east, QD), 0, 1),
        frequency  "Card E DJ"   (hascard(east, JD), 0, 1),
        frequency  "Card E DT"   (hascard(east, TD), 0, 1),
        frequency  "Card E D9"   (hascard(east, 9D), 0, 1),
        frequency  "Card E D8"   (hascard(east, 8D), 0, 1),
        frequency  "Card E D7"   (hascard(east, 7D), 0, 1),
        frequency  "Card E D6"   (hascard(east, 6D), 0, 1),
        frequency  "Card E D5"   (hascard(east, 5D), 0, 1),
        frequency  "Card E D4"   (hascard(east, 4D), 0, 1),
        frequency  "Card E D3"   (hascard(east, 3D), 0, 1),
        frequency  "Card E D2"   (hascard(east, 2C), 0, 1),
        frequency  "Card E CA"   (hascard(east, AC), 0, 1),
        frequency  "Card E CK"   (hascard(east, KC), 0, 1),
        frequency  "Card E CQ"   (hascard(east, QC), 0, 1),
        frequency  "Card E CJ"   (hascard(east, JC), 0, 1),
        frequency  "Card E CT"   (hascard(east, TC), 0, 1),
        frequency  "Card E C9"   (hascard(east, 9C), 0, 1),
        frequency  "Card E C8"   (hascard(east, 8C), 0, 1),
        frequency  "Card E C7"   (hascard(east, 7C), 0, 1),
        frequency  "Card E C6"   (hascard(east, 6C), 0, 1),
        frequency  "Card E C5"   (hascard(east, 5C), 0, 1),
        frequency  "Card E C4"   (hascard(east, 4C), 0, 1),
        frequency  "Card E C3"   (hascard(east, 3C), 0, 1),
        frequency  "Card E C2"   (hascard(east, 2C), 0, 1),
        frequency  "Card S SA"   (hascard(south, AS), 0, 1),
        frequency  "Card S SK"   (hascard(south, KS), 0, 1),
        frequency  "Card S SQ"   (hascard(south, QS), 0, 1),
        frequency  "Card S SJ"   (hascard(south, JS), 0, 1),
        frequency  "Card S ST"   (hascard(south, TS), 0, 1),
        frequency  "Card S S9"   (hascard(south, 9S), 0, 1),
        frequency  "Card S S8"   (hascard(south, 8S), 0, 1),
        frequency  "Card S S7"   (hascard(south, 7S), 0, 1),
        frequency  "Card S S6"   (hascard(south, 6S), 0, 1),
        frequency  "Card S S5"   (hascard(south, 5S), 0, 1),
        frequency  "Card S S4"   (hascard(south, 4S), 0, 1),
        frequency  "Card S S3"   (hascard(south, 3S), 0, 1),
        frequency  "Card S S2"   (hascard(south, 2S), 0, 1),
        frequency  "Card S HA"   (hascard(south, AH), 0, 1),
        frequency  "Card S HK"   (hascard(south, KH), 0, 1),
        frequency  "Card S HQ"   (hascard(south, QH), 0, 1),
        frequency  "Card S HJ"   (hascard(south, JH), 0, 1),
        frequency  "Card S HT"   (hascard(south, TH), 0, 1),
        frequency  "Card S H9"   (hascard(south, 9H), 0, 1),
        frequency  "Card S H8"   (hascard(south, 8H), 0, 1),
        frequency  "Card S H7"   (hascard(south, 7H), 0, 1),
        frequency  "Card S H6"   (hascard(south, 6H), 0, 1),
        frequency  "Card S H5"   (hascard(south, 5H), 0, 1),
        frequency  "Card S H4"   (hascard(south, 4H), 0, 1),
        frequency  "Card S H3"   (hascard(south, 3H), 0, 1),
        frequency  "Card S H2"   (hascard(south, 2H), 0, 1),
        frequency  "Card S DA"   (hascard(south, AD), 0, 1),
        frequency  "Card S DK"   (hascard(south, KD), 0, 1),
        frequency  "Card S DQ"   (hascard(south, QD), 0, 1),
        frequency  "Card S DJ"   (hascard(south, JD), 0, 1),
        frequency  "Card S DT"   (hascard(south, TD), 0, 1),
        frequency  "Card S D9"   (hascard(south, 9D), 0, 1),
        frequency  "Card S D8"   (hascard(south, 8D), 0, 1),
        frequency  "Card S D7"   (hascard(south, 7D), 0, 1),
        frequency  "Card S D6"   (hascard(south, 6D), 0, 1),
        frequency  "Card S D5"   (hascard(south, 5D), 0, 1),
        frequency  "Card S D4"   (hascard(south, 4D), 0, 1),
        frequency  "Card S D3"   (hascard(south, 3D), 0, 1),
        frequency  "Card S D2"   (hascard(south, 2C), 0, 1),
        frequency  "Card S CA"   (hascard(south, AC), 0, 1),
        frequency  "Card S CK"   (hascard(south, KC), 0, 1),
        frequency  "Card S CQ"   (hascard(south, QC), 0, 1),
        frequency  "Card S CJ"   (hascard(south, JC), 0, 1),
        frequency  "Card S CT"   (hascard(south, TC), 0, 1),
        frequency  "Card S C9"   (hascard(south, 9C), 0, 1),
        frequency  "Card S C8"   (hascard(south, 8C), 0, 1),
        frequency  "Card S C7"   (hascard(south, 7C), 0, 1),
        frequency  "Card S C6"   (hascard(south, 6C), 0, 1),
        frequency  "Card S C5"   (hascard(south, 5C), 0, 1),
        frequency  "Card S C4"   (hascard(south, 4C), 0, 1),
        frequency  "Card S C3"   (hascard(south, 3C), 0, 1),
        frequency  "Card S C2"   (hascard(south, 2C), 0, 1),
        frequency  "Card W SA"   (hascard(west, AS), 0, 1),
        frequency  "Card W SK"   (hascard(west, KS), 0, 1),
        frequency  "Card W SQ"   (hascard(west, QS), 0, 1),
        frequency  "Card W SJ"   (hascard(west, JS), 0, 1),
        frequency  "Card W ST"   (hascard(west, TS), 0, 1),
        frequency  "Card W S9"   (hascard(west, 9S), 0, 1),
        frequency  "Card W S8"   (hascard(west, 8S), 0, 1),
        frequency  "Card W S7"   (hascard(west, 7S), 0, 1),
        frequency  "Card W S6"   (hascard(west, 6S), 0, 1),
        frequency  "Card W S5"   (hascard(west, 5S), 0, 1),
        frequency  "Card W S4"   (hascard(west, 4S), 0, 1),
        frequency  "Card W S3"   (hascard(west, 3S), 0, 1),
        frequency  "Card W S2"   (hascard(west, 2S), 0, 1),
        frequency  "Card W HA"   (hascard(west, AH), 0, 1),
        frequency  "Card W HK"   (hascard(west, KH), 0, 1),
        frequency  "Card W HQ"   (hascard(west, QH), 0, 1),
        frequency  "Card W HJ"   (hascard(west, JH), 0, 1),
        frequency  "Card W HT"   (hascard(west, TH), 0, 1),
        frequency  "Card W H9"   (hascard(west, 9H), 0, 1),
        frequency  "Card W H8"   (hascard(west, 8H), 0, 1),
        frequency  "Card W H7"   (hascard(west, 7H), 0, 1),
        frequency  "Card W H6"   (hascard(west, 6H), 0, 1),
        frequency  "Card W H5"   (hascard(west, 5H), 0, 1),
        frequency  "Card W H4"   (hascard(west, 4H), 0, 1),
        frequency  "Card W H3"   (hascard(west, 3H), 0, 1),
        frequency  "Card W H2"   (hascard(west, 2H), 0, 1),
        frequency  "Card W DA"   (hascard(west, AD), 0, 1),
        frequency  "Card W DK"   (hascard(west, KD), 0, 1),
        frequency  "Card W DQ"   (hascard(west, QD), 0, 1),
        frequency  "Card W DJ"   (hascard(west, JD), 0, 1),
        frequency  "Card W DT"   (hascard(west, TD), 0, 1),
        frequency  "Card W D9"   (hascard(west, 9D), 0, 1),
        frequency  "Card W D8"   (hascard(west, 8D), 0, 1),
        frequency  "Card W D7"   (hascard(west, 7D), 0, 1),
        frequency  "Card W D6"   (hascard(west, 6D), 0, 1),
        frequency  "Card W D5"   (hascard(west, 5D), 0, 1),
        frequency  "Card W D4"   (hascard(west, 4D), 0, 1),
        frequency  "Card W D3"   (hascard(west, 3D), 0, 1),
        frequency  "Card W D2"   (hascard(west, 2C), 0, 1),
        frequency  "Card W CA"   (hascard(west, AC), 0, 1),
        frequency  "Card W CK"   (hascard(west, KC), 0, 1),
        frequency  "Card W CQ"   (hascard(west, QC), 0, 1),
        frequency  "Card W CJ"   (hascard(west, JC), 0, 1),
        frequency  "Card W CT"   (hascard(west, TC), 0, 1),
        frequency  "Card W C9"   (hascard(west, 9C), 0, 1),
        frequency  "Card W C8"   (hascard(west, 8C), 0, 1),
        frequency  "Card W C7"   (hascard(west, 7C), 0, 1),
        frequency  "Card W C6"   (hascard(west, 6C), 0, 1),
        frequency  "Card W C5"   (hascard(west, 5C), 0, 1),
        frequency  "Card W C4"   (hascard(west, 4C), 0, 1),
        frequency  "Card W C3"   (hascard(west, 3C), 0, 1),
        frequency  "Card W C2"   (hascard(west, 2C), 0, 1),
 
 
