Thanks sfi, that's a great way of doing it. It makes it all a lot simpler to use that rather than duplicating a lot of the constraints rotated around in code. That's interesting. Is there an advantage to defining it that way? It just looks different from the way I have been doing it. There's not a huge amount of resources I've seen to learn from so am struggling a little. What I had so far is this. Then I was going to duplicate those south rules for north. Your trick above will make that easier. I can combine that with making only certain positions deal.
(
(
hcp(east) >= 15 and hcp(east) <= 17 and
shape(east, any 4333 + any 4432 + any 5332)
)
or
(
hcp(west) >= 15 and hcp(west) <= 17 and
shape(west, any 4333 + any 4432 + any 5332)
)
)
and
(
// *** South Hand rules ***
// Lots of points - to double for penalties
hcp(south) > 16 or
(
hcp(south) > 9 and
(
// Single suited
shape(south, any 6xxx + any 7xxx + any 8xxx + any 9xxx) or
// Both majors
shape(south, 45xx + 55xx + 54xx) or
// Hearts and a minor
shape(south, x55x + x5x5 + x45x + x4x5 + x54x + x5x4) or
// Spades and a minor
shape(south, 5x5x + 5xx5 + 4x5x + 4xx5 + 5x4x + 5xx4) or
// Both minors
shape(south, xx55 + xx54 + xx45)
)
)
)