tkych / cl-spark

(spark '(1 1 2 3 5 8)) => "▁▁▂▃▅▇"
MIT License
95 stars 4 forks source link

Spark 3D #4

Open wpasieka opened 4 years ago

wpasieka commented 4 years ago

Hello : ),

I am wondering how to write a drawings like these ones in Spark: http://aa-project.sourceforge.net/gallery/

The question comes from an observation that the quality of the ascii in REPL seems to be much better than in this online Art. So we could draw a better pictures in REPL.

And how could we achieve the 3D impressions in Spark/REPL?

https://www.reddit.com/r/programming/comments/2v7e6a/rendering_3d_scenes_as_ascii_art_in_a_command/

;;---------

I am trying to write some package which ommitts the X-Windows or the CLX.

The 2D format works, I have but started considering writing the 3D format:

(login: oms pass: oms) - scan at the bottom. https://www.pressiton.com/ines3/?module=press_xai_voting

The function on the scan is simple:

 (DEFUN draw-analysis ()
  (LET* ( (*print-right-margin* 1000))
;;(DO ((z 0 (+ 1 z))) ((> z *depth*))   (PROGN (FRESH-LINE) ;; (PRINC "/")
  (DO ((y 0 (+ 1 y))) ((> y *height*))  (PROGN (FRESH-LINE)  (PRINC "|")
  (DO ((x 0 (+ 1 x))) ((> x *width*))   (PRINC (COND ((SOME (LAMBDA (animal)
                                                   (AND (= (animal-x animal) x)
                                                        (= (animal-y animal) y)
                                                     ;; (= (animal-y animal) z)
                                                        ))   *animals*)    #\M)
                                                     ((GETHASH (CONS x y) *plants*) #\*)
                                                      (t #\SPACE))))  (PRINC "|")))  ));;DEFUNx

The z-axis is turned off, because I don't know how to see a "depth" in REPL.

;;-----------

Maybe You could advise how to make the 3D format in Spark or generally in REPL? Thank You.