Cowsay.jl

A Julia package that lets you use cowsay in your Julia programs!

Usage

Cowsay.cowsayFunction
cowsay([io,] message::AbstractString; kwargs...)
cowthink([io,] message::AbstractString; kwargs...)

Print an ASCII picture of a cow saying/thinking message

Arguments

  • message::AbstractString: Tell the cow what to say

Keywords

  • cow=default: Specify a particular function handle to print the ASCII art. See below for more details on what constitutes a valid function handle.
  • eyes::AbstractString="oo": A two-character string to be drawn in for the eyes. Not all cowfiles support this, though.
  • tongue::AbstractString=" ": A two-character string to be drawn in for the tongue. Not all cowfiles support this.
  • wrap::Int=40: The number of characters at which to wrap message to a new line
  • nowrap::Bool=false: Don't perform text wrapping on message

Cow appearance Keywords

  • borg::Bool=false: Initiates Borg mode
  • dead::Bool=false: Causes the cow to appear dead
  • greedy::Bool=false: Invokes greedy mode
  • paranoid::Bool=false: Causes a state of paranoia to come over the cow
  • stoned::Bool=false: Makes the cow appear thoroughly stoned
  • tired::Bool=false: Yields a tired cow
  • wired::Bool=false: Somewhat the opposite of tired, and initiates wired mode
  • young::Bool=false: Brings on the cow's youthful appearance

Example

julia> cowsay("Have you mooed today?")
 _______________________
< Have you mooed today? >
 -----------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

julia> cowthink("Have I mooed today?")
 _____________________
( Have I mooed today? )
 ---------------------
        o   ^__^
         o  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
Cowsay.cowsaidFunction
cowsaid(message::AbstractString; kwargs...)
cowthunk(message::AbstractString; kwargs...)

Constructs cow art and returns it as a string instead of printing it. See cowsay for implementation details.

Example

julia> cowsaid("Have you mooed today?")
" _______________________\n< Have you mooed today? >\n -----------------------\n        \\   ^__^\n         \\  (oo)\\_______\n            (__)\\       )\\/\\\n                ||----w |\n                ||     ||\n"
julia> cowthunk("Have I mooed today?")
" _____________________\n( Have I mooed today? )\n ---------------------\n        o   ^__^\n         o  (oo)\\_______\n            (__)\\       )\\/\\\n                ||----w |\n                ||     ||\n"