Skip to content

Instantly share code, notes, and snippets.

@colomon
Created November 19, 2010 03:14
Show Gist options
  • Save colomon/706079 to your computer and use it in GitHub Desktop.
Save colomon/706079 to your computer and use it in GitHub Desktop.
sub mandelbrot($c) {
my $z = $c;
for 1 .. 20 {
$z = $z * $z + $c;
return $_ if abs $z > 2;
}
}
loop (my $y = 1; $y >= -1; $y -= 0.05) {
loop (my $x = -2; $x <= 0.5; $x += 0.0315) {
print mandelbrot($x + $y * i) ?? ' ' !! '#';
}
print "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment