Re: spiraling quine by thelenm (Vicar) on Jun 20, 2002 at 15:27 UTC |
My only complaint is that I don't have the ability to upvote it multiple times. :-) That is absolutely incredible. Good work!!
-- Mike
--
just,my${.02} | [reply] |
|
I totaly aggree. That kind of code just shows me how mutch more I have yet to learn. Keep it up Len. (++) :-)
---If it doesn't fit use a bigger hammer
| [reply] |
Re: spiraling quine by sschneid (Deacon) on Jun 20, 2002 at 18:10 UTC |
(++)
...wow. quite incredible, if i do say so myself. | [reply] |
Re: spiraling quine by Marza (Vicar) on Jun 20, 2002 at 20:06 UTC |
| [reply] |
|
Really slick! Only had to change clear to cls as I have a PC.
s/PC/DOS or Win32 based PC/;
PCs can run many different operating systems, and Windows is just one of them. Unixish operating systems use "clear", DOS (and Win32) systems use "cls", but it can be something completely different. If you want to extend your computer (or PC :) knowledge, or just dislike Windows' instability, try some operating systems, like Linux or FreeBSD. Many are free.
- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.
| [reply] |
Re: spiraling quine by cecil36 (Monk) on Jun 20, 2002 at 20:40 UTC |
My upvote has just crossed over into...the Twilight Zone. | [reply] |
Re: spiraling quine by phrenesis (Initiate) on Jun 21, 2002 at 12:54 UTC |
This is really cool, too bad im a n00b and cant vote on it yet :)
Phrenesis | [reply] |
Re: spiraling quine by BrowserUk (Pope) on Jun 21, 2002 at 14:09 UTC |
| [reply] |
Re: spiraling quine by Anonymous Monk on Jun 21, 2002 at 19:07 UTC |
Easily the strangest thing I've seen in code.
Jolly good work, Len. | [reply] |
Re: spiraling quine by RMGir (Parson) on Jun 21, 2002 at 19:54 UTC |
Wow.
/msg'd myself, I definitely want to ++ this tomorrow...
What were you drinking when you thought this up, though? :)
--
Mike | [reply] |
Hypnotic by perlmoth (Hermit) on Jun 27, 2002 at 12:20 UTC |
I lost an hour playing with this code this morning. Now I feel a strange compulsion to ++ all your nodes. | [reply] |
please delete by NodeReaper (Curate) on Jun 27, 2002 at 16:25 UTC |
| [reply] |
|
Wow. My head's spinning.... One of the best obfuscateds I have seem.
| [reply] |
|
Tnx Olecam.
I've done some minor changes to the Windows code.
Putting the system("cls") just before the print gives a better flicker-free image.
And because system("cls") has more chr's than `clear` some frames (for example the 5th frame) are not self-replicating because the output code is incomplete. So I've decreased the radius of the spiral a bit so all the code fit's
in it....
#!/usr/bin/perl
$_='
$q= "\4 7"
;wh ile($;=$z+=.5 ){ %c
=$r =0;$/="";while( 21+$ z> (
$; +=.05)) {$c{i nt $ _+
26 +2*( $r+=. 0 1
9 )*s in $; }{1
- $_ +10+int$r*c os$; }=1
f or(0..1)}$t=re v e r s
e; $/. =`cl s` ."
#! /u sr /bi n/ pe
rl \n\ $_=$q\n" ;f or
$y (1. .20){ $c {$
_ } { $y }? $
/.= chop$ t:( $/
. ="\4 0")for( 0..53 );
$ /.=" \n"}system("cls ")
;p ri nt "$/$q;s ;".
c h r(92) ."s;
; g; eva l\n" }
';s;\s;;g;eval
| [reply] [d/l] |
|
The version for *nix kind of worked on Win32, if you screwed your eyes up. I was impressed with 'just' that.
Having read on and found this (the Win32 version) - I'm blown away!
| [reply] |
Re: spiraling quine by johnirl (Monk) on Jul 12, 2002 at 15:29 UTC |
Fantastic Len!!
recently at my first day in my new job my boss said we going to require you to do mostly perl programming. I said no problem always willing to learn a new language. He said we expect you to be up too this level in a few weeks and showed me this code. Frightened the life out of me.
Cool code though. :-) | [reply] |
|
Sounds like a cool place to work in :)
| [reply] |
Re: spiraling quine by RocketPro (Initiate) on Oct 21, 2002 at 23:56 UTC |
Yeah, um... on Windows NT it looks like crap... too bad there isn't a way to clear the window. | [reply] |
|
| [reply] |
Re: spiraling quine by wufnik (Friar) on Jul 25, 2003 at 12:15 UTC |
beautiful; your spiral the best tool for perl evangelism i have know of. should be sent to hofstadter for inclusion in his next volume.
wufnik
-- in the world of the mules there are no rules --
| [reply] |
|
| [reply] |
Re: spiraling quine by PyrexKidd (Monk) on Feb 17, 2011 at 21:20 UTC |
In an effort to understand what is going on here, I decided to put the code in a more readable format
#!/usr/bin/perl
$_='
$q="\47";
while($; = $z+ =.5){
%c = $r = 0;
$/="";
while(20+$z>($;+=.05)){
$c
{ int $_ + 26 + 2 * ($r += .02) * sin $; }
{ 1 - $_ + 10 + int $r * cos $; }
= 1for(0..1)
}
$t = reverse;
$/ .= `clear` . "#!/usr/bin/perl\n\$_=$q\n";
for $y (1..20){
$c{$_}{$y}
? $/ .= chop $t
: ($/ .= "\40")for(0..53);
$/.="\n"
}
print "$/$q;s;" .chr(92). "s;;g;eval\n"
}
';
s;\s;;g;eval
Quite amazingly it prints the same image in this format. I think it has to do with the sin/cos.
Two things I am unfamiliar with, the $; variable and this line:
s;\s;;g;eval
Big props BTW
| [reply] [d/l] [select] |
Re: spiraling quine by ambrus (Abbot) on Feb 18, 2011 at 11:02 UTC |
| perl -we 'use Time::HiRes "sleep"; $/="\e"; while(<>){ print; sleep
+0.1 }'
so that it becomes enjoyable.
| [reply] [d/l] |