view bin/random-card @ 8753:8c43a2d07d89

<oerjan> learn te/sting is important.
author HackBot
date Wed, 06 Jul 2016 01:02:54 +0000
parents 8934300cd6d1
children
line wrap: on
line source

#!/bin/sh
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"