debian/0000755000000000000000000000000011724671560007177 5ustar debian/install0000644000000000000000000000023611724666350010572 0ustar dealer usr/games Manual usr/share/doc/dealer Examples usr/share/doc/dealer Pre_Processors/Dist.pm usr/share/perl5/Dealer Post_Processors usr/share/doc/dealer debian/dirs0000644000000000000000000000003711724666350010064 0ustar usr/games usr/share/doc/dealer debian/patches/0000755000000000000000000000000011724670566010633 5ustar debian/patches/preprocessors0000644000000000000000000000030711724667247013471 0ustar --- dealer-0.20040530.orig/Pre_Processors/dpp +++ dealer-0.20040530/Pre_Processors/dpp @@ -1,6 +1,6 @@ -#!/usr/bin/perl -I. +#!/usr/bin/perl -use Dist; +use Dealer::Dist; use strict; use Carp; debian/patches/help0000644000000000000000000000067611724667276011523 0ustar --- dealer-0.20040530.orig/dealer.c +++ dealer-0.20040530/dealer.c @@ -1621,7 +1622,7 @@ } } if (argc - optind > 2 || errflg) { - fprintf (stderr, "Usage: %s [-emvu] [-s seed] [-p num] [-v num] [inputfile]\n", argv[0]); + fprintf (stderr, "Usage: %s [-023ehuvmqV] [-p n] [-g n] [-s seed] [-l n] [inputfile]\n", argv[0]); exit (-1); } if (optind < argc && freopen (input_file = argv[optind], "r", stdin) == NULL) { debian/patches/grammar0000644000000000000000000000345311724667247012213 0ustar --- dealer-0.20040530.orig/defs.y +++ dealer-0.20040530/defs.y @@ -4,7 +4,7 @@ #ifdef WIN32 -// void * _alloca( size_t ) ; +/* void * _alloca( size_t ) ; */ #define alloca _alloca #endif /* WIN32 */ @@ -49,23 +49,23 @@ char y_distr[4]; } -%left QUERY, COLON +%left QUERY COLON %left OR2 %left AND2 -%left CMPEQ, CMPNE -%left CMPLT, CMPLE, CMPGT, CMPGE -%left ARPLUS, ARMINUS -%left ARTIMES, ARDIVIDE, ARMOD +%left CMPEQ CMPNE +%left CMPLT CMPLE CMPGT CMPGE +%left ARPLUS ARMINUS +%left ARTIMES ARDIVIDE ARMOD %nonassoc NOT -%token GENERATE, PRODUCE, HCP, SHAPE, ANY, EXCEPT, CONDITION, ACTION -%token PRINT, PRINTALL,PRINTEW, PRINTPBN, PRINTCOMPACT, PRINTONELINE -%token AVERAGE, HASCARD, FREQUENCY, PREDEAL, POINTCOUNT, ALTCOUNT -%token CONTROL, LOSER, DEALER, VULNERABLE -%token QUALITY, CCCC -%token TRICKS, NOTRUMPS, NORTHSOUTH, EASTWEST -%token EVALCONTRACT, ALL, NONE, SCORE, IMPS, RND -%token PT0,PT1,PT2,PT3,PT4,PT5,PT6,PT7,PT8,PT9,PRINTES +%token GENERATE PRODUCE HCP SHAPE ANY EXCEPT CONDITION ACTION +%token PRINT PRINTALL PRINTEW PRINTPBN PRINTCOMPACT PRINTONELINE +%token AVERAGE HASCARD FREQUENCY PREDEAL POINTCOUNT ALTCOUNT +%token CONTROL LOSER DEALER VULNERABLE +%token QUALITY CCCC +%token TRICKS NOTRUMPS NORTHSOUTH EASTWEST +%token EVALCONTRACT ALL NONE SCORE IMPS RND +%token PT0 PT1 PT2 PT3 PT4 PT5 PT6 PT7 PT8 PT9 PRINTES %token NUMBER %token HOLDING @@ -77,10 +77,10 @@ %token SUIT %token CARD %token CONTRACT -%token DISTR, DISTR_OR_NUMBER +%token DISTR DISTR_OR_NUMBER %type expr -%type number, compass, printlist, shlprefix, any, vulnerable +%type number compass printlist shlprefix any vulnerable %type shape %type actionlist action %type exprlist debian/patches/makefile0000644000000000000000000000332211724670566012333 0ustar --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # $Header: /home/henk/CVS/dealer/Makefile,v 1.15 1999/08/05 19:57:44 henk Exp $ CC = gcc -CFLAGS = -Wall -pedantic -O2 -I. -DNDEBUG -c +CFLAGS = -Wall -pedantic -O2 -I. -DNDEBUG -c $(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get CPPFLAGS) FLEX = flex YACC = yacc @@ -17,14 +17,15 @@ OBJ = dealer.o defs.o pbn.o c4.o getopt.o pointcount.o LOBJ = scan.c YOBJ = defs.c +MAN = dealer.6 dealer.dpp.6 -dealer: ${OBJ} ${LOBJ} ${YOBJ} +dealer: ${OBJ} ${LOBJ} ${YOBJ} ${MAN} ${MAKE} -C Random lib - $(CC) -o $@ ${OBJ} -L./Random -lgnurand + $(CC) -o $@ ${OBJ} -L./Random -lgnurand $(shell dpkg-buildflags --get LDFLAGS) clean: - rm -f ${OBJ} ${LOBJ} ${YOBJ} + rm -f ${OBJ} ${LOBJ} ${YOBJ} ${MAN} dealer ${MAKE} -C Examples clean ${MAKE} -C Random clean @@ -60,6 +61,12 @@ .c.o: ${CC} ${CFLAGS} -o $@ $< +# +# Manpages +# +%.6: %.pod + pod2man --section=6 --release="Dealer" --center="User Documentation" $< > $@ + # # File dependencies # --- a/Examples/Makefile +++ b/Examples/Makefile @@ -12,11 +12,11 @@ test: examples distribution distribution: - ../dealer -s 1 Output.distribution + ../dealer -s 1 Output.distribution diff Output.distribution Refer.distribution examples: - test_dealer.pl + ./test_dealer.pl refer: -for f in ${OUTPUT}; do \ --- a/Random/Makefile +++ b/Random/Makefile @@ -1,7 +1,7 @@ SRC = $(wildcard *.c) OBJ = $(subst .c,.o,$(wildcard *.c)) GCC = gcc -GCCFLAGS = -c -Wall -O2 -I. +GCCFLAGS = -c -Wall -O2 -I. $(shell dpkg-buildflags --get CFLAGS) HDR = ansidecl.h LIB = libgnurand.a AR = ar debian/patches/manpages0000644000000000000000000002033611724667247012357 0ustar --- dealer-0.20040530.orig/dealer.dpp.pod +++ dealer-0.20040530/dealer.dpp.pod @@ -0,0 +1,167 @@ +=head1 NAME + +dealer.dpp - preprocessor for dealer scripts + +=head1 SYNOPSIS + +B [I] + +=head1 DESCRIPTION + +dealer.dpp stands for dealer-pre-processor. Its main purpose it to preprocess +input files for Hans van Staveren's great dealer program. + +=head1 SYNTAX + +The program expands shape specifications of the form: + + shape{COMPASS, shp1 + shp2 + ... + shpM - shm1 - ... - shmN} + +=head2 regular shapes + +7xxx, 4432, 4xx5 have the same meaning as in original dealer. + +=head2 the `at least' operator + +whenever you put a `+' after a suit-length, it means `at least'. + + shape{north, 5+xx5+}: at least 5/5 in the blacks, + -->shape(north,5xx5 + 5xx6 + 6xx5 + 5xx7 + 6xx6 + 7xx5 + 5008 + 6007 + + 7006 + 8005) + +=head2 the `at most' operator: + +same as the `at least', just use a `-': + + shape{north, 2-xxx}: at most 2 spades, + -->shape(north,0xxx + 1xxx + 2xxx) + +=head2 the `range' operator: + +the range operator operates on a single suit. It comes with [], +like in Perl. + + shape{north, x[3-5]x[13]}: (3 to 5) hearts, and one or 3 clubs + -->shape(north,x3x1 + x4x1 + x3x3 + x5x1 + x4x3 + x5x3) + +Note that shape{north, 3-xxx} is equivalent to shape{north,[0-3]xxx} +You can write compound ranges if you want: + + shape{north, [013-68]xxx} means: 0,1,3,4,5,6 or 8 spades. + +=head2 the `permutation' operator: + +the permutation operator will appears as () like in the WBF rules +of specifying shapes. + + shape{north, (4432)}: any 4432 hand. + -->shape(north,any 4432) + +what's best is that the () operator can operate on restricted groups +of cards: + + shape{north, 5s(431)}: 5 spades, the others suits being (431). + -->shape(north,5134 + 5314 + 5143 + 5341 + 5413 + 5431) + +What you have to do is: + +=over + +=item * + +specify the suit names (s,h,d,c in english) in the left part of +the shape, in any order, + +=item * + +and enclose the rest of the permutation into () in the right part. + +=back + +A (complicated) example: + + shape{north, 4+c3+d(2+2+)}: at least 5 clubs, at least 3 diamonds, + and no short major. + -->shape(north,3334 + 4234 + 2434 + 3244 + 2344 + 2254 + 3235 + 2335 + 2245 + 2236) + +=head2 the `Major' operator: + +has to be used together with the () operator. `M' stands for `a major' +The `M' operator can only be used in the left part (never put a M +inside the parens) + + shape{north, 5M(xxx)} + -->shape(north,x5xx + 5xxx) + + shape{north, 5+M3+c(31)} + -->shape(north,1534 + 3514 + 1633 + 3613 + 5134 + 5314 + 6133 + 6313) + +=head2 the `minor' operator: + +same as the `Major' operator, but in lowercase `m'. + + shape{north, 5M5m(xx)} + -->shape(north,x5x5 + 5xx5 + x55x + 5x5x) + +=head2 the `conditional' operator: + +you've got the possibility of specifying complex conditions to be +verified that cannot be simply expressed by other operators. In +order to do that, you use the `:' operator, just after the +atomic-shape specification: + + shape{north, shp1:condition1,condition2,...} + +The conditions use the letters (s,h,d,c) as variables for the suit +lengths, and the usual C-operators (*,+,-,/,>,<,==,!,?, and so on). +Note that the `,' stands for the `and-logical' operator. You can +use `or' for the `or-logical' operator. + + shape{north, 4+s4+h(xx):d>c,h+s==10} + -->shape(north,6421 + 6430 + 5521 + 5530 + 4621 + 4630) + +=head1 EXAMPLES + +=over + +=item a balanced hand + + (3+3+3+2+) + +=item a french 1H opening + + x5+xx:h>s,h>=d,h>=c + +=item my No_trump opening + + hn = hcp(north) + n1NT = (hn > 14 and hn < 18 and shape{north, 5m(332) + 5m2s(42)} ) + or (hn > 13 and hn < 17 and shape{north, 6m(322)} ) + or (hn > 15 and hn < 18 and shape{north, 5M(332)} ) + or (hn > 15 and hn < 19 and shape{north, (4432) + (4333)} ) + +=back + +=head1 SEE ALSO + +dealer(6), +F. + +=head1 AUTHORS + +=over + +=item Francois Dellacherie + +=item Manpage: Christoph Berg + +=back + +=head1 LICENSE + +This program is hereby put in the public domain. Do with it whatever +you want, but I would like you not to redistribute it in modified form +without mentioning the fact of modification. I will accept bug reports +and modification requests, without any obligation of course, but fixing +bugs someone else put in is beyond me. + --- dealer-0.20040530.orig/dealer.pod +++ dealer-0.20040530/dealer.pod @@ -0,0 +1,133 @@ +=head1 NAME + +dealer - bridge hand generator + +=head1 SYNOPSIS + +B [-023ehuvmqV] [-p I] [-g I] [-s I] [-l I] [I] + +=head1 DESCRIPTION AND EXAMPLE + +The program dealer can be used to generate hands for partnerships bidding training or for generating +statistics that can be used to design conventions, or win postmortems. + +Running the program involves 3 steps. First, the user has to write an input file containing +hand-descriptions and action. A very simple example would look something like: + + condition shape(north, any 4333 + any 4423) and hcp(north)>=19 + action printall + +The first line specifies a condition for the north hand, in this case, a hand with 4333 or 4432 shape +and at least 19 high card points. The second line tells the program to print the 4 hands. The program +reads from standard input, so in principle, it is possible to enter the conditions directly into the +program. Using a file is a lot more practical though, as it allows the user to re-use conditions and +fine-tune the conditions. + +Then the program has to be run, it reads the file, looks at the various command line switches and then +produces a number of hands. The output appears on the screen but can be re-directed to a file. + +Finally, the user has to look at output and analyze the produced hands. Alternatively, the output can +be used for a playing program. + +=head1 OPTIONS + +=over + +=item B<-e> + +Exhaust mode (alpha version). + +=item B<-g> I + +Maximum number of hands to generate (default is 1000000). + +=item B<-l> I + +Instead of shuffling, deals are read from the file library.dat by M. Ginsberg +(see [1]). When using this, the tricks() function is quite fast and bridge.exe +from GIB is not used. + +[1] ftp://ftp.cirl.uoregon.edu/pub/users/ginsberg/bridge/ + +=item B<-m> + +Shows a progress meter. + +=item B<-p> I + +Maximum number of hands to produce (default is 40). + +=item B<-q> + +Suppress PBN output (useful for testing, then switch it back on when generating the "final" sample). + +=item B<-s> I + +Uses number as the seed for the random generator, running the program twice +with the same seed will produce the same sequence of hands. + +=item B<-u> + +Select uppercase for the symbols "AKQJT" (default is lowercase). + +=item B<-v> + +Toggle verbose output, prints statistics at the end of the run (default is on). + +=item B<-V> + +Emit a version-identification string and exit. + +=item B<-h> + +Help, prints the syntax. + +=item B<-0> + +No swapping, each deal is generated normally (shuffling) (default). + +=item B<-2> + +2-way swapping, after each shuffle another deal is generated by permuting E and +W, leaving N and S in place (NB: not fully compatible with predeal). + +=item B<-3> + +3-way swapping, after each shuffle another 5 deals are generated by permuting +E, W, and S every which way, leaving N in place (NB: not fully compatible with +predeal). + +=back + +=head1 BUGS + +I would prefer if you did B use this program for generating hands +for tournaments. I have not investigated the random number generation +closely enough for me to be comfortable with that thought. + +=head1 SEE ALSO + +F, +dealer.dpp(6), +deal(6). + +=head1 AUTHORS + +=over + +=item Hans van Staveren + +=item Henk Uijterwaal + +=item Manpage: Christoph Berg + +=back + +=head1 COPYRIGHT AND LICENSE + +This program is hereby put in the public domain. Do with it whatever +you want, but I would like you not to redistribute it in modified form +without mentioning the fact of modification. I will accept bug reports +and modification requests, without any obligation of course, but fixing +bugs someone else put in is beyond me. + debian/patches/series0000644000000000000000000000006611724670427012046 0ustar grammar help makefile manpages preprocessors randmask debian/patches/randmask0000644000000000000000000000102411724667247012355 0ustar --- dealer-0.20040530.orig/dealer.c +++ dealer-0.20040530/dealer.c @@ -51,6 +51,7 @@ #define DEFAULT_MODE STAT_MODE #define RANDBITS 16 #define NRANDVALS (1<> (31 - RANDBITS)); #endif /* STD_RAND */ - j = zero52[k]; + j = zero52[k & NRANDMASK]; } while (j == 0xFF); } while (stacked_pack[j] != NO_CARD); debian/docs0000644000000000000000000000003211724666350010046 0ustar Pre_Processors/README.dpp debian/source/0000755000000000000000000000000011724667431010501 5ustar debian/source/format0000644000000000000000000000001411724667431011707 0ustar 3.0 (quilt) debian/copyright0000644000000000000000000000602011724666350011131 0ustar This package was debianized by Christoph Berg on Fri, 17 Jun 2005 16:24:24 +0200. It was downloaded from: http://www.dombo.org/henk/dealer.html Authors: Hans van Staveren Henk Uijterwaal Copyright Holder: Public domain. License for dealer: This program is hereby put in the public domain. Do with it whatever you want, but I would like you not to redistribute it in modified form without mentioning the fact of modification. I will accept bug reports and modification requests, without any obligation of course, but fixing bugs someone else put in is beyond me. License for getopt.c: Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95 Free Software Foundation, Inc. Modified (1993) from bison-1.20 by Wilfred J. Hansen (wjh+@cmu.edu) Andrew Consortium, Carnegie Mellon University This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. License for Random/(s)rand.c: /* Copyright (C) 1991 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL'. License for Random/__random.c: Copyright (c) 1983 Regents of the University of California. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of California, Berkeley. The name of the University may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. This is derived from the Berkeley source: @(#)random.c 5.5 (Berkeley) 7/6/88 It was reworked for the GNU C Library by Roland McGrath. debian/control0000644000000000000000000000141211724666477010613 0ustar Source: dealer Section: games Priority: optional Maintainer: Christoph Berg Build-Depends: debhelper (>= 9), bison, perl Standards-Version: 3.9.3 Vcs-Browser: http://svn.df7cb.de/debian/dealer/trunk/ Vcs-Svn: http://svn.df7cb.de/debian/dealer/trunk/ Package: dealer Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: bridge hand generator This program generates bridge hands for partnerships bidding training or for generating statistics that can be used to design conventions, or win postmortems. Dealer has been used in many bridge publications. . http://www.dombo.org/henk/dealer.html . Bridge is an intellectually challenging card game for four players. The "deal" package provides a similar generator programmable in Tcl. debian/rules0000755000000000000000000000302011724671553010254 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 CFLAGS = -Wall -g D=$(CURDIR)/debian/dealer ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif configure: configure-stamp configure-stamp: dh_testdir # some generated files in tarball are removed by clean if [ ! -f .defs.c ] ; then cp defs.c .defs.c ; fi if [ ! -f .scan.c ] ; then cp scan.c .scan.c ; fi touch $@ build-indep: build build-arch: build-stamp build-stamp: configure-stamp dh_testdir $(MAKE) touch $@ clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp # some generated files in tarball are removed by clean if [ ! -f .defs.c ] ; then cp defs.c .defs.c || true ; fi if [ ! -f .scan.c ] ; then cp scan.c .scan.c || true ; fi $(MAKE) clean if [ -f .defs.c ] ; then mv .defs.c defs.c ; fi if [ -f .scan.c ] ; then mv .scan.c scan.c ; fi dh_clean install: build dh_testdir dh_testroot dh_prep dh_installdirs dh_install cp Pre_Processors/dpp $D/usr/games/dealer.dpp rm $D/usr/share/doc/dealer/Examples/.cvsignore find $D -name .svn -type d | xargs rm -rf # Build architecture-independent files here. binary-indep: # Build architecture-dependent files here. binary binary-arch: install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installman dealer*.6 dh_strip dh_compress dh_fixperms dh_shlibdeps dh_installdeb dh_gencontrol dh_md5sums dh_builddeb .PHONY: build build-indep build-arch clean binary-indep binary-arch binary install configure debian/compat0000644000000000000000000000000211724667476010410 0ustar 9 debian/changelog0000644000000000000000000000123011724670275011047 0ustar dealer (0.20040530-4) unstable; urgency=low * Enable build hardening. -- Christoph Berg Sun, 04 Mar 2012 14:24:11 +0100 dealer (0.20040530-3) unstable; urgency=low * Improve manpage a bit. -- Christoph Berg Thu, 17 May 2007 22:07:27 +0200 dealer (0.20040530-2) unstable; urgency=low * Fix spelling error in Description (Closes: #363231). -- Christoph Berg Tue, 18 Apr 2006 17:14:34 +0200 dealer (0.20040530-1) unstable; urgency=low * Initial release (Closes: #323076). * dealer.c: 64bit fix. * Wrote manpages. -- Christoph Berg Wed, 7 Sep 2005 23:32:20 +0200