cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk-Willem van Gulik <di...@webweaving.org>
Subject Re: Warped Text... (off topic)
Date Fri, 02 Sep 2005 15:50:25 GMT

On Fri, 2 Sep 2005, Pier Fumagalli wrote:

> > http://agylen.com/2005/05/16/captcha-validator-for-cocoon-forms/
> >
> > Ciao,
>
> Yep, but SVG IMVHO is quite overkill to generate a simple image...

For something really simple:

sub getBCD {
        $_ = (123567,36,13457,13467,2346,12467,24567,136,1234567,12346)[ shift @_ ];
        return (((m/1/) ? ' _ ' : '   '),
                ((m/2/) ? '|' : ' ').  ((m/4/) ? '_' : ' ').  ((m/3/) ? '|' : ' '),
                ((m/5/) ? '|' : ' ').  ((m/7/) ? '_' : ' ').  ((m/6/) ? '|' : ' '));
};

map { my @r = getBCD($_); map { $out[ $_ ] .= $r[$_].' '; } (0 .. 2); } '3231' =~ m/./g;

print join("\n",@out);

Just kidding.

Dw.

Mime
View raw message