Checking if a value is in a range with 1 question

As we all know, conditions in Facer don’t like having more than 2 questions in them.
Which makes it hard to check if something is inside of a range because you use up both questions just for that.

But there is a workaround for this:
(abs(x-((y+z)/2)))<(z-((y+z)/2))
or the same thing, but simplified:
(abs((2*x)-(y+z)))<(z-y)

What is what?
x is your tag that you want to check.
y is the start of the range.
z is the end of the range.
Make sure that z>y.

2 Likes

I wonder if you could generate a loose average based on this formula. I’ve been trying to think of ways of smoothing out the RAND function. That thing moves almost on the millisecond.

Thanks for this workaround @Mellin. I’ve been trying to use this equation, but unfortunately it isn’t working. Here is my situation:

I am using the accelerometer to generate an X value where:
X=(160+((accelerometerRawX())*12))

I want to determine if the X value is within a range of Y=145 and Z=175 after an initial 1.5 seconds of having the watch on to check the time. If it checks within the range, and #DWE#>1.5 seconds, then I want to rotate(spin) a PNG image, otherwise it stays still.

So using your equation in the rotation field I get:

$(abs((2*x)-(y+z)))<(z-y)&&(time_check):(rotation value and speed):0?

Subtituting in the values to enter into the rotation field I get:

$(abs((2*(160+((accelerometerRawX())*12)))-(145+175)))=<(175-145)&&(#DWE#)=>1.5?(#DWFSS#*20):0$

Unfortunately, the equation isn’t working… Any thoughts? Much appreciated.

Edit:
I got the equation working now… Had to modify it to:
$(abs((2*(160+((accelerometerRawX())*12)))-(145+175)))<(175-145)&&(#DWE#)>1.5?(#DWFSS#*20):0$

Any way, thanks for creating it @Mellin! Cheers!