Advertisement
Guest User

Transfer

a guest
Jan 19th, 2020
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. function transferLiquid(start, target)
  2.   local output2 = 0
  3.   local output10 = 0
  4.   while (not start == target) do
  5.     output2 = output2 + 10^start
  6.     output10 = output10 + 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(read(), read()))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement