tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
19
Task/Brownian-tree/PicoLisp/brownian-tree.l
Normal file
19
Task/Brownian-tree/PicoLisp/brownian-tree.l
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
(load "@lib/simul.l")
|
||||
|
||||
(de brownianTree (File Size Cnt)
|
||||
(let Img (grid Size Size)
|
||||
(put Img (/ Size 2) (/ Size 2) 'pix T)
|
||||
(use (P Q)
|
||||
(do Cnt
|
||||
(setq P (get Img (rand 1 Size) (rand 1 Size)))
|
||||
(loop
|
||||
(setq Q ((if2 (rand T) (rand T) north east south west) P))
|
||||
(T (; Q pix) (put P 'pix T))
|
||||
(setq P (or Q (get Img (rand 1 Size) (rand 1 Size)))) ) ) )
|
||||
(out "img.pbm"
|
||||
(prinl "P1")
|
||||
(prinl Size " " Size)
|
||||
(for L Img
|
||||
(for This L
|
||||
(prin (if (: pix) 1 0)) )
|
||||
(prinl) ) ) ) )
|
||||
Loading…
Add table
Add a link
Reference in a new issue