Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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"))'

Replies are listed 'Best First'.
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. ;-)
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.

Log In?

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
[Corion]: I found Android Studio quite nice as a Java IDE, but then, I didn't try anything serious with it
[chacham]: it is a nice ide. its just that upgrading it always causes issues with mismatched versions of whatever
[Corion]: chacham: Oh, yes, reinstalling all the SDK versions and Gradle and whatnot, yes, even in the short time I used it (2 weeks?) I felt that pain
[chacham]: right now im editing the versions in the applications gradle file to use a version it wants. sheesh.
[Corion]: Ow, "but you're not supposed to do that" ;)

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (13)
As of 2017-03-29 08:02 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (344 votes). Check out past polls.