Advertisement
asweigart

buildroom

Jan 9th, 2017
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. --[[Room Building program by Al Sweigart
  2. Builds a room of four walls.]]
  3.  
  4. os.loadAPI('hare')
  5.  
  6. -- handle command line arguments
  7. local cliArgs = {...}
  8. local length = tonumber(cliArgs[1])
  9. local width = tonumber(cliArgs[2])
  10. local height = tonumber(cliArgs[3])
  11.  
  12. if length == nil or width == nil or height == nil or cliArgs[1] == '?' then
  13. print('Usage: buildroom <length> <width> <height>')
  14. return
  15. end
  16.  
  17. print('Building...')
  18. if hare.buildRoom(length, width, height) == false then
  19. error('Not enough blocks.')
  20. end
  21. print('Done.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement