about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--js/mandelbrot/index.html2
-rw-r--r--picat/fib.pi18
2 files changed, 19 insertions, 1 deletions
diff --git a/js/mandelbrot/index.html b/js/mandelbrot/index.html
index 23ad2cb..ed220a6 100644
--- a/js/mandelbrot/index.html
+++ b/js/mandelbrot/index.html
@@ -6,7 +6,7 @@
     <title>Mandelbrot</title>
 </head>
 <body>
-    <canvas id="mandelbrot" width="800" height="800"></canvas>
+    <canvas id="mandelbrot" width="1000" height="1000"></canvas>
     <script src="mb.js"></script>
 </body>
 </html>
\ No newline at end of file
diff --git a/picat/fib.pi b/picat/fib.pi
new file mode 100644
index 0000000..2f852cd
--- /dev/null
+++ b/picat/fib.pi
@@ -0,0 +1,18 @@
+main =>
+S = 0,
+    I = 1,
+    F = fib(I),
+    while (F <= 4000000)
+        if (F mod 2 == 0) then
+            S := S+F
+        end,
+        I := I+1,
+        F := fib(I)
+    end,
+    printf("Sum of the even-valued terms is %w%n",S).
+main([A1]) =>
+    printf("fib(%s)=%w%n",A1,A1.to_integer().fib()).
+table
+fib(1) = 1.
+fib(2) = 2.
+fib(N) = fib(N-1)+fib(N-2).
\ No newline at end of file