# BBO Discussion Forums: Another syntax problem - BBO Discussion Forums

Page 1 of 1

## Another syntax problem

### #1rpls

• Group: Members
• Posts: 7
• Joined: 2013-July-06

Posted 2019-October-09, 09:22

Hi
basically i want to generate hands that would open in one of a major; this implies opener cant have a longer minor suit

i have the code for opening 1 M:
```(
and
hcp(south)>=10
and
hcp(south)<=15
)
||
(
hearts(south)>=5
and
hcp(south)>=10
and
hcp(south)<=15
)```

but i dont know how to code the restriction i mentioned above

0

### #2pescetom

• Posts: 2,125
• Joined: 2014-February-18
• Gender:Male
• Location:Italy

Posted 2019-October-09, 10:19

I imagine it would become:

```(
and
hcp(south)>=10
and
hcp(south)<=15
and
and
)
||
(
hearts(south)>=5
and
hcp(south)>=10
and
hcp(south)<=15
and
and
)```

As an aside, do you really want to open any 5cM as 1M with 10 HCP and with 15 HCP? I would pass the first and open 1NT many of the second.
0

### #3rpls

• Group: Members
• Posts: 7
• Joined: 2013-July-06

Posted 2019-October-09, 10:47

pescetom, on 2019-October-09, 10:19, said:

I imagine it would become:

```(
and
hcp(south)>=10
and
hcp(south)<=15
and
and
)
||
(
hearts(south)>=5
and
hcp(south)>=10
and
hcp(south)<=15
and
and
)```

As an aside, do you really want to open any 5cM as 1M with 10 HCP and with 15 HCP? I would pass the first and open 1NT many of the second.

Hi

What i'm doing here is testing this precision style openings

As an aside, how can i code something like: i dont want a 4333 or 4432 or 5332 shape?
I'm trying
```hcp(south)>=16
and
condition shape(south, ! (any 4333 + any 4423+ any 5332))```

but it wont work

Regards
0

### #4rpls

• Group: Members
• Posts: 7
• Joined: 2013-July-06

Posted 2019-October-09, 11:02

in the meanwhile i got it:
```condition shape(south, any xxxx - any 4333 - 4432 - 5332)
and
hcp(south)>=16```

0

### #5nige1

• 5-level belongs to me
• Posts: 7,881
• Joined: 2004-August-30
• Gender:Male
• Location:Glasgow Scotland
• Interests:Poems Computers

Posted 2019-October-09, 12:07

```# Unbalanced Precision one of a major openers - rpls 09 Oct 2019
sUnBal = not shape (south, any 4333 + any 4432 + any 5332)
sInRange = 9 < hcp (south) and hcp (south) < 16
sH = hearts (south)
s1S = sS > 4 and sS >= sH and sS >= diamonds (south) and sS >= clubs (south)
s1H = sH > 4 and sH > sS and sH >= diamonds (south) and sH >= clubs (south)
condition sUnBal and sInRange and (s1H or s1S)
action printoneline
produce 5
```

0

### #6rpls

• Group: Members
• Posts: 7
• Joined: 2013-July-06

Posted 2019-October-09, 12:56

nige1, on 2019-October-09, 12:07, said:

```# Unbalanced Precision one of a major openers - rpls 09 Oct 2019
sUnBal = not shape (south, any 4333 + any 4432 + any 5332)
sInRange = 9 < hcp (south) and hcp (south) < 16
sH = hearts (south)
s1S = sS > 4 and sS >= sH and sS >= diamonds (south) and sS >= clubs (south)
s1H = sH > 4 and sH > sS and sH >= diamonds (south) and sH >= clubs (south)
condition sUnBal and sInRange and (s1H or s1S)
action printoneline
produce 5
```

Great!

The code is very elegant: are you a pro?

I dont understand the last 2 lines, mostly the last one
0

### #7nige1

• 5-level belongs to me
• Posts: 7,881
• Joined: 2004-August-30
• Gender:Male
• Location:Glasgow Scotland
• Interests:Poems Computers

Posted 2019-October-09, 13:28

rpls, on 2019-October-09, 12:56, said:

Great! The code is very elegant: are you a pro? I dont understand the last 2 lines, mostly the last one

I started out as a programmer and always enjoy it.

• printoneline prints the 4 hands of a deal, compactly, on one line
• produce 5 means print the first 5 deals that satisfy the condition, from those randomly generated (the default is 40 hands printed).

0

### #8rpls

• Group: Members
• Posts: 7
• Joined: 2013-July-06

Posted 2019-October-09, 13:59

nige1, on 2019-October-09, 13:28, said:

I started out as a programmer and always enjoy it.

• printoneline prints the 4 hands of a deal, compactly, on one line
• produce 5 means print the first 5 deals that satisfy the condition, from those randomly generated (the default is 40 hands printed).

I must confess i started reading the manual but that looks like "mandarin" for me

my goal is to be able to generate hands for training purposes

Thanks, nige1
0