Esolangs - Brainf**k. Mandelbrot set as you've never seen before..

Use this section to discuss your embedded Flowcode projects.
Post Reply
mnfisher
Valued Contributor
Posts: 1579
http://meble-kuchenne.info.pl
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 140 times
Been thanked: 744 times

Esolangs - Brainf**k. Mandelbrot set as you've never seen before..

Post by mnfisher »

I posted a simple Brainf**k compiler a few days ago.

I had an idea for a major improvement - rather than a (rather large) jump table - I would compile the jumps into the program code. Now jumps add 4 bytes per loop rather than a fixed table of 40k :-)

So - with a little fiddling I got the mandelbrot.bf program to run on an esp32. The code is from https://github.com/ErikDubbelboer/brain ... delbrot.bf
and all credit to Erik for this incredible achievement!

To run - it only outputs a newline at the end of each line - so set PuTTY or your chosen terminal program to output a carriage return on newline.

To avoid WDT errors - I add a 100ms pause every 100000 bf instructions executed - I didn't do any tests to see how many loops could be run - so this could possibly be made a bit faster.

The mandelbrot set is output (slowly!) as an ASCII image - with the letters indicating how may iterations are needed to go to infinity..
tarpit.fcfx
(108.29 KiB) Downloaded 505 times
(Sorry might have had the wrong file before)


Martin

mnfisher
Valued Contributor
Posts: 1579
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 140 times
Been thanked: 744 times

Re: Esolangs - Brainf**k. Mandelbrot set as you've never seen before..

Post by mnfisher »

Changing the check on 'tim' in ExecuteBF to every 500000 loops gives a very nice speedup and still no wdt problems... and just tried 1000000 with a 50ms delay and all good too! - now up to 5000000 bf instructions before delay!

Compiling optimised for performance (idf.py menuconfig) gives a little extra whizz too :-)

mnfisher
Valued Contributor
Posts: 1579
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 140 times
Been thanked: 744 times

Re: Esolangs - Brainf**k. Mandelbrot set as you've never seen before..

Post by mnfisher »

mandel.jpg
mandel.jpg (308.95 KiB) Viewed 5530 times
About 45mins!

chipfryer27
Valued Contributor
Posts: 1639
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 362 times
Been thanked: 575 times

Re: Esolangs - Brainf**k. Mandelbrot set as you've never seen before..

Post by chipfryer27 »

Hi

Impressive stuff indeed.

I hope that's a screenshot from your Sinclair :)

Regards

mnfisher
Valued Contributor
Posts: 1579
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 140 times
Been thanked: 744 times

Re: Esolangs - Brainf**k. Mandelbrot set as you've never seen before..

Post by mnfisher »

From the esp 32 to PuTTY. The flowcode compiled and then runs the brainf**k program..

Cool considering the only instructions are +1, - 1, next cell, previous cell, loop and print!

Turing complete!

Post Reply