pascal

pascal-cr

Pascal triangle visuals in Crystal

This is an update of the slow Perl version. The goal is to reproduce images like these much more efficiently.

Building

Both Ruby and Crystal are required. Additional dependencies can be installed with bundle and shards:

bundle install  # install ruby gems
shards install  # install crystal shards

Build by running one of the following:

./build.rb                        # standard build
./build.rb --release              # optimized build
crystal run src/run.cr -- [args]  # build and run `pascal` with paramters `[args]`

Usage

To generate triangles, run:

./pascal     # run with default options
./pascal -h  # show usage guide

View output SVG files in a browser, or Eye of GNOME (eog), for example