You are viewing a single comment's thread. Return to all comments →
"The fastest way to loop is to not loop at all."
This function gets the number starting the next cycle, and subtracts 't' from it to get the result.
Ex: t=9 -> 10-9=1
Ex: t=7 -> 10-7=3
Ex: t=10 -> 22-10=12
Python 3
def strangeCounter(t): temp = math.ceil(math.log2((t+3)/6)) return int(6*(2**temp) - 2 - t)
Seems like cookies are disabled on this browser, please enable them to open this website
Strange Counter
You are viewing a single comment's thread. Return to all comments →
"The fastest way to loop is to not loop at all."
This function gets the number starting the next cycle, and subtracts 't' from it to get the result.
Ex: t=9 -> 10-9=1
Ex: t=7 -> 10-7=3
Ex: t=10 -> 22-10=12
Python 3