Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Spiral-matrix/PicoLisp/spiral-matrix.l
Normal file
19
Task/Spiral-matrix/PicoLisp/spiral-matrix.l
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
(load "@lib/simul.l")
|
||||
|
||||
(de spiral (N)
|
||||
(prog1 (grid N N)
|
||||
(let (Dir '(north east south west .) This 'a1)
|
||||
(for Val (* N N)
|
||||
(=: val Val)
|
||||
(setq This
|
||||
(or
|
||||
(with ((car Dir) This)
|
||||
(unless (: val) This) )
|
||||
(with ((car (setq Dir (cdr Dir))) This)
|
||||
(unless (: val) This) ) ) ) ) ) ) )
|
||||
|
||||
(mapc
|
||||
'((L)
|
||||
(for This L (prin (align 3 (: val))))
|
||||
(prinl) )
|
||||
(spiral 5) )
|
||||
Loading…
Add table
Add a link
Reference in a new issue