comparison bin/random-card @ 8072:90dbd630fd23

<b_jonas> `` perl -pi -e \'s/ (\\$c\\[rand\\(\\@c\\)])/($1 || "No card found.")/\' bin/random-card
author HackBot
date Mon, 16 May 2016 11:14:18 +0000
parents a4a897101bb9
children 8934300cd6d1
comparison
equal deleted inserted replaced
8071:ffbbcc65bbe2 8072:90dbd630fd23
1 #!/bin/sh 1 #!/bin/sh
2 exec perl -e'open$I,"<","share/mtg/allsets.txt"or die$!;$/=""; @c=grep{/(?mi:$ARGV[0])/}<$I>; print $c[rand(@c)];' "$1" 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"