aboutsummaryrefslogtreecommitdiff
path: root/ALGORITHM.txt
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2022-11-09 17:12:04 -0500
committerB. Watson <urchlay@slackware.uk>2022-11-09 17:12:04 -0500
commit72e6cbfc6a4b4606f11a6d5285de65238dc0dbd4 (patch)
tree7abed0201fbfb1529c479b1d9f7bed4c77945f69 /ALGORITHM.txt
parent31e99ed8e4f83d98afb744fbc880b1c9685b556b (diff)
downloaddla-asm-72e6cbfc6a4b4606f11a6d5285de65238dc0dbd4.tar.gz
Added dla2csv, dla2img. Split up docs.
Diffstat (limited to 'ALGORITHM.txt')
-rw-r--r--ALGORITHM.txt24
1 files changed, 24 insertions, 0 deletions
diff --git a/ALGORITHM.txt b/ALGORITHM.txt
new file mode 100644
index 0000000..5b6e00b
--- /dev/null
+++ b/ALGORITHM.txt
@@ -0,0 +1,24 @@
+DLA Algorithm
+-------------
+
+The algorithm works like this:
+
+1. The initial "seed" pixels are drawn.
+
+2. Each particle starts on the edge of a circle whose center is the
+ center of the screen. The circle's radius depends on the number
+ of particles that have been rendered so far: radius is 15 for
+ particles 1 to 100, 30 for particles 101 to 300, 45 for particles
+ 301 to 600, and 75 for particles 601 and up.
+
+3. Walk the particle around randomly. For each step, pick a random one
+ of the 4 cardinal directions (no diagonals).
+
+4. If the particle goes "out of bounds" (see below), respawn it and
+ try again (without incrementing the particle counter).
+
+5. If the particle is ever adjacent to a set pixel, it gets stuck
+ there, the particle counter is incremented, and we go back to step 2.
+
+When the particle counter reaches the max (the number the user
+entered), the process is complete.