daily pastebin goal
71%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local args = {...}
  2. W = args[1]
  3. L = args[2]
  4. H = args[3]
  5. function getChar()
  6.   local event, ch = os.pullEvent("char")
  7.   term.write(ch)
  8.   print("*****")
  9.   return ch
  10. end
  11.  
  12. function getLine()
  13.   term.write("[")
  14.     for i = 1, W do
  15. --    print(line[i])
  16.       print(i)
  17.      line[i] = getChar()
  18.     end
  19.   print("]")
  20.   return line
  21. end
  22.  
  23. function getLayer()
  24.   local layer = ""
  25.   for i = 1, W+2 do
  26.     term.write("_")
  27.   end
  28.   print("")
  29.   for i = 1, L do
  30.     layer[i] = getLine()
  31.   end
  32.   for i = 1, W+2 do
  33.     term.write("-")
  34.   end
  35.   print("")
  36.   return layer
  37. end
  38.  
  39. function getPlan()
  40.   local plan = ""
  41.   term.clear()
  42.   term.setCursorPos(1,1)
  43.   print("   --Please type up building plan.--")
  44.   for i = 1, H do
  45.     plan[i] = getLayer()
  46.   end
  47.   print("")
  48.   print("          ----Plan done----")
  49.   return plan
  50. end
  51.  
  52. getPlan()
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