diff options
author | Santo Cariotti <santo@dcariotti.me> | 2021-02-16 17:51:15 +0100 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2021-02-16 17:51:15 +0100 |
commit | 67438312a69f7b7aa1fdbc27610438897791ceef (patch) | |
tree | df5f6453cfd51ce24234a73d40d8fc028aa19089 /Year_2/IandM/nasdaq | |
parent | 73f04a63ffc0dd4c2956b6f455a93bb6d6f1fd14 (diff) |
i&m: add video exercise
Diffstat (limited to 'Year_2/IandM/nasdaq')
-rw-r--r-- | Year_2/IandM/nasdaq/README.md | 1 | ||||
-rw-r--r-- | Year_2/IandM/nasdaq/nasdaq.pde | 29 | ||||
-rw-r--r-- | Year_2/IandM/nasdaq/video.mp4 | bin | 0 -> 5700201 bytes |
3 files changed, 30 insertions, 0 deletions
diff --git a/Year_2/IandM/nasdaq/README.md b/Year_2/IandM/nasdaq/README.md new file mode 100644 index 0000000..5373998 --- /dev/null +++ b/Year_2/IandM/nasdaq/README.md @@ -0,0 +1 @@ +![video](video.mp4) diff --git a/Year_2/IandM/nasdaq/nasdaq.pde b/Year_2/IandM/nasdaq/nasdaq.pde new file mode 100644 index 0000000..aabc13e --- /dev/null +++ b/Year_2/IandM/nasdaq/nasdaq.pde @@ -0,0 +1,29 @@ +int x = 0; +int y = 500/2; + +void setup() { + size(500, 500); + frameRate(1000); + + line(x, y, x+10, y); + x = x+10; +} + +void draw() { + fill(255, 100); + x = x+1; + int ys = y+(int) random(-3, 3); + line(x, y, x+1, ys); + y = ys; + + if (x >= width) { + noStroke(); + rect(0, 0, width, height); + fill(255, 0, 0); + rectMode(RADIUS); + + rect(x-10, y-2, 10, 2); + x = 0; + stroke(0); + } +} diff --git a/Year_2/IandM/nasdaq/video.mp4 b/Year_2/IandM/nasdaq/video.mp4 Binary files differnew file mode 100644 index 0000000..719f384 --- /dev/null +++ b/Year_2/IandM/nasdaq/video.mp4 |