Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Tick-tock 2, a self-modifying quine

by rob_au (Abbot)
on Jan 27, 2003 at 13:37 UTC ( #230221=obfuscated: print w/ replies, xml ) Need Help??

Following on from Tick-tock, the following obfuscated code has been tested to execute cleanly on both Linux and Windows - This code differs markedly from my previous obfuscation in that the code below is also a self-modifying quine, albeit, this quine behaviour is achieved through performing a seek on the DATA file handle.

I am considering my obfuscation fix now thoroughly purged! :-)

#!/usr/bin/perl ' ....... '; ' .. .. '||print"Tick-Tock 2, a self-modifying quine"; ' .. .. '&&seek+DATA,!++$|,0;@ot=<DATA>;for($[..$#ot){ ' . . '&&($ot[$_]=~/^[^']/)&&next;$c=substr($ot[$_], ' . . '+1,22);$c=~s/[^\.\s]/ /g;substr($ot[$_],1,22+ ' . . ',$c)};for(0..359){$c[$_]=[cos(atan2(1,1)/45*( ' . . '+$_-90)),sin(atan2(1,1)/45*($_-90))]};@time=( ' . . ',localtime)[2,3];$o=join'',@ot;$l=0;for($[..( ' . . '+10)){$l+=length($ot[$_])+1};$l++;for(1..((9+ ' . . '))){substr($o,$l+int($_*$c[($time[0]*6)][1]*( ' . . '+1))*71+int($_*$c[$time[0]*6]->[0]),1,'m');}; ' . . ';for(1..4){substr($o,$l+int($_*$c[($time[1+(( ' . . '))]%12)+($time[0]/60)*30][1])*71+int($_*$c[0+ ' . . '+(($time[1]%12)+$time[0]/60)*30][0]),1,'h');; ' . . ';};sub rnd{$v=CORE::int$_[0]*10**$_[1]+.5;1&& ' . . ';$v=~s;(.{$_[1]})$;\.$1;;(substr($v,0x0-1+((( ' . . '))))eq'.')&&do{chop$v};$v};END{((defined$o)&( ' . . '||1));print$o;sleep(30);eval$o};sub int{0x1&& ' .. .. ';rnd(shift,0)};BEGIN{$s=($^O=~/MSWin/i)?do{1& ' .. .. ';'cls'}:('clear');system($s)}; ' ....... '; __DATA__

 

perl -le 'print+unpack("N",pack("B32","00000000000000000000001000101000"))'

Comment on Tick-tock 2, a self-modifying quine
Select or Download Code
Re: Tick-tock 2, a self-modifying quine
by zentara (Archbishop) on Jan 27, 2003 at 14:25 UTC
    Hi, seems to work, but there is something wrong with the <code> blocks; there are a couple of extra blank lines and the words "seek" and "DATA", when I d/l code. Unless I'm mistaking that for part of the quine. But I had to delete them to get it to run.
Re: Tick-tock 2, a self-modifying quine
by bart (Canon) on Jan 27, 2003 at 15:35 UTC
    Excellent, except that I don't know of many terminals that make use of square characters. ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://230221]
Approved by Mr. Muskrat
Front-paged by Mr. Muskrat
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2015-07-07 06:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls