Advertisement
asweigart

buildwall

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