Koch Fractals

Anything QL Software or Programming Related.
Post Reply
stevepoole
Super Gold Card
Posts: 715
Joined: Mon Nov 24, 2014 2:03 pm

Koch Fractals

Post by stevepoole »

Hi,

These unzipped programs will produce fractal snowflake outlines.

The original versions were iterative... ( with internal structures drawn too ).

Transformed to be recursive, these routines took far less code for the same job.

LRUN the koch3_bas file for 7 frame sizes, or click on the koch3.html one for a choice 5 imbricated (zoomable) flakes.

I could find no way of pausing recursive calls using JavaScript.... More research will be needed !

Best wishes,
Steve.

koch3_bas.zip
(724 Bytes) Downloaded 81 times
Koch3.zip
(1.51 KiB) Downloaded 80 times


stevepoole
Super Gold Card
Posts: 715
Joined: Mon Nov 24, 2014 2:03 pm

Re: Koch Fractals

Post by stevepoole »

Hi Per and All,

After thoroughly searching docs and website tutorials, it became possible to PAUSE between recursive FRAME calls, by printing pop-up windows. under FireFox.

But impossible with Chrome, even with pop-ups enabled. Chrome keeps clearing the whole screen with white 'paper', so no drawing gets done !

The Internet Explorer Browser doesn't even get that far..... So unless you have Firefox installed on your devices, no RECURSIVE animation seems possible.

This is bad news for my future 'QL program on any devices' projects, as Chrome is the common default browser.

But few programs use recursion, so I will attempt transcoding some more all the same.

Steve.

Koch4.zip
(1.69 KiB) Downloaded 86 times
( < < Only under FireFox ! )


stevepoole
Super Gold Card
Posts: 715
Joined: Mon Nov 24, 2014 2:03 pm

Re: Koch Fractals

Post by stevepoole »

Hi All,

Searching the correct keywords in a website tutorial demands that you know their JavaScript equivalents to S*Basic.

You can PAUSE a function using < ' Xit = setInterval( myfunction , delay ) >, then continue using < clearInterval( Xit ) >.

Knowing this, the animated Koch Fractals now work OK under FireFox, Chrome & InternetExplorer on any device !

My learning curve is gradually going up, and JavaScript seems full of potential, and is friendlier than C++.

In fact, transcoding from QL to JavaScript is getting to be quite comfortable... compared to say, Pascal.

That's all folks, for the Koch program. (Now onto another).

Steve.
Koch5.zip
(1.73 KiB) Downloaded 72 times


Post Reply