BBO Discussion Forums: Syntax problem - BBO Discussion Forums

Jump to content

Page 1 of 1

Syntax problem

#1 User is offline   rpls 

  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 2013-July-06

Posted 2018-October-12, 06:26

Hi
I know how to write a basic condition for generating hands.
For example:

(( hcp(east)>=6 and hcp(east)<=10) 
and ( (spades(east)>=7 and hcp(east,spades)>=5) 
or(hearts(east)>=7 and hcp(east,hearts)>=5) 
or(diamonds(east)>=7 and hcp(east,diamonds)>=5 ) 
or(clubs(east)>=7 and hcp(east,clubs)>=5 )))


What I dont know how to do is to add to this code a condition for either south or north also having 6 cards of spades. Is that possible?

Regards

Thanks in advance
0

#2 User is offline   pescetom 

  • PipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 1,084
  • Joined: 2014-February-18
  • Gender:Male
  • Location:Italy

Posted 2018-October-12, 06:41

The syntax looks quite simple, so it must be something like this:

(( hcp(east)>=6 and hcp(east)<=10)
and (spades(north)=6 or spades(south)=6)
and ( (spades(east)>=7 and hcp(east,spades)>=5) 
or(hearts(east)>=7 and hcp(east,hearts)>=5) 
or(diamonds(east)>=7 and hcp(east,diamonds)>=5 ) 
or(clubs(east)>=7 and hcp(east,clubs)>=5 )))

0

#3 User is offline   nullve 

  • PipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 1,121
  • Joined: 2014-April-08
  • Gender:Male
  • Location:Norway
  • Interests:partscores

Posted 2018-October-12, 06:55

View Postpescetom, on 2018-October-12, 06:41, said:

The syntax looks quite simple, so it must be something like this:

(( hcp(east)>=6 and hcp(east)<=10)
and (spades(north)=6 or spades(south)=6)
and ( (spades(east)>=7 and hcp(east,spades)>=5) 
or(hearts(east)>=7 and hcp(east,hearts)>=5) 
or(diamonds(east)>=7 and hcp(east,diamonds)>=5 ) 
or(clubs(east)>=7 and hcp(east,clubs)>=5 )))


The "equals" symbol is '==', not '=', so make it
(( hcp(east)>=6 and hcp(east)<=10)
and (spades(north)==6 or spades(south)==6)
and ( (spades(east)>=7 and hcp(east,spades)>=5) 
or(hearts(east)>=7 and hcp(east,hearts)>=5) 
or(diamonds(east)>=7 and hcp(east,diamonds)>=5 ) 
or(clubs(east)>=7 and hcp(east,clubs)>=5 )))
.
0

#4 User is offline   rpls 

  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 2013-July-06

Posted 2018-October-12, 07:17

View Postnullve, on 2018-October-12, 06:55, said:

The "equals" symbol is '==', not '=', so make it
(( hcp(east)>=6 and hcp(east)<=10)
and (spades(north)==6 or spades(south)==6)
and ( (spades(east)>=7 and hcp(east,spades)>=5) 
or(hearts(east)>=7 and hcp(east,hearts)>=5) 
or(diamonds(east)>=7 and hcp(east,diamonds)>=5 ) 
or(clubs(east)>=7 and hcp(east,clubs)>=5 )))
.

I just tried the last code and it worked perfectly

I wanna thank both of you for your help

Regards
0

Share this topic:


Page 1 of 1


Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users