Raku / examples

Many examples of Raku code
https://examples.raku.org/
Artistic License 2.0
294 stars 89 forks source link

Mandelbrot Set algorithm in Perl6 #40

Closed rsiqueira closed 8 years ago

rsiqueira commented 8 years ago

Generates the Mandelbrot Set fractal using Perl 6. To be submitted to "The Computer Language Benchmarks Game".

zoffixznet commented 8 years ago

Are you sure this example works? I'm getting garbage output into the terminal on my machine (see screenshot).

I'm on

zoffix@ZofMain:/tmp/tmp.sZAMIjgUqf$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Bodhi Linux 2.0.0
Release:    12.04
Codename:   precise
zoffix@ZofMain:/tmp/tmp.sZAMIjgUqf$ uname -a
Linux ZofMain 3.5.0-11-generic #11 SMP Wed Aug 22 14:45:14 CDT 2012 i686 i686 i386 GNU/Linux
zoffix@ZofMain:/tmp/tmp.sZAMIjgUqf$ 

screenshot from 2016-01-01 19 44 47

rsiqueira commented 8 years ago

Zoffixznet,

The output is a binary image file (.pbm format), as requested by the specification describing the expected output: https://benchmarksgame.alioth.debian.org/u32q/mandelbrot-description.html

Usage - The script should be run as: perl6 mandelbrot.pl 200 > image.pbm

To debug and see the result in the screen, it is also possible to see the output (Mandelbrot Set) as ASCII ART. To see this, you can comment the "$*OUT.write..." lines and uncomment the lines around print "o", "print "." and also uncomment the "print "\n" line.

zoffixznet commented 8 years ago

Got it. The image looks very nice. Thanks a lot.