๐ฆ | |||||||||||||||
๐๐ฝ๐๐ฟ | ๐ฌ๐ฑ | ๐ฅฆ | ๐ชต | ||||||||||||
๐ | ๐ฆข๐ฆข๐ฆญ | ๐๐ | ๐ | ๐ชท๐ฒ | ๐ | ||||||||||
๐ท | ๐ฆ | ๐ซ | ๐ฆ | ๐ฅฅ๐ฆข | ๐ชฐ | ๐ก๐ฅ | ๐ฅ | ||||||||
๐น | ๐ | ๐ชณ | ๐พ | ๐ฆญ | ๐ฃ | ๐ณ | |||||||||
๐ฆ | ๐ | ๐ฅฆ๐ฑ๐ฆ๐ชฑ | ๐ธ | ๐ชณ | ๐๐ซ | ๐ | |||||||||
๐๐ | ๐ | ๐๐๐ท๐ฑ | ๐ป๐ | ๐ฅ | |||||||||||
๐ง | ๐ | ๐ | ๐ฃ๐ |
Let us begin taking NicCLIM more practically. And make a life-filled ASCII table element for this siteโs banner. This also moves towards a general theory of automata for our NicCLIM spacetime-box tiles.
I guess https://lispy-gopher-show.itch.io/nicclim links us to https://screwlisp.small-web.org/lispgames/trying-nicclim-v2/ for advice on what to do. Iโll eww
into that in emacs. By the way, eww
+ Eduardoโs eev-mode
is great- navigate a site, tap f8
on the ee-bullet lines I wasa looking forโฆ
On that webpage, I tapped f8 on
โข (setq inferior-lisp-program "ecl")
โข (slime)
โข (setq eepitch-buffer-name "*slime-repl ECL*")
(ensure-directories-exist #p"~/GAME/")
(uiop:chdir "~/GAME/")
(uiop:chdir "~/GAME/")
;; I guess I forgot the critical lines!
(ql:quickload :mcclim)
(compile-file "~/Downloads/nicclim.lisp" :load t)
;; Which we downloaded from my first link, and
(in-package :nicclim)
since I guess this is my conventional working directory, and the lisp imageโs purpose is to be running NicCLIM.
spacetime-box
Remembering that we are borrowing spacetime from Olum for our distributed game spacetime volumes and time evolution.
(rect-file "NATURE" 16 8 ())
spacetime-box
(defparameter *box* (make-instance 'spacetime-box))
(with-slots
(dims times.contentses insward-facets)
*box*
(setf dims '(16 8 1)
times.contentses '((0 nature))
inward-facets
`((
((0 15) (0 7) (0 0))
(0 0 0)
,*box*)
))
)
that seems like it calls for a lot of polish, but I have not decided what that polish would be like yet. Hence just directly exposing the spacetime-box
instanceโs slots. It seems like a spacetime box could be created solely with a list of layers that would be inside it, or even a formula for creating new layers to put inside it. Not the topic right now though.
nature
layer for editing with NicCLIM(enclose-map "NATURE")
this is a great starting point and all, but let us switch to
(defvar *some-characters* "๐ชด๐ณ๐๐ฒ๐ดโธ๐๐ฅฌ๐ฅ๐ฅฆ๐๐๐๐๐๐๐๐ต๐ฟ๐ฅ๐ฅ๐ฅ๐๐๐๐๐ชต๐ฅ๐ซ๐ซ๐ ๐๐ฅฅ๐๐๐ฅ๐ชท๐๐๐๐ฅ๐พ๐ฝ๐นโ๐ฎ๐๐๐ฅ๐ถ๐ต๐ฑ๐ป๐ท๐ซ๐๐ชฑ๐ฆ๐ชฒ๐๐ชฐ๐๐๐ฆ๐ท๐ฆ๐ฆ๐ชณ๐๐๐ฆ๐ธ๐ฆ๐ง๐ฅ๐ฆ๐ฆ
๐๐๐ฆ๐ฆข๐ค๐ฃ๐ฆ๐๐ง๐ฆ๐ฆซ๐ฆฉ๐ฆ๐ฆค๐ก๐โ๐ฅ๐ฃ๐ ๐ฆ๐ฆซ๐โฅฟ๐๐ฆ๐๐ฆญ๐๐ฌ๐ชธ๐ฆ")
(require :bordeaux-threads)
(bt:make-thread
(lambda () (enclose-map "NATURE")))
(loop
:with n-clusters := (random #o30)
:with current-n := 0
:with x := 0
:with y := 0
:with (xlim ylim zlim) := (slot-value *box* 'dims)
:while (< current-n n-clusters) :do
(loop
:with d := 5
:with -d/2 := (-(truncate 5 2))
:with no-chars := (length *some-characters*)
:for sym := (make-symbol
(let ((idx (random no-chars)))
(subseq *some-characters*
idx (1+ idx))))
:for m := 0
:for dx := (+ -d/2 (random d))
:for dy := (+ -d/2 (random d))
:for new-x := (+ x dx)
:for new-y := (+ y dy)
:when (and (< 0 new-x xlim)
(< 0 new-y ylim))
:do (multiple-value-setq
(x y)
(values new-x new-y))
(incf m)
(block insert-symbol
(loop
:for cmd :in `((set-cur1 ,sym)
(jump ,new-x ,new-y)
(push-cur1))
:do
(execute-frame-command
*nic* ; from enclose-map
cmd)
(sleep 1)))
:while (< m current-n)
:finally (incf current-n)))
The gif is quite boring, because McCLIM focuses on frequently used, language unicode symbols and doesnโt render almost all of these emojis.
What I did, when I realised that it was going to be a while before it stopped on its own was C-c C-c
in my emacs repl, followed by:
(bt:all-threads)
;; the new application-frame thread was the first thread
(bt:destroy-thread (first *))
ABORT
and then
(execute-frame-command *nic* '(com-writef nature))
to salvage the situation.
Literally, NATURE
is now
NIC> (execute-frame-command *nic* '(log-map))
(#:๐ฆ) NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL
NIL NIL (#:๐ #:๐ฝ #:๐ #:๐ฟ) (#:๐ฌ #:๐ฑ) NIL NIL NIL NIL NIL NIL NIL NIL (#:๐ฅฆ) NIL NIL (#:๐ชต)
NIL (#:๐) (#:๐ฆข #:๐ฆข #:๐ฆญ) (#:๐ #:๐) NIL NIL NIL NIL NIL NIL NIL NIL NIL (#:๐) (#:๐ชท
#:๐ฒ) (#:๐)
NIL NIL (#:๐ท) (#:๐ฆ) NIL NIL NIL NIL NIL NIL (#:๐ซ) (#:๐ฆ) (#:๐ฅฅ #:๐ฆข) (#:๐ชฐ) (#:๐ก
#:๐ฅ) (#:๐ฅ)
NIL (#:๐น) NIL (#:๐) (#:๐ชณ) (#:๐พ) (#:๐ฆญ) NIL NIL NIL NIL NIL (#:๐ฃ) (#:๐ณ) NIL NIL
NIL NIL (#:๐ฆ) (#:๐) (#:๐ฅฆ #:๐ฑ #:๐ฆ #:๐ชฑ) NIL NIL NIL (#:๐ธ) (#:๐ชณ) (#:๐ #:๐ซ) NIL NIL NIL (#:๐) NIL
NIL NIL NIL NIL NIL NIL NIL NIL (#:๐ #:๐) (#:๐) NIL NIL (#:๐ #:๐ #:๐ท #:๐ฑ) (#:๐ป
#:๐) (#:๐ฅ) NIL
NIL NIL NIL (#:๐ง) (#:๐) NIL (#:๐) NIL NIL NIL NIL NIL NIL (#:๐ฃ #:๐) NIL NIL
Which I guess we would like to turn into
(slot-value *nic* 'table-list)
(loop
:initially (princ "<table>")
:repeat (length *)
:for row :in * :do
(fresh-line)
(loop
:initially (princ " <tr>") :do
(loop :for cell :in row :do
(princ "<td>")
(mapc 'princ cell)
(princ "</td>"))
(loop-finish)
:finally (princ "</tr>"))
:finally (terpri) (princ "</table>"))
Soo
๐ฆ | |||||||||||||||
๐๐ฝ๐๐ฟ | ๐ฌ๐ฑ | ๐ฅฆ | ๐ชต | ||||||||||||
๐ | ๐ฆข๐ฆข๐ฆญ | ๐๐ | ๐ | ๐ชท๐ฒ | ๐ | ||||||||||
๐ท | ๐ฆ | ๐ซ | ๐ฆ | ๐ฅฅ๐ฆข | ๐ชฐ | ๐ก๐ฅ | ๐ฅ | ||||||||
๐น | ๐ | ๐ชณ | ๐พ | ๐ฆญ | ๐ฃ | ๐ณ | |||||||||
๐ฆ | ๐ | ๐ฅฆ๐ฑ๐ฆ๐ชฑ | ๐ธ | ๐ชณ | ๐๐ซ | ๐ | |||||||||
๐๐ | ๐ | ๐๐๐ท๐ฑ | ๐ป๐ | ๐ฅ | |||||||||||
๐ง | ๐ | ๐ | ๐ฃ๐ |
That was pretty great. I should keep making those latin squares from before as well.
See you on the Mastodon thread please.
Share where and how occurs to you and as you like.
screwlisp proposes kittens