More Check Once Statements

Hey y’all! I’d like to see some more check once statements. For example, I’d like to see “Check once if ( ) is a multiple of ( )”. I think that this would be pretty cool. Do you guys?

@Ana @Rodrigo @AwesomeOnion

12 Likes

don’t understand

2 Likes

It would basically check if the variable is a multiple of something. So you could do
Check once if (Test) is a multiple of (2)

1 Like

I’m not really big on this because that could be done with

check once if “test” % (modulo/remainder) 2 = 0

2 Likes

This probably is possible somehow with the math operators.

3 Likes

That’s possible to do already.

Just do this, but with whatever’s numbers you want instead of x and y.

When [(x) % (y)] = 0 {
       // whatever you want 
 }

The % is the modulus operator, which checks for and returns the remainder after dividing. If the reminder (mod) is 0, that means there’s no remainder and that x is a multiple of y.

3 Likes

could also do this:

if round(x/3) = (x/3):
      //do something
4 Likes

Woah, that’s cool. I never knew that.

1 Like

That is a cool idea!

There could also be
check once if () is touching ()

2 Likes

Yup! That’d also be awesome!

2 Likes