aboutsummaryrefslogtreecommitdiff
path: root/ALGORITHM.txt
diff options
context:
space:
mode:
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.