Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function transferLiquid(start, target)
- local output2 = 0
- local output10 = 0
- while start ~= target do
- output2 = output2 + math.pow(10,start)
- output10 = output10 + math.pow(2,start)
- start = start + 1
- end
- if (string.sub(""..output2,1,5) == "11111") then
- output10 = output10 -31
- end
- if (string.sub(""..output2,6,10) == "11111")then
- output10 = output10 -992
- end
- return output10
- end
- print(transferLiquid(2, 7))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement