Advertisement
justync7

cowsay

Jul 10th, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. -- cowsay.lua (from https://gist.github.com/Gaichu/1c5b63c0093512b72779, made by Gaichu)
  2. -- (Converted to computercraft by justync7)
  3. arg = { ... }
  4.  
  5. if #arg < 1 then
  6.     print("Incorrect usage. "..shell.getRunningProgram().." <message> ")
  7. end
  8.  
  9. local cow = {
  10.   [[
  11.      \   ^__^
  12.       \  (oo)\_______
  13.          (__)\       )\/\\
  14.              ||----w |
  15.              ||     ||
  16.   ]]
  17. }
  18.  
  19.  
  20. local maxLen = 2^10
  21. for i=1,#arg do
  22.   if i == 1 then
  23.     if string.len(arg[1]) <= maxLen then
  24.       print(" "..string.rep("_",#arg[1]+2).." ")
  25.       print("< "..arg[1].." >")
  26.       print(" "..string.rep("-",#arg[1]+2).." "..cow[1])
  27.     end
  28.   end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement