How to write condition OR with "darker condition block"
-
My condition is: example - there are 6 variables D1 D2 D3 -- D11 D22 D33
"D1 > D11 or D1 = 7" and "D2 > D22 or D2=7" and "D3 > D33 or D3=7"
How to write these condition correctly in "darker condition block" ?
-
@migen This should work
(D1 > D11 || D1 == 7) && (D2 > D22 || D2==7) && (D3 > D33 || D3==7)

-
@roar Thanks!
I have another question : If I want to count how many conditions are valid (I'm using variable to count), how to write conditions separately in "darker condition block" ?
With example above:
"D1 > D11 or D1 = 7" ; "D2 > D22 or D2=7" ; "D3 > D33 or D3=7"
I just need to remove && symbol, is it right ?
(D1 > D11 || D1 == 7) (D2 > D22 || D2==7) (D3 > D33 || D3==7) -
@migen I'm not sure, but generally a logical TRUE is equal to numeric 1. So you could try just replacing && with + sign:
variable = (D1 > D11 || D1 == 7) + (D2 > D22 || D2==7) + (D3 > D33 || D3==7)