Solved

Fractals

Posted on 1997-08-16
4
202 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

Title # Comments Views Activity
send click   without cursor 6 379
Delphi XE, DataSnap, JSon and java 8 1,090
Extract small icon from a TMemoryStream or TIcon 3 723
Lazarus and Excel formulas via OLE 7 317
Facebook has became the #1 social media platform. People share many funny videos there, yet you don't know how to download them? Now you can download Videos from Facebook in just 3 simple steps.
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

749 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