summaryrefslogtreecommitdiff
path: root/miniany/test4.c
diff options
context:
space:
mode:
Diffstat (limited to 'miniany/test4.c')
-rw-r--r--miniany/test4.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/miniany/test4.c b/miniany/test4.c
new file mode 100644
index 0000000..6ec750e
--- /dev/null
+++ b/miniany/test4.c
@@ -0,0 +1,19 @@
+/* test4: test floats and draw an ASCII mandelbrot
+ from: https://miyuki.github.io/2017/10/04/gcc-archaeology-1.html
+ (original authorship missing) */
+
+int main( )
+{
+ float r, i, R, I, b;
+ int n;
+
+ for( i = -1; i < 1; i += .06, putnl( ) ) {
+ for( r = -2; I = i, (R = r) < 1; r += .03, putchar( n + 31 ) ) {
+ for( n = 0; b = I * I, 26 > n++ && R * R + b < 4;
+ I = 2 * R * I + i, R = R * R - b + r );
+ }
+ }
+
+ exit( EXIT_SUCCESS );
+}
+