2020_10_15 #つぶやきProcessing #LSystem

#つぶやきProcessing
t=translate
s="A";d={"A":"B-A-B","B":"+ABA+"}
for i in range(6):
 b=""
 for c in s:b+=d.get(c,c)
 s=b
def setup():size(500,500)
def draw():
 t(250,250);background(-1);a=mouseX/79.
 for c in s:(c in"AB"and(line(0,0,9,0),t(9,0)))or rotate(a if c=="+"else-a)
main
Alexandre B A Villares 2020-10-26 00:32:17 -03:00
rodzic 282df7bdd2
commit 224aa0bfab
3 zmienionych plików z 29 dodań i 0 usunięć

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 569 KiB

Wyświetl plik

@ -0,0 +1,23 @@
# Inspired by https://twitter.com/ryotakob/status/1319998482283806720?s=20
#つぶやきProcessing
t=translate
s="A";d={"A":"B-A-B","B":"+ABA+"}
for i in range(6):
b=""
for c in s:b+=d.get(c,c)
s=b
def setup():size(500,500)
def draw():
t(250,250);background(-1);a=mouseX/79.
for c in s:(c in"AB"and(line(0,0,9,0),t(9,0)))or rotate(a if c=="+"else-a)
# #つぶやきProcessing
# r=rotate
# t=translate
# s="A";d={"A":"B-A-B","B":"C++B++C","C":"AFFCFFA"}
# for i in range(6):
# b=""
# for c in s:b+=d[c]if c in d else c
# s=b
# def setup():size(600,600);frameRate(9)
# def draw():t(300,300);background(-1);a=frameCount/20.;[line(0,0,4,0)or t(4,0)for c in s if not(c=="+" and not r(a))and not(c=="-" and not r(-a))]

Wyświetl plik

@ -26,6 +26,12 @@ Here are listed some of the tools I have been using:
---
![sketch_2020_10_25a](2020/sketch_2020_10_25a/sketch_2020_10_25a.gif)
[sketch_2020_10_25a](https://github.com/villares/sketch-a-day/tree/master/2020/sketch_2020_10_25a) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
---
![sketch_2020_10_24a](2020/sketch_2020_10_24a/sketch_2020_10_24a.png)
[sketch_2020_10_24a](https://github.com/villares/sketch-a-day/tree/master/2020/sketch_2020_10_24a) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]