From 1ea4c1be38df8e3b5bee994012c9f3184bae6c6c Mon Sep 17 00:00:00 2001 From: tony Date: Sat, 14 Aug 1999 07:17:54 +0000 Subject: [PATCH] Initial revision --- cows/beavis.zen.cow | 23 +++++ cows/bong.cow | 16 ++++ cows/bud-frogs.cow | 12 +++ cows/bunny.cow | 10 +++ cows/cheese.cow | 23 +++++ cows/cower.cow | 14 ++++ cows/default.cow | 7 ++ cows/devil.cow | 24 ++++++ cows/dragon-and-cow.cow | 21 +++++ cows/dragon.cow | 21 +++++ cows/elephant-in-snake.cow | 14 ++++ cows/elephant.cow | 15 ++++ cows/eyes.cow | 16 ++++ cows/flaming-sheep.cow | 15 ++++ cows/ghostbusters.cow | 26 ++++++ cows/head-in.cow | 12 +++ cows/hellokitty.cow | 11 +++ cows/kiss.cow | 26 ++++++ cows/kitty.cow | 12 +++ cows/koala.cow | 12 +++ cows/kosh.cow | 19 +++++ cows/luke-koala.cow | 15 ++++ cows/mech-and-cow | 21 +++++ cows/meow.cow | 15 ++++ cows/milk.cow | 21 +++++ cows/moofasa.cow | 14 ++++ cows/moose.cow | 9 ++ cows/mutilated.cow | 10 +++ cows/ren.cow | 22 +++++ cows/satanic.cow | 12 +++ cows/sheep.cow | 13 +++ cows/skeleton.cow | 15 ++++ cows/small.cow | 10 +++ cows/sodomized.cow | 12 +++ cows/stegosaurus.cow | 19 +++++ cows/stimpy.cow | 19 +++++ cows/supermilker.cow | 10 +++ cows/surgery.cow | 24 ++++++ cows/telebears.cow | 12 +++ cows/three-eyes.cow | 12 +++ cows/turkey.cow | 26 ++++++ cows/turtle.cow | 20 +++++ cows/udder.cow | 16 ++++ cows/vader-koala.cow | 16 ++++ cows/vader.cow | 13 +++ cows/www.cow | 10 +++ cowsay | 166 +++++++++++++++++++++++++++++++++++++ cowsay.1 | 132 +++++++++++++++++++++++++++++ 48 files changed, 1033 insertions(+) create mode 100644 cows/beavis.zen.cow create mode 100644 cows/bong.cow create mode 100644 cows/bud-frogs.cow create mode 100644 cows/bunny.cow create mode 100644 cows/cheese.cow create mode 100644 cows/cower.cow create mode 100644 cows/default.cow create mode 100644 cows/devil.cow create mode 100644 cows/dragon-and-cow.cow create mode 100644 cows/dragon.cow create mode 100644 cows/elephant-in-snake.cow create mode 100644 cows/elephant.cow create mode 100644 cows/eyes.cow create mode 100644 cows/flaming-sheep.cow create mode 100644 cows/ghostbusters.cow create mode 100644 cows/head-in.cow create mode 100644 cows/hellokitty.cow create mode 100644 cows/kiss.cow create mode 100644 cows/kitty.cow create mode 100644 cows/koala.cow create mode 100644 cows/kosh.cow create mode 100644 cows/luke-koala.cow create mode 100644 cows/mech-and-cow create mode 100644 cows/meow.cow create mode 100644 cows/milk.cow create mode 100644 cows/moofasa.cow create mode 100644 cows/moose.cow create mode 100644 cows/mutilated.cow create mode 100644 cows/ren.cow create mode 100644 cows/satanic.cow create mode 100644 cows/sheep.cow create mode 100644 cows/skeleton.cow create mode 100644 cows/small.cow create mode 100644 cows/sodomized.cow create mode 100644 cows/stegosaurus.cow create mode 100644 cows/stimpy.cow create mode 100644 cows/supermilker.cow create mode 100644 cows/surgery.cow create mode 100644 cows/telebears.cow create mode 100644 cows/three-eyes.cow create mode 100644 cows/turkey.cow create mode 100644 cows/turtle.cow create mode 100644 cows/udder.cow create mode 100644 cows/vader-koala.cow create mode 100644 cows/vader.cow create mode 100644 cows/www.cow create mode 100755 cowsay create mode 100644 cowsay.1 diff --git a/cows/beavis.zen.cow b/cows/beavis.zen.cow new file mode 100644 index 0000000..758ee80 --- /dev/null +++ b/cows/beavis.zen.cow @@ -0,0 +1,23 @@ +## +## Beavis, with Zen philosophy removed. +## +$the_cow = <> 5.4 +## +$the_cow = < \\ _ -~ `. ^-` ^-_ + ///-._ _ _ _ _ _ _}^ - - - - ~ ~-- ,.-~ + /.-~ +EOC diff --git a/cows/elephant-in-snake.cow b/cows/elephant-in-snake.cow new file mode 100644 index 0000000..1003cdf --- /dev/null +++ b/cows/elephant-in-snake.cow @@ -0,0 +1,14 @@ +## +## Do we need to explain this? +## +$the_cow = < + ---___ XXX__/ XXXXXX \\__ / + \\- --__/ ___/\\ XXXXXX / ___--/= + \\-\\ ___/ XXXXXX '--- XXXXXX + \\-\\/XXX\\ XXXXXX /XXXXX + \\XXXXXXXXX \\ /XXXXX/ + \\XXXXXX > _/XXXXX/ + \\XXXXX--__/ __-- XXXX/ + -XXXXXXXX--------------- XXXXXX- + \\XXXXXXXXXXXXXXXXXXXXXXXXXX/ + ""VXXXXXXXXXXXXXXXXXXV"" +EOC diff --git a/cows/head-in.cow b/cows/head-in.cow new file mode 100644 index 0000000..2e51774 --- /dev/null +++ b/cows/head-in.cow @@ -0,0 +1,12 @@ +## +## Go stick yer head in a cow. +## +$the_cow = < +EOC diff --git a/cows/moofasa.cow b/cows/moofasa.cow new file mode 100644 index 0000000..15119d6 --- /dev/null +++ b/cows/moofasa.cow @@ -0,0 +1,14 @@ +## +## MOOfasa. +## +$the_cow = <> +EOC diff --git a/cows/stegosaurus.cow b/cows/stegosaurus.cow new file mode 100644 index 0000000..2e0decd --- /dev/null +++ b/cows/stegosaurus.cow @@ -0,0 +1,19 @@ +## +## A stegosaur with a top hat? +## +$the_cow = < < > .---. + $thoughts | \\ \\ - ~ ~ - / / | + _____ ..-~ ~-..-~ + | | \\~~~\\.' `./~~~/ + --------- \\__/ \\__/ + .' O \\ / / \\ " + (_____, `._.' | } \\/~~~/ + `----. / } | / \\__/ + `-. | / | / `. ,~~| + ~-.__| /_ - ~ ^| /- _ `..-' + | / | / ~-. `-. _ _ _ + |_____| |_____| ~ - . _ _ _ _ _> +EOC diff --git a/cows/stimpy.cow b/cows/stimpy.cow new file mode 100644 index 0000000..4d61425 --- /dev/null +++ b/cows/stimpy.cow @@ -0,0 +1,19 @@ +## +## Stimpy! +## +$the_cow = <> +EOC diff --git a/cows/three-eyes.cow b/cows/three-eyes.cow new file mode 100644 index 0000000..0786462 --- /dev/null +++ b/cows/three-eyes.cow @@ -0,0 +1,12 @@ +## +## A cow with three eyes, brought to you by dpetrou@csua.berkeley.edu +## +$extra = chop($eyes); +$eyes .= ($extra x 2); +$the_cow = <____) >___ ^\\_\\_\\_\\_\\_\\_\\) + ^^^//\\\\_^^//\\\\_^ ^(\\_\\_\\_\\) + ^^^ ^^ ^^^ ^ +EOC diff --git a/cows/turtle.cow b/cows/turtle.cow new file mode 100644 index 0000000..4286b09 --- /dev/null +++ b/cows/turtle.cow @@ -0,0 +1,20 @@ +## +## A mysterious turtle... +## +$the_cow = < 'oo', + 'f' => 'default.cow', + 'n' => 0, + 'T' => ' ', + 'W' => 40, +); + +getopts('bde:f:ghlLnNpstT:wW:y', \%opts); + +&display_usage if $opts{'h'}; +&list_cowfiles if $opts{'l'}; + +$borg = $opts{'b'}; +$dead = $opts{'d'}; +$greedy = $opts{'g'}; +$paranoid = $opts{'p'}; +$stoned = $opts{'s'}; +$tired = $opts{'t'}; +$wired = $opts{'w'}; +$young = $opts{'y'}; +$eyes = substr($opts{'e'}, 0, 2); +$tongue = substr($opts{'T'}, 0, 2); +$the_cow = ""; + +&slurp_input; +$columns = $opts{'W'}; +$tabstop = 8; +@message = ($opts{'n'} ? @message : split("\n", fill("", "", @message))); +&construct_balloon; +&construct_face; +&get_cow; +print @balloon_lines; +print $the_cow; + +sub list_cowfiles { + my $basedir; + my @dirfiles; + chop($basedir = cwd); + for my $d (split(/:/, $cowpath)) { + print "Cow files in $d:\n"; + opendir(COWDIR, $d) || die "$0: Cannot open $d\n"; + for my $file (readdir COWDIR) { + if ($file =~ s/\.cow$//) { + push(@dirfiles, $file); + } + } + closedir(COWDIR); + print wrap("", "", sort @dirfiles), "\n"; + @dirfiles = (); + chdir($basedir); + } + exit(0); +} + +sub slurp_input { + unless ($ARGV[0]) { + chomp(@message = ); + } else { + &display_usage if $opts{'n'}; + @message = join(' ', @ARGV); + } +} + +sub maxlength { + my ($l, $m); + $m = -1; + for my $i (@_) { + $l = length $i; + $m = $l if ($l > $m); + } + return $m; +} + +sub construct_balloon { + my $max = &maxlength(@message); + my $max2 = $max + 2; ## border space fudge. + my $format = "%s %-${max}s %s\n"; + my @border; ## up-left, up-right, down-left, down-right, left, right + if ($0 =~ /think/i) { + $thoughts = 'o'; + @border = qw[ ( ) ( ) ( ) ]; + } elsif (@message < 2) { + $thoughts = '\\'; + @border = qw[ < > ]; + } else { + $thoughts = '\\'; + @border = qw[ / \\ \\ / | | ]; + } + push(@balloon_lines, + " " . ("_" x $max2) . " \n" , + sprintf($format, $border[0], $message[0], $border[1]), + (@message < 2 ? "" : + map { sprintf($format, $border[4], $_, $border[5]) } + @message[1 .. $#message - 1]), + (@message < 2 ? "" : + sprintf($format, $border[2], $message[$#message], $border[3])), + " " . ("-" x $max2) . " \n" + ); +} + +sub construct_face { + if ($borg) { $eyes = "=="; } + if ($dead) { $eyes = "xx"; $tongue = "U "; } + if ($greedy) { $eyes = "\$\$"; } + if ($paranoid) { $eyes = "@@"; } + if ($stoned) { $eyes = "**"; $tongue = "U "; } + if ($tired) { $eyes = "--"; } + if ($wired) { $eyes = "OO"; } + if ($young) { $eyes = ".."; } +} + +sub get_cow { +## +## Get a cow from the specified cowfile; otherwise use the default cow +## which was defined above in $the_cow. +## + my $f = $opts{'f'}; + my $full = ""; + if ($opts{'f'} =~ m,/,) { + $full = $opts{'f'}; + } else { + for my $d (split(/:/, $cowpath)) { + if (-f "$d/$f") { + $full = "$d/$f"; + last; + } elsif (-f "$d/$f.cow") { + $full = "$d/$f.cow"; + last; + } + } + if ($full eq "") { + die "$progname: Could not find $f cowfile!\n"; + } + } + do $full; + die "$progname: $@\n" if $@; +} + +sub display_usage { + die <