diff --git a/s244/s244.pyde b/s244/s244.pyde index 0e2c71b1..e9ec9237 100644 --- a/s244/s244.pyde +++ b/s244/s244.pyde @@ -15,9 +15,7 @@ def keyPressed(): for i in range(n): curvas.append((random(-height/4,height/4), random(-height/4, height/4), - random(.2, 5), - random(.2, 5), - random(.2, 5), + random(.2, 5) )) saveFrame(SKETCH_NAME+OUTPUT) @@ -26,16 +24,16 @@ def draw(): background(0) translate(0, height/2) for x in range(width): - for h, a, f1, f2, f3 in curvas: + for h, a, f in curvas: ang = x / 30. - if int(a) % 3 == 0: + if int(f) % 3 == 0: stroke(255, 0, 0) - elif int(a) % 3 == 1: + elif int(f) % 3 == 1: stroke(0, 255, 0) else: stroke(0, 0, 255) - s = sin(ang * f1) + sin(ang * f2) + sin(ang * f3) - line(x, 0, x, h+ s * a) + s = sin(ang * f) * a + line(x, 0, x, h + s) def settings(): diff --git a/s245/s245.png b/s245/s245.png new file mode 100644 index 00000000..f6aa71d6 Binary files /dev/null and b/s245/s245.png differ diff --git a/s245/s245.pyde b/s245/s245.pyde index 7ef7e02f..10dd1a9e 100644 --- a/s245/s245.pyde +++ b/s245/s245.pyde @@ -1,3 +1,7 @@ +# Alexandre B A Villares - https://abav.lugaralgum.com/sketch-a-day +SKETCH_NAME = "s245" # 20180831 +OUTPUT = ".png" + curvas = [] n = 6 @@ -15,6 +19,8 @@ def keyPressed(): random(.2, 5), random(.2, 5), )) + saveFrame(SKETCH_NAME+OUTPUT) + def draw(): background(0) @@ -30,3 +36,16 @@ def draw(): stroke(0, 0, 255) s = sin(ang * f1) + sin(ang * f2) + sin(ang * f3) line(x, 0, x, h+ s * a) + +def settings(): + print_text_for_readme(SKETCH_NAME, OUTPUT) + +def print_text_for_readme(name, output): + """ prints text in the console to add to project README.md """ + println(""" +![{0}]({0}/{0}{2}) + +{1}: [code](https://github.com/villares/sketch-a-day/tree/master/{0}) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)] + +""".format(name, name[1:], output) + )