asoffer / Icarus

An experimental general-purpose programming language
Apache License 2.0
9 stars 2 forks source link

Add mandelbrot example #55

Closed perimosocordiae closed 3 years ago

perimosocordiae commented 3 years ago

This is a pretty basic implementation that produces a binary ASCII-art mandelbrot set.

It includes a custom linspace scope and a barebones complex struct, both of which should probably be in the stdlib at some point but for now they're useful demonstrations of how the language works.

Example output:

=================<<<<<<<<<<<<<<<<<<<<<<<<<<;;;;;;;;;::::987426+3 9;;;;;;;<<<<<<<
===============<<<<<<<<<<<<<<<<<<<<<<<<<;;;;;;;;;;;::::988753/5689::;;;;;;;<<<<<
=============<<<<<<<<<<<<<<<<<<<<<<<<<;;;;;;;;;;;;::::98765-" (7789:::;;;;;;<<<<
===========<<<<<<<<<<<<<<<<<<<<<<<<<;;;;;;;;;;;;::::9982 0&&  /4/59:::::;;;;;;<<
==========<<<<<<<<<<<<<<<<<<<<<<<<<;;;;;;;;;;;:::99998751       -5899:::::;;;;;<
=========<<<<<<<<<<<<<<<<<<<<<<<<;;;;;;;;;;:::9999988774)        6788999::::;;;;
========<<<<<<<<<<<<<<<<<<<<<<<;;;;;;;;;:::98873777766541      !2566788999858:;;
=======<<<<<<<<<<<<<<<<<<<<<<;;;;;;;;:::::9860 /355. . *        (- 2( 67777358:;
======<<<<<<<<<<<<<<<<<<<<<;;;;;;:::::::999863    0                  ./41&!0,29:
=====<<<<<<<<<<<<<<<<<<<<;;;;::::::::::9998764                         +   )579:
====<<<<<<<<<<<<<<<<<<;;;::::::::::::999986 32-                            .689:
===<<<<<<<<<<<<<<<;;;;:99999::::::99999886   '                             36899
===<<<<<<<<<<;;;;;;::9963788888888888887753-                               +4658
==<<<<<<<;;;;;;;;::::99.05667650567777775#                                     3
==<<<<;;;;;;;;;:::::998753  -330 2"356654&                                  )178
=<<<;;;;;;;;;;::::::988762'  (      '2432                                    329
=<<;;;;;;;;;:::::::9887341'           '0/                                    ) 9
=<;;;;;;;;;:::::99746664,              %)                                     89
=;;;;;;;;:99999888640200)                                                   '79:
=:::9997788998777551,                                                      )789:
0                                                                        /46899:
=:::9997788998777551,                                                      )789:
=;;;;;;;;:99999888640200)                                                   '79:
=<;;;;;;;;;:::::99746664,              %)                                     89
=<<;;;;;;;;;:::::::9887341'           '0/                                    ) 9
=<<<;;;;;;;;;;::::::988762'  (      '2432                                    329
==<<<<;;;;;;;;;:::::998753  -330 2"356654&                                  )178
==<<<<<<<;;;;;;;;::::99.05667650567777775#                                     3
===<<<<<<<<<<;;;;;;::9963788888888888887753-                               +4658
===<<<<<<<<<<<<<<<;;;;:99999::::::99999886   '                             36899
====<<<<<<<<<<<<<<<<<<;;;::::::::::::999986 32-                            .689:
=====<<<<<<<<<<<<<<<<<<<<;;;;::::::::::9998764                         +   )579:
======<<<<<<<<<<<<<<<<<<<<<;;;;;;:::::::999863    0                  ./41&!0,29:
=======<<<<<<<<<<<<<<<<<<<<<<;;;;;;;;:::::9860 /355. . *        (- 2( 67777358:;
========<<<<<<<<<<<<<<<<<<<<<<<;;;;;;;;;:::98873777766541      !2566788999858:;;
=========<<<<<<<<<<<<<<<<<<<<<<<<;;;;;;;;;;:::9999988774)        6788999::::;;;;
==========<<<<<<<<<<<<<<<<<<<<<<<<<;;;;;;;;;;;:::99998751       -5899:::::;;;;;<
===========<<<<<<<<<<<<<<<<<<<<<<<<<;;;;;;;;;;;;::::9982 0&&  /4/59:::::;;;;;;<<
=============<<<<<<<<<<<<<<<<<<<<<<<<<;;;;;;;;;;;;::::98765-" (7789:::;;;;;;<<<<
===============<<<<<<<<<<<<<<<<<<<<<<<<<;;;;;;;;;;;::::988753/5689::;;;;;;;<<<<<