[A86] Re: Escape Time Algorithm


[Prev][Next][Index][Thread]

[A86] Re: Escape Time Algorithm




There is a simple algorithm that is very similar to this, although it isn't
an escape time algorithm. It should run much faster and is much easier to
convert to assembly. Here's the basic code:

ClDrw
60\->\M
For(A,1,M
For(B,1,M
If A and B:PxOn(B,A
End
End

Interesting how a simple and operation creates a Sierpinski-like triangle...

Mike

----- Original Message -----
From: <Appelkore@aol.com>
To: <assembly-86@lists.ticalc.org>
Sent: Sunday, 01 April, 2001 21:55
Subject: [A86] Escape Time Algorithm

> I'm having trouble with this code I wrote to generate a 60x60 picture
based
> on an escape time algorithm. I copied the BASIC code from a book, and it
> works fine (although it took hours to finish drawing the picture). My asm
> code draws a full column (8 pixels wide by 60 pixels tall) of the desired
> picture, then goes back over the same area very slowly, drawing all black
> pixels, then advances to the next 8-pixels-wide column and does the same
> thing. Why should it be doing that? Help!
>
> By the way, the desired picture is basically an inverted and tilted
> Sierpinski triangle. Remember, though, that this is not the method shown
in
> the calc manuals; there is no randomness in this method whatsoever.
>
> Here's the basic code. I've attached a picture (.86i) to this email so you
> can see what the finished thing looks like without waiting for it to be
> drawn. (The attached file also contains the basic .86p and the .asm
source.)
>
> <tt>
>
> PROGRAM:ETA
> 20\->\NUMITS
> 0\->\A
> 0\->\B
> 1\->\C
> 1\->\D
> 60\->\M
> 120\->\R
> ClDrw
> For(P,1,M)
>    For(Q,1,M)
>       A+(C-A)*P/M\->\X
>       B+(D-B)*Q/M\->\Y
>       For(N,1,NUMITS)
>          If Y>.5:Then
>             2X\->\X
>             2Y-1\->\Y
>          Else
>             If X>.5:Then
>                2X-1\->\X
>                2Y\->\Y
>             Else
>                2X\->\X
>                2Y\->\Y
>             End
>          End
>          If X^2+Y^2>R:Then
>             PxOn(Q,P)
>             NUMITS\->\N
>          End
>       End
>    End
> End
>
> </tt>
>






References: