aboutsummaryrefslogtreecommitdiff
path: root/mandelbrot.c
diff options
context:
space:
mode:
authornic-gaffney <gaffney_nic@protonmail.com>2023-07-27 23:10:18 -0500
committernic-gaffney <gaffney_nic@protonmail.com>2023-07-27 23:10:18 -0500
commit1744d9dff4f372ed15dada6766a17b05c26e5f33 (patch)
tree53725c63230aa294a5a580981e529d06e84b3ea3 /mandelbrot.c
parentad85abc2db9ed35a2e3cf6ab18573de135ee9a5c (diff)
downloadsloth-1744d9dff4f372ed15dada6766a17b05c26e5f33.tar.gz
formatting
Diffstat (limited to 'mandelbrot.c')
-rw-r--r--mandelbrot.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/mandelbrot.c b/mandelbrot.c
deleted file mode 100644
index a6eff9e..0000000
--- a/mandelbrot.c
+++ /dev/null
@@ -1,32 +0,0 @@
-#include <stdio.h>
-
-int main() {
- float size = 800.0;
- float maxVal = 4.0;
- float maxIter = 50.0;
- float plane = 4.0;
- int x = 0;
- while (x < size) {
- int y = 0;
- while (y < size) {
- float cReal = (x * plane / size) - 2.0;
- float cImg = (y * plane / size) - 2.0;
- float zReal = 0.0;
- float zImg = 0.0;
- float count = 0.0;
- while ((zReal * zReal + zImg * zImg) <= maxVal && count < maxIter) {
- float temp = (zReal * zReal) - (zImg * zImg) + cReal;
- zImg = 2.0 * zReal * zImg + cImg;
- zReal = temp;
- count = count + 1;
- if (count == maxIter) {
- printf("\x1b[%d;%dH", x, y);
- printf("█");
- }
- }
- y = y + 1;
- }
- x = x + 1;
- }
- return 0;
-}