redeal icon indicating copy to clipboard operation
redeal copied to clipboard

Analyzing partially played hands

Open LyonsDo opened this issue 10 years ago • 57 comments

Script fails for me due to SystemError: Parent module '' not loaded, cannot perform relative import.

I had probably worked around that, but then started to get "is not a valid Win32 application" due to dll_path issues. Probably some mix of Python55 and a Windows 64-bit machine but too time intensive to try and resolve.

LyonsDo avatar Sep 21 '15 10:09 LyonsDo

Can you let me know what you did exactly, so that I can at least try to reproduce this issue? Thanks for the report.

anntzer avatar Sep 21 '15 15:09 anntzer

Hi Antony,

Thanks for the reply - I appreciate it!

I used "deal" successfully about a year ago but when I tried to reuse it I had problems with Tcl versions and don't love Tcl in any case so I was very pleased to see your code. I've used Python occasionally but am far from being an expert.

I uninstalled my old Python version and downloaded Python35 for Windows 7 64-bit (python-3.5.0-amd64.exe). Then downloaded your code and ran setup.py install as suggested. That didn't generate an exe as I expected but I do now have a redeal-master\redeal folder containing redeal.py and with redeal-master\dist folder with redeal-0.2.0-py3.5.egg.

Initially I didn't have colorama, but I managed to get that installed OK (I think).

I added the redeal-master\redeal to %PATH% and then tried to run as follows:

C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal>redeal.py Traceback (most recent call last): File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal\redeal.py", line 22, in from . import global_defs, dds, util SystemError: Parent module '' not loaded, cannot perform relative import

I read various posts about relative vs absolute imports and it wasn't clear to me how to resolve the issue, so I just pasted defs, dds, util into redeal.py and removed those import statements (I needed to change sys to _sys when doing that - have no idea if that breaks anything).

That got me to the point of generating the DDL errror which typically seems to indicate trying to run a 32-program on a 64-bit machine and probably has nothing to do with your code.

Best,

Donal.

On 21 September 2015 at 17:30, Antony Lee [email protected] wrote:

Can you let me know what you did exactly, so that I can at least try to reproduce this issue? Thanks for the report.

— Reply to this email directly or view it on GitHub https://github.com/anntzer/redeal/issues/4#issuecomment-142016035.

LyonsDo avatar Sep 21 '15 15:09 LyonsDo

P.S. Same issue arose when trying to run from IDLE

Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information.

RESTART: C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal\redeal.py Traceback (most recent call last): File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal\redeal.py", line 22, in from . import global_defs, dds, util SystemError: Parent module '' not loaded, cannot perform relative import

LyonsDo avatar Sep 21 '15 16:09 LyonsDo

I'm currently playing in Montpellier and have just joined the FFB

Donal.

LyonsDo avatar Sep 21 '15 16:09 LyonsDo

You need to be in the folder that contains the README, not the folder that contains redeal.py. If you downloaded a zip of the sources, this means the (inner) folder named redeal-master. From there, run python -mredeal instead of redeal.py. That will fix your first issue.

For the 32 vs. 64-bit part, indeed DDS only releases a 32-bit build on Windows (and I have no way to build a 64-bit DLL for Windows), so you need a 32-bit Python to use this. Note that you can perfectly install a 32-bit Python on 64-bit Windows, everything will work fine.

I will update the docs accordingly.

anntzer avatar Sep 21 '15 21:09 anntzer

Or similarly

C:\Users\DLyons\Downloads\redeal-master\redeal-master>python -m redeal examples/ deal1.py Traceback (most recent call last): File "C:\Users\DLyons\AppData\Local\Programs\Python\Python35-32\lib\runpy.py", line 170, in run_module_as_main "main", mod_spec) File "C:\Users\DLyons\AppData\Local\Programs\Python\Python35-32\lib\runpy.py", line 85, in run_code exec(code, run_globals) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main.py ", line 178, in console_entry() File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main__.py ", line 167, in console_entry main.run() File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main__.py ", line 161, in run self.generate(simulation) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main__.py ", line 131, in generate simulation.do(deal) File "", line 2, in do File "C:\Users\DLyons\AppData\Local\Programs\Python\Python35-32\lib\encodings
cp850.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_map)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\u2660' in position 0: character maps to

LyonsDo avatar Sep 21 '15 22:09 LyonsDo

Many thanks Antony,

That fixes the two issues I was having. I do get a new error, but that's another day's work :-)

C:\Users\DLyons\Downloads\redeal-master\redeal-master>python -m redeal Traceback (most recent call last): File "C:\Users\DLyons\AppData\Local\Programs\Python\Python35-32\lib\runpy.py", line 170, in run_module_as_main "main", mod_spec) File "C:\Users\DLyons\AppData\Local\Programs\Python\Python35-32\lib\runpy.py", line 85, in run_code exec(code, run_globals) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main.py ", line 178, in console_entry() File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main__.py ", line 167, in console_entry main.run() File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main__.py ", line 161, in run self.generate(simulation) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main__.py ", line 131, in generate simulation.do(deal) File "", line 2, in do File "C:\Users\DLyons\AppData\Local\Programs\Python\Python35-32\lib\encodings
cp850.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_map)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-1: cha racter maps to

Best,

Donal.

On 21 September 2015 at 23:59, Antony Lee [email protected] wrote:

You need to be in the folder that contains the README, not the folder that contains redeal.py. If you downloaded a zip of the sources, this means the (inner) folder named redeal-master. From there, run python -mredeal instead of redeal.py. That will fix your first issue.

For the 32 vs. 64-bit part, indeed DDS only releases a 32-bit build on Windows (and I have no way to build a 64-bit DLL for Windows), so you need a 32-bit Python to use this. Note that you can perfectly install a 32-bit Python on 64-bit Windows, everything will work fine.

I will update the docs accordingly.

— Reply to this email directly or view it on GitHub https://github.com/anntzer/redeal/issues/4#issuecomment-142122289.

LyonsDo avatar Sep 21 '15 22:09 LyonsDo

Just as a quick fix I've changed global_defs to

class Suit(_Enum): S = 0, " S", "S" H = 1, " H", "H" D = 2, " D", "D" C = 3, " C", "C"

and the script is now working.

Many thanks,

Donal.

On 22 September 2015 at 00:37, Donal Lyons [email protected] wrote:

Or similarly

C:\Users\DLyons\Downloads\redeal-master\redeal-master>python -m redeal examples/ deal1.py Traceback (most recent call last): File "C:\Users\DLyons\AppData\Local\Programs\Python\Python35-32\lib\runpy.py", line 170, in run_module_as_main "main", mod_spec) File "C:\Users\DLyons\AppData\Local\Programs\Python\Python35-32\lib\runpy.py", line 85, in run_code exec(code, run_globals) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main.py ", line 178, in console_entry() File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main__.py ", line 167, in console_entry main.run() File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main__.py ", line 161, in run self.generate(simulation) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main__.py ", line 131, in generate simulation.do(deal) File "", line 2, in do File "C:\Users\DLyons\AppData\Local\Programs\Python\Python35-32\lib\encodings
cp850.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_map)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\u2660' in position 0: character maps to

LyonsDo avatar Sep 21 '15 23:09 LyonsDo

Yup, but Linux consoles can display suit symbols properly. I was checking for this capability incorrectly, should be fixed now. Also included a better error message on Windows 64-bit. Please give it a try. Suggestions for the README are also welcome.

anntzer avatar Sep 22 '15 01:09 anntzer

Antony,

I think I'm misinterpreting something here, It looks to me like, of the 40 deals, 6 have a 6-card spade suit, 6 have a 5-card spade suit. 5 have a 4-card spade suit, 7 have a 3-card spade suit, 11 have a 2-card spade suit, 3 have a 1-card spade suit and 2 have spade voids.

I was expecting that all 40 would have had a 5-card spade suit out of 120 hands generated i.e. a success rate of 33.3% (which seems high - wouldn't one expect it to be about 11%?

Best,

Donal.

LyonsDo avatar Sep 22 '15 20:09 LyonsDo

How did you generate the hands? By default, python -mredeal just generates 10 random deals (N/E/S/W). To generate 10 1S openers (for North), run python -mredeal examples/onespade.py (actually this just checks that North has 12HCP and at least 5S, nothing more). This is the output I get:

♠KQJ64♡AT2♢84♣AK9 ♠85♡763♢A9♣JT8752 ♠T92♡854♢K6532♣Q4 ♠A73♡KQJ9♢QJT7♣63
♠AKQ74♡86♢842♣AJ5 ♠86532♡K543♢K5♣Q9 ♠T♡QJT9♢J9763♣KT3 ♠J9♡A72♢AQT♣87642
♠QT987♡AKT3♢A♣KQ2 ♠J642♡J5♢T962♣JT4 ♠A5♡Q9876♢J87♣A75 ♠K3♡42♢KQ543♣9863
♠Q8752♡AQJT4♢73♣K ♠AKJ3♡6♢AT52♣QT82 ♠96♡98532♢QJ94♣A7 ♠T4♡K7♢K86♣J96543
♠AJ963♡K85♢A4♣KT2 ♠84♡AJ♢KQ652♣9873 ♠T5♡T97642♢T8♣QJ6 ♠KQ72♡Q3♢J973♣A54
♠KQJT7♡K43♢Q6♣JT8 ♠43♡JT9♢AT984♣AK7 ♠A9♡Q85♢KJ73♣9653 ♠8652♡A762♢52♣Q42
♠QJ743♡K5♢AQ96♣86 ♠AK65♡JT632♢52♣J2 ♠T♡A9874♢J8♣AKT43 ♠982♡Q♢KT743♣Q975
♠AKJ86♡AQ82♢85♣J6 ♠T42♡K3♢AT3♣AQT53 ♠973♡T65♢KQJ2♣K72 ♠Q5♡J974♢9764♣984
♠AQ8632♡K32♢K♣K97 ♠J5♡AT♢AJ8♣AJT532 ♠KT♡J6♢T95432♣864 ♠974♡Q98754♢Q76♣Q
♠KT843♡KT♢AK87♣Q5 ♠97♡Q642♢Q943♣A42 ♠AQ62♡J9873♢♣T986 ♠J5♡A5♢JT652♣KJ73

Each of the North hands has 12+HCP and 5S.

Again, if you have any suggestions on how to clarify the README, please let me know.

anntzer avatar Sep 22 '15 23:09 anntzer

OK - I see how I was misreading it now. It's 10 sets of 4 deals, not 40 N hands!!!

I'll get back to you re possible clarification.

Donal.

On 23 September 2015 at 01:08, Antony Lee [email protected] wrote:

How did you generate the hands? By default, python -mredeal just generates 10 random deals (N/E/S/W). To generate 10 1S openers (for North), run python -mredeal examples/onespade.py (actually this just checks that North has 12HCP and at least 5S, nothing more). This is the output I get:

♠KQJ64♡AT2♢84♣AK9 ♠85♡763♢A9♣JT8752 ♠T92♡854♢K6532♣Q4 ♠A73♡KQJ9♢QJT7♣63 ♠AKQ74♡86♢842♣AJ5 ♠86532♡K543♢K5♣Q9 ♠T♡QJT9♢J9763♣KT3 ♠J9♡A72♢AQT♣87642 ♠QT987♡AKT3♢A♣KQ2 ♠J642♡J5♢T962♣JT4 ♠A5♡Q9876♢J87♣A75 ♠K3♡42♢KQ543♣9863 ♠Q8752♡AQJT4♢73♣K ♠AKJ3♡6♢AT52♣QT82 ♠96♡98532♢QJ94♣A7 ♠T4♡K7♢K86♣J96543 ♠AJ963♡K85♢A4♣KT2 ♠84♡AJ♢KQ652♣9873 ♠T5♡T97642♢T8♣QJ6 ♠KQ72♡Q3♢J973♣A54 ♠KQJT7♡K43♢Q6♣JT8 ♠43♡JT9♢AT984♣AK7 ♠A9♡Q85♢KJ73♣9653 ♠8652♡A762♢52♣Q42 ♠QJ743♡K5♢AQ96♣86 ♠AK65♡JT632♢52♣J2 ♠T♡A9874♢J8♣AKT43 ♠982♡Q♢KT743♣Q975 ♠AKJ86♡AQ82♢85♣J6 ♠T42♡K3♢AT3♣AQT53 ♠973♡T65♢KQJ2♣K72 ♠Q5♡J974♢9764♣984 ♠AQ8632♡K32♢K♣K97 ♠J5♡AT♢AJ8♣AJT532 ♠KT♡J6♢T95432♣864 ♠974♡Q98754♢Q76♣Q ♠KT843♡KT♢AK87♣Q5 ♠97♡Q642♢Q943♣A42 ♠AQ62♡J9873♢♣T986 ♠J5♡A5♢JT652♣KJ73

Each of the North hands has 12+HCP and 5S.

Again, if you have any suggestions on how to clarify the README, please let me know.

— Reply to this email directly or view it on GitHub https://github.com/anntzer/redeal/issues/4#issuecomment-142446926.

LyonsDo avatar Sep 23 '15 00:09 LyonsDo

Try python -mredeal -l examples/onespade.py for a more intuitive output.

anntzer avatar Sep 23 '15 00:09 anntzer

I took the data from your example at https://github.com/anntzer/redeal

The first col is the N hand and seems to contain 4 hands with a six card suit - so might you have generated "at least a 5-card spade suit"?

On 23 September 2015 at 02:51, Antony Lee [email protected] wrote:

Try python -mredeal -l examples/onespade.py for a more intuitive output.

— Reply to this email directly or view it on GitHub https://github.com/anntzer/redeal/issues/4#issuecomment-142464092.

LyonsDo avatar Sep 23 '15 01:09 LyonsDo

The acceptance condition is len(deal.north.spades) >= 5 and deal.north.hcp >= 12, so it's indeed "at least 5 spades".

anntzer avatar Sep 23 '15 02:09 anntzer

Line 75 I think needs to be changed to

"for seat in global_defs.Seat:"

LyonsDo avatar Sep 23 '15 09:09 LyonsDo

And in two other places?

The gui then throws an error Exception in thread Thread-2: Traceback (most recent call last): File "C:\Users\DLyons\AppData\Local\Programs\Python\Python35-32\lib\threading.py", line 923, in _bootstrap_inner self.run() File "C:\Users\DLyons\AppData\Local\Programs\Python\Python35-32\lib\threading.py", line 871, in run self._target(_self._args, *self.kwargs) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal\gui.py", line 151, in target self.main.generate(simulation) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main.py", line 120, in generate dealer = redeal.Deal.prepare(self.predeal) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal\redeal.py", line 265, in prepare raise Exception("Unused predeal entries: {}".format(predeal)) Exception: Unused predeal entries: {<Seat.N: 0>: (Holding(), Holding(), Holding(), Holding()), <Seat.W: 3>: (Holding(), Holding(), Holding(), Holding()), <Seat.S: 2>: (Holding(), Holding(), Holding(), Holding()), <Seat.E: 1>: (Holding(), Holding(), Holding(), Holding())}

On 23 September 2015 at 11:16, Donal Lyons [email protected] wrote:

Line 75 I think needs to be changed to

"for seat in global_defs.Seat:"

LyonsDo avatar Sep 23 '15 09:09 LyonsDo

I don't actually use the GUI so the code tends to fall behind; thanks for noticing the bugs. Should be working now.

anntzer avatar Sep 23 '15 17:09 anntzer

Thanks for that Antony. Not sure how often I'll use the GUI myself, but I was having some problem getting any output from a script I was writing - so I tried the GUI which now works fine. I was looking at "8753 QJT5 AT6 84" opposite a 15-17 NT and first tried that string (including quotes) in the GUI which didn't like it (no reason why it should really).

It worked as expected once I removed the quotes!

Donal.

On 23 September 2015 at 19:15, Antony Lee [email protected] wrote:

I don't actually use the GUI so the code tends to fall behind; thanks for noticing the bugs. Should be working now.

— Reply to this email directly or view it on GitHub https://github.com/anntzer/redeal/issues/4#issuecomment-142668781.

LyonsDo avatar Sep 23 '15 18:09 LyonsDo

Antony,

Finally, a more in-depth question. Your _solve_board is a wrapper for SolveBoard and I get the error below that the latter takes 5 arguments. But my understanding of SolveBoard is that it does actually take 6 arguments, namely struct deal dl, int target, int solutions, int mode, struct futureTricks *futp, int threadIndex

Anyway, the error I'm getting is: "futp = _solve_board(deal, Strain[strain], leader, -1, 1, 1) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal\dds.py", line 101, in _solve_board status = dll.SolveBoard(c_deal, target, sol, mode, byref(futp), 0) TypeError: this function takes 5 arguments (6 given)"

Best,

Donal.

On 23 September 2015 at 20:10, Donal Lyons [email protected] wrote:

Thanks for that Antony. Not sure how often I'll use the GUI myself, but I was having some problem getting any output from a script I was writing - so I tried the GUI which now works fine. I was looking at "8753 QJT5 AT6 84" opposite a 15-17 NT and first tried that string (including quotes) in the GUI which didn't like it (no reason why it should really).

It worked as expected once I removed the quotes!

Donal.

On 23 September 2015 at 19:15, Antony Lee [email protected] wrote:

I don't actually use the GUI so the code tends to fall behind; thanks for noticing the bugs. Should be working now.

— Reply to this email directly or view it on GitHub https://github.com/anntzer/redeal/issues/4#issuecomment-142668781.

LyonsDo avatar Sep 24 '15 09:09 LyonsDo

Maybe this is related to 32-bit dll on 64-bit machine? Googling threw up the following "the double dummy solver is called by. calldll = SolveBoard(dealStr, target, solutions, mode, futureStr) With a 32-bits machine this code is functioning correct, but with a 64-bit machine the code generates next error code."

Donal.

On 24 September 2015 at 11:04, Donal Lyons [email protected] wrote: Antony,

Finally, a more in-depth question. Your _solve_board is a wrapper for SolveBoard and I get the error below that the latter takes 5 arguments. But my understanding of SolveBoard is that it does actually take 6 arguments, namely struct deal dl, int target, int solutions, int mode, struct futureTricks *futp, int threadIndex

Anyway, the error I'm getting is: "futp = _solve_board(deal, Strain[strain], leader, -1, 1, 1) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal\dds.py", line 101, in _solve_board status = dll.SolveBoard(c_deal, target, sol, mode, byref(futp), 0) TypeError: this function takes 5 arguments (6 given)"

LyonsDo avatar Sep 24 '15 17:09 LyonsDo

Antony,

I thought the problems I was having might be due to a mix of 32 and 64 bit, so I rebuilt a 64-bit version and ran it under 64-bit Python 3.5.

Mostly it seems OK on the examples (it's years since I've worked with dlls and I was mildly surprised it wasn't a complete fiasco).

But there are still three examples which throw similar errors bbo_you_have_no_clue.py, bridgewinners_matchpoint_odds.py and opening_lead.py

C:\Users\DLyons\Downloads\redeal-master\redeal-master>python -m redeal examples/ bbo_you_have_no_clue.py Traceback (most recent call last): File "C:\Users\DLyons\AppData\Local\Programs\Python\Python35-64\Lib\runpy.py", line 170, in run_module_as_main "main", mod_spec) File "C:\Users\DLyons\AppData\Local\Programs\Python\Python35-64\Lib\runpy.py", line 85, in run_code exec(code, run_globals) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main.py ", line 179, in console_entry() File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main__.py ", line 168, in console_entry main.run() File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main__.py ", line 162, in run self.generate(simulation) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main__.py ", line 132, in generate simulation.do(deal) File "examples\bbo_you_have_no_clue.py", line 21, in do pass1N = deal.dd_score("1NN", vul=True) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal\redeal.py", line 363, in dd_score self.dd_tricks(contract_declarer)) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal\redeal.py", line 356, in dd_tricks self._dd_cache[strain, declarer] = dds.solve(self, strain, declarer) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal\dds.py", li ne 113, in solve futp = _solve_board(deal, Strain[strain], leader, -1, 1, 1) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal\dds.py", li ne 101, in _solve_board status = dll.SolveBoard(c_deal, target, sol, mode, byref(futp), 0) TypeError: this function takes 5 arguments (6 given)

LyonsDo avatar Sep 25 '15 17:09 LyonsDo

Antony,

The documentation is looking good.

I see you've put in some 64-bit checks into the sources - also good.

I have no idea what the following really means but might it be related to the 5 vs 6 parameter issue? "The DLL using __cdecl calling convention instead of __stdcall, so use CDLL not WinDLL"

I note that WinDLL occasionally appears in the sources.

Best,

Donal.

On 25 September 2015 at 19:42, Donal Lyons [email protected] wrote:

Antony,

I thought the problems I was having might be due to a mix of 32 and 64 bit, so I rebuilt a 64-bit version and ran it under 64-bit Python 3.5.

Mostly it seems OK on the examples (it's years since I've worked with dlls and I was mildly surprised it wasn't a complete fiasco).

But there are still three examples which throw similar errors bbo_you_have_no_clue.py, bridgewinners_matchpoint_odds.py and opening_lead.py

C:\Users\DLyons\Downloads\redeal-master\redeal-master>python -m redeal examples/ bbo_you_have_no_clue.py Traceback (most recent call last): File "C:\Users\DLyons\AppData\Local\Programs\Python\Python35-64\Lib\runpy.py", line 170, in run_module_as_main "main", mod_spec) File "C:\Users\DLyons\AppData\Local\Programs\Python\Python35-64\Lib\runpy.py", line 85, in run_code exec(code, run_globals) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main.py ", line 179, in console_entry() File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main__.py ", line 168, in console_entry main.run() File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main__.py ", line 162, in run self.generate(simulation) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main__.py ", line 132, in generate simulation.do(deal) File "examples\bbo_you_have_no_clue.py", line 21, in do pass1N = deal.dd_score("1NN", vul=True) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal\redeal.py", line 363, in dd_score self.dd_tricks(contract_declarer)) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal\redeal.py", line 356, in dd_tricks self._dd_cache[strain, declarer] = dds.solve(self, strain, declarer) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal\dds.py", li ne 113, in solve futp = _solve_board(deal, Strain[strain], leader, -1, 1, 1) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal\dds.py", li ne 101, in _solve_board status = dll.SolveBoard(c_deal, target, sol, mode, byref(futp), 0) TypeError: this function takes 5 arguments (6 given)

LyonsDo avatar Sep 25 '15 20:09 LyonsDo

https://www.google.ie/search?num=100&lr=&safe=images&as_qdr=all&q= "__cdecl"+"WINDLL"+arguments+calling+convention

On 25 September 2015 at 22:40, Donal Lyons [email protected] wrote:

Antony,

The documentation is looking good.

I see you've put in some 64-bit checks into the sources - also good.

I have no idea what the following really means but might it be related to the 5 vs 6 parameter issue? "The DLL using __cdecl calling convention instead of __stdcall, so use CDLL not WinDLL"

I note that WinDLL occasionally appears in the sources.

Best,

Donal.

On 25 September 2015 at 19:42, Donal Lyons [email protected] wrote:

Antony,

I thought the problems I was having might be due to a mix of 32 and 64 bit, so I rebuilt a 64-bit version and ran it under 64-bit Python 3.5.

Mostly it seems OK on the examples (it's years since I've worked with dlls and I was mildly surprised it wasn't a complete fiasco).

But there are still three examples which throw similar errors bbo_you_have_no_clue.py, bridgewinners_matchpoint_odds.py and opening_lead.py

C:\Users\DLyons\Downloads\redeal-master\redeal-master>python -m redeal examples/ bbo_you_have_no_clue.py Traceback (most recent call last): File "C:\Users\DLyons\AppData\Local\Programs\Python\Python35-64\Lib\runpy.py", line 170, in run_module_as_main "main", mod_spec) File "C:\Users\DLyons\AppData\Local\Programs\Python\Python35-64\Lib\runpy.py", line 85, in run_code exec(code, run_globals) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main.py ", line 179, in console_entry() File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main__.py ", line 168, in console_entry main.run() File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main__.py ", line 162, in run self.generate(simulation) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal__main__.py ", line 132, in generate simulation.do(deal) File "examples\bbo_you_have_no_clue.py", line 21, in do pass1N = deal.dd_score("1NN", vul=True) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal\redeal.py", line 363, in dd_score self.dd_tricks(contract_declarer)) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal\redeal.py", line 356, in dd_tricks self._dd_cache[strain, declarer] = dds.solve(self, strain, declarer) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal\dds.py", li ne 113, in solve futp = _solve_board(deal, Strain[strain], leader, -1, 1, 1) File "C:\Users\DLyons\Downloads\redeal-master\redeal-master\redeal\dds.py", li ne 101, in _solve_board status = dll.SolveBoard(c_deal, target, sol, mode, byref(futp), 0) TypeError: this function takes 5 arguments (6 given)

LyonsDo avatar Sep 25 '15 20:09 LyonsDo

Sorry, I'm a bit busy right now and will get back to the issues later. I notice that you mentioned having built a 64-bit DLL; do you mind sharing it with me? I may include it in the distribution, if eveything works well.

anntzer avatar Sep 25 '15 20:09 anntzer

There's no urgency on any of this.

You should have the 64-bit dll attached to one of the mails. If not let me know and I'll resend.

On 25 September 2015 at 22:45, Antony Lee [email protected] wrote:

Sorry, I'm a bit busy right now and will get back to the issues later. I notice that you mentioned having built a 64-bit DLL; do you mind sharing it with me? I may include it in the distribution, if eveything works well.

— Reply to this email directly or view it on GitHub https://github.com/anntzer/redeal/issues/4#issuecomment-143349064.

LyonsDo avatar Sep 25 '15 20:09 LyonsDo

I did not receive the DLL.

anntzer avatar Sep 25 '15 21:09 anntzer

Should be attached now.

On 25 September 2015 at 23:28, Antony Lee [email protected] wrote:

I did not receive the DLL.

— Reply to this email directly or view it on GitHub https://github.com/anntzer/redeal/issues/4#issuecomment-143358709.

LyonsDo avatar Sep 25 '15 22:09 LyonsDo

Attachments are lost when you email them via github. Can you put it on Dropbox or a similar service, and post a public link?

anntzer avatar Sep 25 '15 23:09 anntzer

Can you get it from https://www.dropbox.com/s/ujeluzyjrts8g6z/DDS.dll?dl=0

On 26 September 2015 at 01:17, Antony Lee [email protected] wrote:

Attachments are lost when you email them via github. Can you put it on Dropbox or a similar service, and post a public link?

— Reply to this email directly or view it on GitHub https://github.com/anntzer/redeal/issues/4#issuecomment-143374082.

LyonsDo avatar Sep 25 '15 23:09 LyonsDo