Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
selfgol [2007-10-06 19:47] – 192.168.1.48 | selfgol [2020-10-22 14:34] – Working selfgol code from https://debconf2.debconf.org/talks/dconway/dconway-extreme-perl.tex 63.241.40.119 | ||
---|---|---|---|
Line 16: | Line 16: | ||
SelfGOL was written to win all four categories in the Obfuscated Perl contest (3rd year, I believe, whose web pages are no longer available) and still comply with other restrictions of not using modules and being under 1000 bytes. Alas, the rules were drastically changed for the following year's contest, and so it was never entered. | SelfGOL was written to win all four categories in the Obfuscated Perl contest (3rd year, I believe, whose web pages are no longer available) and still comply with other restrictions of not using modules and being under 1000 bytes. Alas, the rules were drastically changed for the following year's contest, and so it was never entered. | ||
- | the self-replicating code, used the standard quine code: | + | the self-replicating code, used the standard |
<code perl> | <code perl> | ||
- | @s=( | + | # |
- | q[printf pop@s, @s], | + | $; |
- | q[@s=(q[%s], | + | ; |
- | )x2; | + | i{sleep& |
- | printf pop @s, @s; | + | & |
- | + | [n($f-$x)+n($x+$f)-(${m}eq+O=>)+n$f]||$w}$w=" | |
- | # | + | x$y; |
- | $; | + | substr+$c, |
- | i{sleep& | + | sub' |
- | n{substr($b,& | + | |
- | n($x+$f)-(substr($b,&f,1)eq+O)+n$f]||$w}$w=" | + | |
- | x$y; | + | |
- | substr+$c, | + | |
- | 1}'; | + | |
__DATA__ | __DATA__ | ||
- | if($j){{$^W=$|; | + | $d&& |
- | @s=(q[$_=sprintf+pop@s, | + | @s=(q[$_=sprintf+pop@s, |
- | if($j){{$^W=$|; | + | $d&& |
- | @s=(q[%s], | + | @s=(q[%s], |
- | ])x2; | + | ]))x2; |
- | q<#!/usr/local/bin/perl -sw | + | q<# |
- | if(!$s){> | + | !$s?{do{> |
- | if(!$s){> | + | !$s?{do{> |
])x2; | ])x2; | ||
> | > |