redeal icon indicating copy to clipboard operation
redeal copied to clipboard

Extending redeal

Open ThorvaldAagaard opened this issue 1 year ago • 6 comments

I am adding a lot of new criterias used for selecting a deal.

It is not clear for me, which should be part of redeal, and which I should keep in my own code, and the line between properties (hcp, qp etc) and functions (balanced, losers, etc) doesn't seem clear.

I am sure you can improve my implementation, but let me know if you are interested in adding some of it to redeal

ThorvaldAagaard avatar Jan 23 '25 16:01 ThorvaldAagaard

I am not really actively developing redeal anymore (I guess I'll try to maintain it in a working state but no more than that); the feature set is essentially based on what was present in the original tcl deal. I would suggest that you just fork the project if you want to add many features to it.

anntzer avatar Jan 23 '25 17:01 anntzer

I have forked it, so you can later take a look and see if there is anything you want to add.

But I had some trouble of defining Shape for 10-card suits, and it would be nice to some way of specifying a singlesuited hand.

ThorvaldAagaard avatar Jan 23 '25 19:01 ThorvaldAagaard

What do you exactly want to specify?

anntzer avatar Jan 23 '25 21:01 anntzer

I want to specify a onesuited hand along with other handtypes

Image

This is working fine, but will never find a hand with a 10-card suit

I was thinking about using l1

ThorvaldAagaard avatar Jan 23 '25 22:01 ThorvaldAagaard

Smartstacking (https://github.com/anntzer/redeal?tab=readme-ov-file#smartstacking) may help for very rare hand types.

anntzer avatar Jan 23 '25 22:01 anntzer

Yes, but I am creating logic for bidding, and then the logic is input for the handgenerator to generate samples, so I am not aiming at rare handtypes, I just need to be sure, they are possible.

But we seem to have a general problem with shape, not just redeal but in general, perhaps we should use Hex.

ThorvaldAagaard avatar Jan 23 '25 23:01 ThorvaldAagaard

I don't actually understand the following statement

But we seem to have a general problem with shape, not just redeal but in general, perhaps we should use Hex.

anntzer avatar Mar 16 '25 11:03 anntzer

How do you write a shape, where you have more than 9 cards in a suit?

ThorvaldAagaard avatar Mar 16 '25 11:03 ThorvaldAagaard

"T" is 10, "J" is 11, "Q" is 12, "K" is 13. Pushed a fix to clarify this in the docs.

anntzer avatar Mar 16 '25 11:03 anntzer

So I can write Shape("(Txxx)") to find any 10-card suit :-)

ThorvaldAagaard avatar Mar 16 '25 11:03 ThorvaldAagaard

Yes.

anntzer avatar Mar 16 '25 11:03 anntzer

I'll assume the relevant questions have been dealt with, so I'll close the issue, but feel free to ping again if you have more questions.

anntzer avatar Mar 20 '25 13:03 anntzer

@ThorvaldAagaard For your example you can use Shape.from_cond. Sth like:

def very_long_one_suited(s, h, d, c):
    shape = [s, h, d, c]
    shape.sort()
    if shape[3] < 7:
        return False
    else:
        return shape[3] - shape[2] > 4

Shape.from_cond(very_long_one_suited)

phiSgr avatar Apr 08 '25 10:04 phiSgr