Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Make sure the Tk module is installed and this should work under Unix/Linux and Windows.
($,='O9xx67O95530114X')=~y/0-9xOX/we+only JapH!/; $b='gold';sub O{@q=(pop,-pop);map{($r,$s)=(pop,-pop);@q=($r, $s,@q,-$r,$s )}@_;(0,0,@ q)}sub l{$l= shift;$c-> createText ((map$_+20 +0, @_),-text=>$ l)} sub p{( sqrt ($_[0]**2 ++$_ [1]**2),atan2 ($_ [1], $_[0 ])+$ _[2]%60*. +105) }sub c{($_[0]* cos$_[1],$_[0] *sin$_[1])}sub P{$;=shi +ft;$c ->createPolygon ((map$_*5+200 ,@_),-fill =>$;)}su +b _{( $p,$q,$r)=splice @_,0,3;$$r &&$c-> delete($$ +r);my @U;while(@j=splice @_,0, 2){@U=(@U,c + p@j, $q)}$$r=P$p,@U}@M= (O 32,1,36,0) ;@a= (O 1,1, +34,1, 35,0);@p=(O 1,1,24, 2,28,0);@_=qw; -width 400 -he +ight 400;;use Tk;$o=new MainWindow (-t +itle =>$,);$c=$o->Canvas (@_)->pack;$c-> createOval(20,20 +,380 ,380,-fill,'orange'); $B='#000000';P brown=> 3,-30,5,-35,3,-3 +7,8, -40,9,-35,4,-28;P$b,- 10,-5,- 16,-16,-4, -16;P$b,10,-5,4, +-16 ,16,-16;P$b,-4,-18, -20,-22, -14,-24;P$ b,4,-18,20,-22,1 +4, -24;P$b,-5,5,0,-5,5 ,5;P$b,-29,12,-22,12,- 16,18,-10,12,-6, 12,0,18,6,12,10,12 ,16,18,22,12,29,12,19, 27,14,27,8,21,2, 27,-2,27,-8,21,-14 ,27,-19,27;$o-> repeat(1000,sub{($s,$m,$h)=localtime;_($B,$h%12*5+$m/ 12,\$H,@p);_($B,$m,\$M,@a);_(red=>$s,\$S,@M)}); map{l$_,c p 0,-190,$_%12*5}(1..12);MainLoop
Updated:  Slight modification made (spoiler) ...
The hour hand was only moving once each hour -- it now moves every 12 minutes, to give a more accurate representation of the hour.

In reply to Japh O' Lantern by liverpole

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-26 01:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found