fix mandel.factor

cvs
Slava Pestov 2004-08-27 03:11:46 +00:00
parent 8b8741d262
commit a42442364a
2 changed files with 6 additions and 6 deletions

View File

@ -38,6 +38,7 @@
- FactorLib.equal() not very good - FactorLib.equal() not very good
- do nset-nth, nremove-nth, nsubstitute, ninject - do nset-nth, nremove-nth, nsubstitute, ninject
- IN: format base: work with all types of numbers - IN: format base: work with all types of numbers
- investigate mandel.factor
+ listener/plugin: + listener/plugin:

View File

@ -13,7 +13,6 @@
! (princ (code-char c)))) ! (princ (code-char c))))
! (format t "~%")) ! (format t "~%"))
USE: arithmetic
USE: combinators USE: combinators
USE: math USE: math
USE: prettyprint USE: prettyprint
@ -28,14 +27,14 @@ USE: strings
r> f r> f
] ifte ; ] ifte ;
: mandel-step ( a z c -- c ) : mandel-step ( a z c -- )
[ ?mandel-step ] [ ] while nip nip ; [ ?mandel-step ] [ ] while >char write 2drop ;
: mandel-x ( x y -- ) : mandel-x ( x y -- )
rect> dup CHAR: ~ mandel-step >char write ; rect> dup CHAR: ~ mandel-step ;
: mandel-y ( y -- ) : mandel-y ( y -- )
75 [ dupd 25 / 2 - swap mandel-x ] times* drop terpri ; 75 [ dupd 25 / 2 - >float swap mandel-x ] times* drop ;
: mandel ( -- ) : mandel ( -- )
21 [ 10 / 1 - mandel-y ] times* ; 21 [ 10 / 1 - >float mandel-y terpri ] times* ;