Simulate cowsay
in the default mode.
$ cowsay <<< Hello
_______
< Hello >
-------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
$ perl -e 'print "Long text "x20' | cowsay
__________________________________________
/ Long text Long text Long text Long text \
| Long text Long text Long text Long text |
| Long text Long text Long text Long text |
| Long text Long text Long text Long text |
\ Long text Long text Long text Long text /
------------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
How short can be the code? The cow and the balloon can be slightly different, but all elements should be present. Dynamic/multiline balloon is a plus.
Explicit list of the required elements:
- Text;
- Balloon;
- Line from the cow to the balloon;
- The cow (eye[s], month, ears, body, legs (minimum two), udder, tail).
/usr/share/cowsay/cows/
may be accessed, but obviously not /usr/games/cowsay
itself.
Note: here is the /usr/share/cowsay/cows/default.cow
file:
$the_cow = <<"EOC";
$thoughts ^__^
$thoughts ($eyes)\\_______
(__)\\ )\\/\\
$tongue ||----w |
|| ||
EOC
Usage of the file is optional. When used, it must be accessed by full path. (Windows users may copy it to something like C:\usr\share\cowsay\co\default.cow
, for fairness).