It took me quite a bit to get the labyrinth on my homenode cavac sort of working. And it only displays correctly on Google Chrome (using Ubuntu 20.04 here, might look different on other operating systems with different fonts installed. And i am using pre tags, not code tags.

One way to render it better on PerlMonks would be to use a HTML table with colored cells. Something like this:

<table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="20px" height="20px" bgcolor="white"></td><td width="20px" h +eight="20px" bgcolor="black"></td><td width="20px" height="20px" bgco +lor="white"></td><td width="20px" height="20px" bgcolor="black"></td> </tr><tr> <td width="20px" height="20px" bgcolor="black"></td><td width="20px" h +eight="20px" bgcolor="white"></td><td width="20px" height="20px" bgco +lor="black"></td><td width="20px" height="20px" bgcolor="white"></td> </tr> </table>

Which will give you:

So, to generate a (mostly) PM compatible version, you would do something like this:

#!/usr/bin/env perl use strict; use warnings; use Text::QRCode; my $qr = Text::QRCode->new()->plot("YAPH"); my $black = '<td width="15px" height="15px" bgcolor="black"></td>'; my $white = '<td width="15px" height="15px" bgcolor="white"></td>'; print "<p>&nbsp;</p>;\n"; # Add "silent zone" print '<table border="0" border="0" cellspacing="0" cellpadding="0">', + "\n"; foreach my $line (@{$qr}) { print "<tr>"; foreach my $elem (@{$line}) { if($elem eq '*') { print $black; } else { print $white; } } print "</tr>\n"; } print '<\table">', "\n"; print "<p>&nbsp;</p>;\n"; # Add "silent zone"

Resulting in a somewhat useable QR code:

 

 

perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'

In reply to Re: Shameless plug and QR japh by cavac
in thread Shameless plug and QR japh by bliako

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.