Sort of maths problem

inevit4ble

Well-Known Member
Reaction score
38
I need to know how i can put in a condition that a variable is equal to a multiply of 4. So basically at 4, 8, 12, 16, etc the loop wil run.
 

Squishy

You can change this now in User CP.
Reaction score
127
You could run a loop and check if your variable is divisible by 4 that way.
 

Squishy

You can change this now in User CP.
Reaction score
127
Code:
For each (Integer A) from 1 to Whatever you want, do (Actions)
    Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Your_Variable Equal to ((Integer A) x 4)
            Then - Actions
                Your Actions
            Else - Actions
 

greatsmite

New Member
Reaction score
3
you coudl use another variable, and in a loop set it to four higher every time the loop runs. Then it woudl be "If <variable> equals <variable2>" do Actions. Then set variable2= variable2 +4, although i suppose if they dont have to get each multiple of four then it wont help you.
 
Reaction score
86
Math- Modulo. Dividend is the number you start with, divisor is the number you divide by and the returning number is the remainder. Meaning if this function returns 0 then it is dividable by the divisor because only 0 remains.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top