Solved

Fractals

Posted on 1997-08-16
4
200 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Many businesses neglect disaster recovery and treat it as an after-thought. I can tell you first hand that data will be lost, hard drives die, servers will be hacked, and careless (or malicious) employees can ruin your data.
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

809 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