Catsss

Turtle Dig

Oct 31st, 2021 (edited)
535
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. function split(inputstr, sep)
  2.         if sep == nil then
  3.                 sep = "%s"
  4.         end
  5.         local t={}
  6.         for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
  7.                 table.insert(t, str)
  8.         end
  9.         return t
  10. end
  11.  
  12. print("Please input X, Y, and Z:")
  13. local tempString = split(read(),' ')
  14. x,y,z = tonumber(tempString[1]),tonumber(tempString[2]),tonumber(tempString[3])
  15. print("X: ".. x)
  16. print("Y: ".. y)
  17. print("Z: ".. z)
  18.  
  19. print("Total number of energy for this dig: ".. x*y*z .." You would need ".. (x*y*z)/80 .." coal for this dig. Please insert at least one coal in the fourth slot to begin.")
Add Comment
Please, Sign In to add comment