diff options
author | themaskedtaquito | 2022-11-16 19:26:59 +0000 |
---|---|---|
committer | GitHub | 2022-11-16 19:26:59 +0000 |
commit | e84294edd3859dd175ef1074f0ef5aa3e467f7fb (patch) | |
tree | 37cd868142af6f4fdf15f4bff23f6d7ad92453c1 | |
parent | 4bbc71a1e855d967d72e2d0aa1c9b699fe1be55a (diff) |
Add files via upload
-rw-r--r-- | entries/themaskedtaquito/fib.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/entries/themaskedtaquito/fib.js b/entries/themaskedtaquito/fib.js new file mode 100644 index 0000000..6708630 --- /dev/null +++ b/entries/themaskedtaquito/fib.js @@ -0,0 +1,26 @@ +//p5.js
+
+let fib1 = 0;
+let fib2 = 1;
+let loopNumber = 1;
+function setup() {
+ createCanvas(600, 600);
+ frameRate(3);
+}
+
+function draw() {
+ background(220);
+ fill('#'+str(hex(fib2)));
+ noStroke();
+ rect(50,70,500,500);
+ textSize(20);
+ text('#'+str(hex(fib2)),53,57);
+ fill(0);
+ text('Fibonacci ' +str(loopNumber) + ': '+ str(fib2),200,57);
+ fib2 = fib1 + fib2;
+ fib1 = fib2 - fib1;
+ loopNumber +=1;
+ if(fib2>420196140727489660){
+ noLoop();
+ }
+}
\ No newline at end of file |