Solved

Fractals

Posted on 1997-08-16
4
198 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
ID: 1215432
i'll attach to here tomorrow, 18.8.97
0
 

Accepted Solution

by:
DaveJ080797 earned 50 total points
ID: 1215433
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
ID: 1215434
Thanks a lot for taking your time to help me,
I really appreciate it, DaveJ !

Thanks again,

D. Farrier
0
 

Author Comment

by:farrier
ID: 1215435
Thanks again!
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you thought ransomware was bad, think again! Doxware has the potential to be even more damaging.
Google always has something new and amazing up its sleeve, and the most current thing that they have been working on is another step in the evolution of Google Search, from machine learning to its brilliant successor, deep learning.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 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