Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5c14b8d
Showing
19 changed files
with
7,022 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*.o | ||
*.so.* | ||
*.pyc | ||
.*.swp | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Oops, something went wrong.