# “ Cowsay”的简称[关闭]

12

`cowsay`在默认模式下模拟。

``````\$ 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 |
||     ||
``````

• 文本;
• 气球;
• 从牛到气球的线；
• 牛（眼睛，月份，耳朵，身体，腿（最少两个），乳房，尾巴）。

`/usr/share/cowsay/cows/`可以访问，但显然不能访​​问`/usr/games/cowsay`

``````\$the_cow = <<"EOC";
\$thoughts   ^__^
\$thoughts  (\$eyes)\\_______
(__)\\       )\\/\\
\$tongue ||----w |
||     ||
EOC
``````

Mego

26

## Mathematica：进行中

``````ExampleData[{"Geometry3D", "Cow"}]
``````

12

acolyte

bahahahhahahahhahaha
jamylak

7
...完成了吗？
noɥʇʎԀʎzɐɹƆ

16

# Perl，84个字符

``````print\$a='-'x52,<>=~s/.{1,50}\b/sprintf"
|%-50s|",\$&/rge,"\$a
\\
]:p
| )=
| P=
¬"
``````

``````----------------------------------------------------
|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 |
----------------------------------------------------
\
]:p
| )=
| P=
¬
``````

manatwork 2013年

3

1

@manatwork `r`标志将返回结果，而不是就地修改操作数（`<>`当然是只读的，不能修改）。
primo

manatwork 2013年

5

# 红宝石：152个150 149 146 143字符

``````load'/usr/share/cowsay/cows/default.cow'
p=%w{U~ o* o o}
puts l=?-*44,gets.gsub(/(.{1,40})\b\s*/){"( %-41s)\n"%\$1}+l,\$the_cow.gsub(/\\$\w+/){p.pop}
``````

``````bash-4.2\$ perl -e 'print "Long text "x15' | ruby cow.rb
--------------------------------------------
( 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            )
--------------------------------------------
o   ^__^
o  (o*)\_______
(__)\       )\/\
U~ ||----w |
||     ||
``````

## 与现有技术的弯曲：138 135 136字符

``````load'/usr/share/cowsay/cows/default.cow'
puts l=?-*44,gets.gsub(/(.{1,40})\b\s*/){"( %-41s)\n"%\$1}+l,\$the_cow.gsub(/\\$.+?([use]+)\b/,'\1')
``````

``````bash-4.2\$ ruby cow.rb <<< 'Hello poor little cow'
--------------------------------------------
( Hello poor little cow                    )
--------------------------------------------
s   ^__^
s  (es)\_______
(__)\       )\/\
ue ||----w |
||     ||
``````

2

## 178

``````{-1'g,({"+ ",x,((&/(c-4;60-#x))#" ")," +"}'l),(g:,(&/(64;4+c::#*l:(60*!-_-(#x)%60)_x))#"+"),("+  ^__^";" + (oo)\\_______";"   (__)\\       )\\/\\";"       ||----w |";"       ||     ||");}
``````

``````k){-1'g,({"+ ",x,((c-#x)#" ")," +"}'l),(g:,(&/(64;4+c::#*l:(60*!-_-(#x)%60)_x))#"+"),("+  ^__^";" + (oo)\\_______";"   (__)\\       )\\/\\";"       ||----w |";"       ||     ||");}"Hello codegolf.stackexchange.com"
++++++++++++++++++++++++++++++++++++
+ Hello codegolf.stackexchange.com +
++++++++++++++++++++++++++++++++++++
+  ^__^
+ (oo)\_______
(__)\       )\/\
||----w |
||     ||
``````

2

## APL 133 140 138 122

``````('∘'⍪'∘',((¯2↑1,⍴t)⍴t←⍎⍞),'∘')⍪'∘'⋄5 19⍴(,⍉(19⍴2)⊤323584 196592 63503 4072 3096)\'∘^__^∘(oo)\_______(__)\)\/\||----w|||||'
``````

``````' Hello '

°°°°°°°°°
° Hello °
°°°°°°°°°
°  ^__^
° (oo)\_______
(__)\       )\/\
||----w |
||     ||
``````

``````3 36⍴' Multi-line text input as an array. '

°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
° Multi-line text input as an array. °
° Multi-line text input as an array. °
° Multi-line text input as an array. °
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
°  ^__^
° (oo)\_______
(__)\       )\/\
||----w |
||     ||
``````

Vi。

1
@Vi。APL + WIN v5字符集基于单字节字符。我必须将它们转换为UTF-8，才能使其在此网站上正确呈现。因此，我认为将包括换行符的字符计为单个字节是合理的。我不确定如何运行APL。我通常建议在nars2000.org上使用免费版本，但它似乎不支持相对分配。
Graham