diff options
author | Santo Cariotti <santo@dcariotti.me> | 2021-02-22 16:43:59 +0100 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2021-02-22 16:43:59 +0100 |
commit | cf228fd6b77a0efbdd4846d41a436663f2ae7eb1 (patch) | |
tree | 2a7925381091825982b65b3d8cff4a46830090d9 /Year_2/IandM/elettrocardio | |
parent | 020ac5aa148c2e70aa34fb798dbbe9b8778f32a0 (diff) |
i&m: gif exercises
Diffstat (limited to 'Year_2/IandM/elettrocardio')
-rw-r--r-- | Year_2/IandM/elettrocardio/elettrocardio.mov | bin | 0 -> 427077 bytes | |||
-rw-r--r-- | Year_2/IandM/elettrocardio/elettrocardio.pde | 43 |
2 files changed, 43 insertions, 0 deletions
diff --git a/Year_2/IandM/elettrocardio/elettrocardio.mov b/Year_2/IandM/elettrocardio/elettrocardio.mov Binary files differnew file mode 100644 index 0000000..f50c0a8 --- /dev/null +++ b/Year_2/IandM/elettrocardio/elettrocardio.mov diff --git a/Year_2/IandM/elettrocardio/elettrocardio.pde b/Year_2/IandM/elettrocardio/elettrocardio.pde new file mode 100644 index 0000000..293a5ad --- /dev/null +++ b/Year_2/IandM/elettrocardio/elettrocardio.pde @@ -0,0 +1,43 @@ +int x = 0; +int y = 250; +int j = 0; +int ys = 250; +int xs = 0; +int st = 0; +void setup() { + size(500, 500); + background(#015B6C); +} + +void draw() { + if (x >= width) { + background(#015B6C); + x = 0; + } + + stroke(#1AFF3E); + strokeWeight(3); + if (j < 50) { + line(x, y, x++, y); + } else { + if (st == 0) { + ys = ys-(int) random(10, 70); + line(x, y, x+=5, ys); + st++; + y = ys; + } else if (st == 1) { + ys = y+(int) random(75, 130); + line(x, y, x+=5, ys); + st++; + y = ys; + } else { + line(x, y, x+=3, height/2); + y = height/2; + st = 0; + j = 0; + ys = y; + } + } + + ++j; +} |