Mercurial > repo
annotate bin/random-card @ 8839:34f2c0d8a6e8
<wob_jonas> learn anagol is Anarchy Golf, code golf server at http://golf.shinh.org/
author | HackBot |
---|---|
date | Sun, 24 Jul 2016 12:33:11 +0000 |
parents | 8934300cd6d1 |
children |
rev | line source |
---|---|
8000
ea34842a51f6
<b_jonas> `` echo $\'#!/bin/sh\\nexec perl -e\\\'\'\'open$I,"<","share/mtg/allsets.txt"or die$!;$/=""; @c=grep{/(?:$ARGV[0])/}<$I>; print $c[rand($c)];\'\\\'\' "$1"\' > bin/random-card && chmod -v a+x bin/random-card
HackBot
parents:
diff
changeset
|
1 #!/bin/sh |
8750
8934300cd6d1
<b_jonas> `` perl -i -pe \'s/("\\x241)/-- $1/\' bin/random-card
HackBot
parents:
8072
diff
changeset
|
2 exec perl -e'open$I,"<","share/mtg/allsets.txt"or die$!;$/=""; @c=grep{/(?mi:$ARGV[0])/}<$I>; print($c[rand(@c)] || "No card found.");' -- "$1" |