diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index b6cacd1dd5..7202a609b6 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -38,6 +38,7 @@ - FactorLib.equal() not very good - do nset-nth, nremove-nth, nsubstitute, ninject - IN: format base: work with all types of numbers +- investigate mandel.factor + listener/plugin: diff --git a/contrib/mandel.factor b/contrib/mandel.factor index 7db6c076d8..fa48a2c7e8 100644 --- a/contrib/mandel.factor +++ b/contrib/mandel.factor @@ -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 -- 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* ;