#!/usr/bin/env perl

@cards = <seq-small/dia-s*.jpg>;

#print "@cards\n";

@court = qw(a d e q r);

$cnt = 22;
for($seq=1; $seq <= 14; ++$seq) {
#    for $s ('scepters', 'grails', 'swords', 'pentacles') {
    for $s ('ssc', 'sgr', 'ssw', 'spn') {       
#	$id = sprintf("%02d", $seq);
	$id = ($seq<10) ? $seq : $court[$seq-10];
	($card) = grep(m!/dia-$s$id!, @cards);

	if(!$card) {
		++$cnt;
		print "#  $s-$id not found\n";
		next;
	}

	print qq!mv '$card' $cnt.jpg\n!;
	++$cnt;
   }
}
