If the starting value (middle variable) is odd, multiply it by three and add one; if it is even, divide by two. The script keeps doing this until the number eventually reaches one or two (because at that point the value will repeat forever), it then generates a new starting value and repeats the whole process again. Also, if the middle variable stops changing, the equation was solved or the script broke (most likely).
num.opps list: # of operations to reduce the # to zero allS list: starting value Top Variable: current number being worked on Middle Variable: current starting value Bottom Variable: current record for # of operations