Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
anntzer committed Jun 11, 2012
0 parents commit 5c14b8d
Show file tree
Hide file tree
Showing 19 changed files with 7,022 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
@@ -0,0 +1,5 @@
*.o
*.so.*
*.pyc
.*.swp

674 changes: 674 additions & 0 deletions GPL-3.0.txt

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions LICENSE.txt
@@ -0,0 +1,7 @@
Copyright (C) 2012, Antony Lee

Redeal is released under the GNU General Public License v3.0.
See the file, GPL-3.0.txt, for the complete text of the license.

The DDS code was obtained from the source of Thomas Andrews' Deal, which is
under a different license and copyright.
12 changes: 12 additions & 0 deletions README.txt
@@ -0,0 +1,12 @@
Redeal: a reimplementation of Thomas Andrews' Deal in Python.
=============================================================

Redeal runs under Python 3. See script.py for an example simulation.

GNU make and g++ are needed to build Bo Haglund's DDS v.1.1.9 (the latest
version I could find that can easily be built on Linux -- extracted and
slightly modified from the source of Thomas Andrews' Deal). Simply run `make`
in the dds-1.1.9 folder.

Then run `./redeal.py --help`, or `./redeal.py -n 10` to get a few hands, or
`./redeal.py -n 10 script` for an example simulation.
340 changes: 340 additions & 0 deletions dds-1.1.9/GPL.txt

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions dds-1.1.9/Holding.h
@@ -0,0 +1,41 @@
#ifndef __DDS_HOLDING_H__
#define __DDS_HOLDING_H__
#include "ddsInterface.h"

/*
* This is just a utility class so you can say:
* cout << Holding(h) << endl;
* when h is of type holding_t.
*/
struct Holding {
holding_t _h;
inline Holding(holding_t h) : _h(h) { }
inline operator holding_t() const {
return _h;
}

inline const Holding &operator=(holding_t h) {
_h = h;
return *this;
}
};


inline ostream& operator <<(ostream &out,const Holding &holding) {
static const char *cards="AKQJT98765432";
int index=0;
holding_t h = holding._h;

if (h&8191) {
for (holding_t card=1<<12; card; card >>= 1, index++) {
if (h & card) {
out << cards[index];
}
}
} else {
out << "void";
}
out << " (" << holding._h << ")";
return out;
}
#endif
26 changes: 26 additions & 0 deletions dds-1.1.9/LICENSE.txt
@@ -0,0 +1,26 @@
Copyright (C) 1996-2001, Thomas Andrews.

Deal is released under the GNU General Public License.
See the file, GPL, for the complete text of the license.

The DDS code is under a different license and copyright.

The file random.c has a seperate copyright:

/*
* 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.
*/

12 changes: 12 additions & 0 deletions dds-1.1.9/Makefile
@@ -0,0 +1,12 @@
all: libdds.so.1.1.9

libdds.so.1.1.9: dds.o ddsLookup.o
g++ -shared -Wl,-soname,libdds.so.1 -o $@ *.o

.cpp.o:
g++ -O3 -fPIC -c $< -o $@

clean:
-rm *.o libdds.so.1.1.9

.PHONY: clean

0 comments on commit 5c14b8d

Please sign in to comment.