#!/usr/bin/perl
use strict;
use warnings;
use Text::QRCode;
use TextPrinter::ColourGrid;
use TextPrinter::StarGrid;
use GridFiller;
use Path::Class;
use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init($INFO);

my $data='MECARD:N:Ceccarelli,Gianni;TEL:+447564023056;EMAIL:dakkar@thenautilus.net;URL:http://www.thenautilus.net/contacts/;NICKNAME:dakkar;;';
$data = 'x';

my $qr=Text::QRCode->new(
    level=>'L',
    mode=>'8-bit',
);

my $arr=$qr->plot($data);

my @words = grep { length($_) > 2 }
    file('/usr/share/dict/propernames')->slurp(chomp=>1);

my $filler=GridFiller->new({words=>\@words,grid=>$arr});

$filler->fill;

TextPrinter::ColourGrid->new->draw_whole($filler->result,1);

print "\n\n";

TextPrinter::StarGrid->new->draw_whole($arr,1);
