Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
selfgol [2007-06-07 12:02] – created nik | selfgol [2020-10-22 15:13] (current) – nik | ||
---|---|---|---|
Line 11: | Line 11: | ||
selfgol -g [-y=## -x=##] [< gamefile] plays the Game of Life with its own source code or an arbitrary file, with optional height and width restrictions. | selfgol -g [-y=## -x=##] [< gamefile] plays the Game of Life with its own source code or an arbitrary file, with optional height and width restrictions. | ||
- | | + | |
selfgol -d[=bannertext] displays a rotating banner with the provided text. If no text is provided, it uses the program name as the text. | selfgol -d[=bannertext] displays a rotating banner with the provided text. If no text is provided, it uses the program name as the text. | ||
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 is based on the standard |
- | < | + | < |
- | @s=( | + | |
q[printf pop@s, @s], | q[printf pop@s, @s], | ||
q[@s=(q[%s], | q[@s=(q[%s], | ||
)x2; | )x2; | ||
printf pop @s, @s; | printf pop @s, @s; | ||
+ | </ | ||
+ | |||
+ | ...expanded into this Obfuscation | ||
- | # | + | <code perl> |
- | $; | + | # |
- | i{sleep& | + | $; |
- | n{substr($b,& | + | ; |
- | n($x+$f)-(substr($b,&f,1)eq+O)+n$f]||$w}$w=" | + | i{sleep& |
- | x$y; | + | & |
- | substr+$c, | + | [n($f-$x)+n($x+$f)-(${m}eq+O=>)+n$f]||$w}$w=" |
- | 1}'; | + | x$y; |
+ | substr+$c, | ||
+ | sub' | ||
__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; | ||
> | > | ||
</ | </ | ||
- | or download -> [[/ | ||
- | ---- | + | ==== some (other) |
- | loosely related, | + | |
+ | loosely related,.. from -> http:// | ||
Author: Tushar Samant | Author: Tushar Samant | ||
- | Note: This will produce itself, and will do so no matter what you set $a to in the beginning. So if the length of $a is n, and the size of the allowed character set is C, then at least C**n out of C**(n+K) strings are self-reproducing Perl programs. | + | Note: This will produce itself, and will do so no matter what you set $a to in the beginning. So if the length of $a is n, and the size of the allowed character set is C, then at least < |
< | < | ||
Line 60: | Line 64: | ||
Author: Brian Raiter | Author: Brian Raiter | ||
- | < | + | < |
$_=q{$_=q{Q}; | $_=q{$_=q{Q}; | ||
</ | </ | ||
Author: V Vinay | Author: V Vinay | ||
- | < | + | < |
$_=q(print" | $_=q(print" | ||
- | paper on writing quines (in C) http:// | ||
</ | </ | ||
+ | |||
+ | paper on writing [[quines]] (in C) http:// | ||
---- | ---- | ||
Libarynth > Libarynth Web > ComputerScience > GeneticProgramming > SelfGOL r5 - 30 Sep 2006 - 16:29 | Libarynth > Libarynth Web > ComputerScience > GeneticProgramming > SelfGOL r5 - 30 Sep 2006 - 16:29 | ||
---- | ---- |