Solved

Fractals

Posted on 1997-08-16
4
192 Views
Last Modified: 2010-04-16
Hi,

Does anybody have any source code (for turbo pascall) to create fractals and the likes of that type of thing.

Thanks.
0
Comment
Question by:farrier
  • 2
4 Comments
 
LVL 1

Expert Comment

by:barakp
Comment Utility
i'll attach to here tomorrow, 18.8.97
0
 

Accepted Solution

by:
DaveJ080797 earned 50 total points
Comment Utility
Heres a nice fractal, known as the plasma fractal.

Var
  A, B : Word;
  Average : Byte;

Function GetPixel(A, B) : Byte;
Begin
  GetPixel := Mem[$A000:A+(B*320];
End;

Begin
  Asm
     MOV AX, $13
     INT 10h            {320x200x256 mode}
  End;
  For A := 1 To 1000 Mem[$A000:Random(65535)] := Random(255);
Repeat
  For A := 1 To 320 Do For B := 1 To 200 Do
  Begin
    Average := (GetPixel(A - 1, B) + GetPixel(A - 1, B - 1) + GetPixel(A, B - 1)
    + GetPixel(A + 1, B - 1) + GetPixel(A + 1, B) + GetPixel(A + 1, B + 1) +
    GetPixel(A, B + 1) + GetPixel(A - 1, B + 1) + GetPixel(A - 1, B)) Div 8;
  End;
Until KeyPressed;
End.

This should work. Set the pallete to a nice gradient and you'll
have a lovely landscape. I've written this off the top of my head
so please mail me if it doesn't work properbly and you want to
know exactly how and why it works (It's basically an averaging
routine)
0
 

Author Comment

by:farrier
Comment Utility
Thanks a lot for taking your time to help me,
I really appreciate it, DaveJ !

Thanks again,

D. Farrier
0
 

Author Comment

by:farrier
Comment Utility
Thanks again!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
A procedure for exporting installed hotfix details of remote computers using powershell
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now