diff options
Diffstat (limited to 'script')
-rw-r--r-- | script/qr-color.pl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/script/qr-color.pl b/script/qr-color.pl index ecf7025..45c47ee 100644 --- a/script/qr-color.pl +++ b/script/qr-color.pl @@ -3,6 +3,8 @@ use strict; use warnings; use Text::QRCode; use TextPrinter; +use GridFiller; +use Path::Class; my $data='MECARD:N:Ceccarelli,Gianni;TEL:+447564023056;EMAIL:dakkar@thenautilus.net;URL:http://www.thenautilus.net/contacts/;NICKNAME:dakkar;;'; @@ -13,4 +15,11 @@ my $qr=Text::QRCode->new( my $arr=$qr->plot($data); -TextPrinter::draw_whole($arr,1); +my @words = grep { length($_) > 2 } + file('/usr/share/dict/words')->slurp(chomp=>1); + +my $filler=GridFiller->new({words=>\@words,grid=>$arr}); + +$filler->fill; + +TextPrinter::draw_whole($filler->result,1); |