Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I'd like to offer up a small conversion to make this web-based. I'm not sure how well it would perform on a low bandwidth connection, but running off my local web server it works quickly enough to completely refresh and complete the request every second. Good stuff, ++hiseldl!
#!perl $|=1; $w = 25; $h = 25; $img="."x($w*$h-1); substr($img,11*$w+12,1,"#"); # in the middle $,="\n"; @hour=split//,"Just"; @min =split//,"another"; @sec =split//,"Perl hacker"; print "Content-type: text/html\n\n"; print "<pre>"; @t = localtime; $_=$img; for $hidx(0..3) { $newx=newx($t[2]%12*30+180,0,2+$hidx)+12; $newy=newy($t[2]%12*30+180,0,2+$hidx)+11; $vx = sprintf("%d", $newx); $vy = sprintf("%d", $newy); substr($_,$vy*$w+$vx,1,$hour[$hidx]); } for $midx(0..$#min) { $newx=newx($t[1]*6,0,-4-$midx)+12; $newy=newy($t[1]*6,0,-4-$midx)+11; $vx = sprintf("%d", $newx); $vy = sprintf("%d", $newy); substr($_,$vy*$w+$vx,1,$min[$midx]); } for $sidx(0..$#sec) { $newx=newx($t[0]*6,0,-1-$sidx)+12; $newy=newy($t[0]*6,0,-1-$sidx)+11; $vx = sprintf("%d", $newx); $vy = sprintf("%d", $newy); substr($_,$vy*$w+$vx,1,$sec[$sidx]); } print (/.{$w}/g),scalar localtime; print '<meta http-equiv="refresh" content="1;url=">'; sub newx { my($ang,$x,$y) = @_; my $a=$ang * atan2(1,1)/45;# angle in radians return ($x)*cos($a) - ($y)*sin($a); } sub newy { my($ang,$x,$y) = @_; my $a=$ang * atan2(1,1)/45;# angle in radians return ($x)*sin($a) + ($y)*cos($a); } exit 0;

In reply to Re: Camel Time by Theseus
in thread Camel Time by hiseldl

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others rifling through the Monastery: (4)
    As of 2020-09-26 18:15 GMT
    Find Nodes?
      Voting Booth?
      If at first I donít succeed, I Ö

      Results (142 votes). Check out past polls.