SHARE
TWEET

transfer

a guest Jan 19th, 2020 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function transferLiquid(start, target)
  2.   local output2 = 0
  3.   local output10 = 0
  4.   while start ~= target do
  5.     output2 = output2 + math.pow(10,start)
  6.     output10 = output10 + math.pow(2,start)
  7.     start = start + 1
  8.   end
  9.   if (string.sub(""..output2,1,5) == "11111") then
  10.     output10 = output10 -31
  11.   end
  12.   if (string.sub(""..output2,6,10) == "11111")then
  13.     output10 = output10 -992
  14.   end
  15.   return output10
  16. end
  17.  
  18. print(transferLiquid(2, 7))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top