Package 'cowsay'

Title: Messages, Warnings, Strings with Ascii Animals
Description: Allows printing of character strings as messages/warnings/etc. with ASCII animals, including cats, cows, frogs, chickens, ghosts, and more.
Authors: Scott Chamberlain [aut, cre], Amanda Dobbyn [aut], Tyler Rinker [ctb], Thomas Leeper [ctb], Noam Ross [ctb], Rich FitzJohn [ctb], Carson Sievert [ctb], Kiyoko Gotanda [ctb], Andy Teucher [ctb], Karl Broman [ctb], Franz-Sebastian Krah [ctb], Lucy D'Agostino McGowan [ctb], Guangchuang Yu [ctb], Philipp Boersch-Supan [ctb], Andreas Brandmaier [ctb], Marion Louveaux [ctb], David Schoch [ctb]
Maintainer: Scott Chamberlain <[email protected]>
License: MIT + file LICENSE
Version: 0.9.0
Built: 2024-10-31 18:31:21 UTC
Source: https://github.com/sckott/cowsay

Help Index


Animals

Description

Named vector of animals

Usage

animals

Format

An object of class character of length 49.

Details

animals is a named character vector of animals, with each element a character string of variable length specifying an ASCII animal. Note that some have unicode characters that won't play well on some operating systems.

Examples

animals['cow']
animals['clippy']
animals[['clippy']]

Endless horse

Description

Each time you press enter, the horse keeps going...and going...

Usage

endless_horse(
  what = "Hello world!",
  endless = TRUE,
  wait = 0.5,
  what_color = NULL,
  horse_color = NULL
)

Arguments

what

(character) What do you want to say? See details.

endless

(logical) Should horse be enless, you better say yes. Default: TRUE

wait

How long to wait between leg segments (time grows geometrically after the first iteration in order to keep the horse on screen for a while, but it will keep going forever. Or until you hit escape/Ctrl-C depending on your platform).

what_color

(character or crayon function) A crayon-suported text color or crayon style function to color what. You might try colors() or ?rgb for ideas.

horse_color

(character or crayon function) A crayon-suported text color or crayon style function to color your steed.

Examples

## Not run: 
endless_horse()
endless_horse(endless = FALSE)

## End(Not run)

Sling messages and warnings with flair

Description

Sling messages and warnings with flair

Usage

say(
  what = "Hello world!",
  by = "cat",
  type = NULL,
  what_color = NULL,
  by_color = NULL,
  length = 18,
  fortune = NULL,
  ...
)

Arguments

what

(character) What do you want to say? See Details.

by

(character) Type of thing, one of cow, chicken, chuck, clippy, poop, bigcat, ant, pumpkin, ghost, spider, rabbit, pig, snowman, frog, hypnotoad, shortcat, longcat, fish, signbunny, facecat, behindcat, stretchycat, anxiouscat, longtailcat, cat, trilobite, shark, buffalo, grumpycat, smallcat, yoda, mushroom, endlesshorse, bat, bat2, turkey, monkey, daemon, egret, duckling, duck, owl, squirrel, squirrel2, goldfish, alligator, stegosaurus, whale, wolf, or rms for Richard Stallman. Alternatively, use "random" to have your message spoken by a random character. We use match.arg() internally, so you can use unique parts of words that don't conflict with others, like "g" for "ghost" because there's no other animal that starts with "g".

type

(character) One of message (default), warning, print (default in non-interactive mode), or string (returns string). If run in non-interactive mode default type is print, so that output goes to stdout rather than stderr, where messages and warnings go.

what_color

(character or crayon function) One or more crayon-suported text color(s) or crayon style function to color what. You might try colors() or ?rgb for ideas. Use "rainbow" for c("red", "orange", "yellow", "green", "blue", "purple").

by_color

(character or crayon function) One or more crayon-suported text color(s) or crayon style function to color who. Use "rainbow" for c("red", "orange", "yellow", "green", "blue", "purple")

length

(integer) Length of longcat. Ignored if other animals used.

fortune

An integer specifying the row number of fortunes.data. Alternatively which can be a character and grep is used to try to find a suitable row.

...

Further args passed on to fortunes::fortune()

what

You can put in any phrase you like to the what parameter, OR you can type in one of a few special phrases that do particular things. They are:

  • "catfact": A random cat fact from https://catfact.ninja

  • "fortune": A random quote from an R coder, from fortunes library

  • "time": Print the current time

  • "rms": Prints a random 'fact' about Richard Stallman from the rmsfact::rmsfact() package. Best paired with by = "rms".

by

Note that if you choose by='hypnotoad' the quote is forced to be, as you could imagine, 'All Glory to the HYPNO TOAD!'. For reference see http://knowyourmeme.com/memes/hypnotoad

signbunny: It's not for sure known who invented signbunny, but this article http://www.vox.com/2014/9/18/6331753/sign-bunny-meme-explained thinks they found the first use in this tweet: https://twitter.com/wei_bluebear/status/329101645780770817

trilobite: from http://www.retrojunkie.com/asciiart/animals/dinos.htm (site down though)

Note to Windows users: there are some animals (shortcat, longcat, fish, signbunny, stretchycat, anxiouscat, longtailcat, grumpycat, mushroom) that are not available because they use non-ASCII characters that don't display properly in R on Windows.

Examples

say()
say("what")
say('time')

say("who you callin chicken", "chicken")
say("ain't that some shit", "poop")
say("icanhazpdf?", "cat")
say("boo!", "pumpkin")
say("hot diggity", "frog")
say("fortune", "spider")
say("fortune", "facecat")
say("fortune", "behindcat")
say("fortune", "smallcat")
say("fortune", "monkey")
say("fortune", "egret")
say("rms", "rms")

# Vary type of output, default calls message()
say("hell no!")
say("hell no!", type="warning")
say("hell no!", type="string")

# Using fortunes
say(what="fortune")
## you don't have to pass anything to the `what` parameter if `fortune` is
## not null
say(fortune=10)
say(fortune=100)
say(fortune='whatever')
say(fortune=7)
say(fortune=45)

# Using catfacts
# say("catfact", "cat")

# The hypnotoad
say(by="hypnotoad")

# Trilobite
say(by='trilobite')

# Shark
say('Q: What do you call a solitary shark\nA: A lone shark', by='shark')

# Buffalo
say('Q: What do you call a single buffalo?\nA: A buffalonely', by='buffalo')

# Clippy
say(fortune=59, by="clippy")