]> gitweb.factorcode.org Git - factor.git/commitdiff
fix mandel.factor
authorSlava Pestov <slava@factorcode.org>
Fri, 27 Aug 2004 03:11:46 +0000 (03:11 +0000)
committerSlava Pestov <slava@factorcode.org>
Fri, 27 Aug 2004 03:11:46 +0000 (03:11 +0000)
TODO.FACTOR.txt
contrib/mandel.factor

index b6cacd1dd572d285e98e6c02687934f3268d1b5c..7202a609b633c8496adfd101bc6dad0a34068ea8 100644 (file)
@@ -38,6 +38,7 @@
 - FactorLib.equal() not very good\r
 - do nset-nth, nremove-nth, nsubstitute, ninject\r
 - IN: format base: work with all types of numbers\r
+- investigate mandel.factor\r
 \r
 + listener/plugin:\r
 \r
index 7db6c076d8ef9133c6ea309ed307a3807e611d61..fa48a2c7e80b4cd49c347127c0ac5e32d4d09970 100644 (file)
@@ -13,7 +13,6 @@
 !                (princ (code-char c))))
 !        (format t "~%"))
 
-USE: arithmetic
 USE: combinators
 USE: math
 USE: prettyprint
@@ -28,14 +27,14 @@ USE: strings
         r> f
     ] ifte ;
 
-: mandel-step ( a z c -- )
-    [ ?mandel-step ] [ ] while nip nip ;
+: mandel-step ( a z c -- )
+    [ ?mandel-step ] [ ] while >char write 2drop ;
 
 : mandel-x ( x y -- )
-    rect> dup CHAR: ~ mandel-step >char write ;
+    rect> dup CHAR: ~ mandel-step ;
 
 : mandel-y ( y -- )
-    75 [ dupd 25 / 2 - swap mandel-x ] times* drop terpri ;
+    75 [ dupd 25 / 2 - >float swap mandel-x ] times* drop ;
 
 : mandel ( -- )
-    21 [ 10 / 1 - mandel-y ] times* ;
+    21 [ 10 / 1 - >float mandel-y terpri ] times* ;