Solved

Fractals

Posted on 1997-08-16
4
205 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Why do some people recommend buying business VoIP from an ISP? What are the benefits to my company? What are the costs?
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

615 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