if-else blocks with "between x and y" ranges

coparu67

Senior Member
Hi
Often I use multiple ranges with analogic sensors (temperature, proximity, etc).
In Blockly, I miss statements like select.
I know I can construct them with if-else blocks, but,
would it be possible at least to enlarge the if-else blocks with "double conditions" similar to varA BETWEEN x and y ?
It would be nice.
 

Technical

Technical Support
Staff member
You've missed the point - yes technically all comparisons can always be made with single if's. However it is often much easier for young students to visualise/understand 'between two values' - even if the test is indeed being 'repeated'.
 

BESQUEUT

Senior Member
You've missed the point - yes technically all comparisons can always be made with single if's. However it is often much easier for young students to visualise/understand 'between two values' - even if the test is indeed being 'repeated'.
I do not dispute the interest of the and/off option in the if block !
It is certainly a good improvement.

I was only pointing the example witch IMHO is not as well designed as it can be...
To my mind, it is not a good idea to encourage students to write redundant code.
 
Top