Page 1 of 1

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

Posted: Wed May 15, 2024 7:26 pm
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 633 times
(view online)
(Sorry might have had the wrong file before)


Martin

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

Posted: Wed May 15, 2024 7:45 pm
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 :-)

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

Posted: Wed May 15, 2024 9:47 pm
by mnfisher
mandel.jpg
mandel.jpg (308.95 KiB) Viewed 7135 times
About 45mins!

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

Posted: Wed May 15, 2024 10:12 pm
by chipfryer27
Hi

Impressive stuff indeed.

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

Regards

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

Posted: Wed May 15, 2024 10:36 pm
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!