Skip to content

Instantly share code, notes, and snippets.

@masak
Created January 21, 2012 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masak/1653071 to your computer and use it in GitHub Desktop.
Save masak/1653071 to your computer and use it in GitHub Desktop.
Tupper's self-referential formula
# See http://en.wikipedia.org/wiki/Tupper%27s_self-referential_formula
my $k = 4858450636189713423582095962494202044581400587983244549483093085061934704708809928450644769865524364849997247024915119110411605739177407856919754326571855442057210445735883681829823754139634338225199452191651284348332905131193199953502413758765239264874613394906870130562295813219481113685339535565290850023875092856892694555974281546386510730049106723058933586052544096664351265349363643957125565695936815184334857605266940161251266951421550539554519153785457525756590740540157929001765967965480064427829131488548259914721248506352686630476300;
for reverse $k .. $k + 17 -> $y {
for 0 .. 106 -> $x {
my $p = " ";
$p = "#" if 1/2 < floor(floor($y/17) * 2 ** (-17 * floor($x) - floor($y) % 17) % 2);
print $p;
}
say "";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment