BBO Discussion Forums: Using the "if" statement - BBO Discussion Forums

Jump to content

Page 1 of 1

Using the "if" statement

#1 User is offline   rpls 

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

Posted 2019-November-07, 15:48

Hi,
i read the manual about this and cant have it working

here's my code:

//teste para Gladiator - 7 nov 2019

sS = spades (south)
sH = hearts (south)
sD = diamonds (south)
sC = clubs (south)
sSe = spades(east)
sHe = hearts (east)
sSn = spades(north)
sHn = hearts (north)
sDn = diamonds (north)
sCn = clubs (north)

zona = 15 < hcp (south) and hcp (south) < 19
distribuicaoST = shape (south, any 4333 + any 4432 + any 5332)

ricoQuinto = sS == 5 or sH == 5
menorQuarto = sD == 4 or sC == 4

restricaoRicoMenor = not (ricoQuinto and menorQuarto)
restricaoRicos = not ((sH > 4 and sS > 3) or (sH > 3 and sS > 4))
restricoes = restricaoRicoMenor and restricaoRicos
distribuicao = distribuicaoST and restricoes
interventor = zona and distribuicao

zonaAbridor = 5 < hcp (east) and hcp (east) < 11
distribuicaoAbridor = sSe ==6 or sHe == 6
abridor = zonaAbridor and distribuicaoAbridor

if (sSe == 6)
	distribuicaoAdvancer = (sHn >= 5 and sCn >= 5);
else
	distribuicaoAdvancer = (sSn >= 5 and sCn >= 5);

zonaAdvancer = hcp (north) > 8
advancer = distribuicaoAdvancer and zonaAdvancer
advancer = zonaAdvancer

condition abridor and interventor and advancer



what i want is to know how to use a simple if/else statement
can anyone please help me?

Thanks in advance

NB my code works perfectly if i exclude the "if"
0

#2 User is offline   rpls 

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

Posted 2019-November-08, 02:52

problem solved
distribuicaoRespondente = (sS >= 5) ? (sSn >= 4) : (sHn >= 4)


This post has been edited by rpls: 2019-November-08, 02:53

0

Share this topic:


Page 1 of 1


Fast Reply

  

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