diff options
author | themaskedtaquito | 2022-11-14 19:33:51 +0000 |
---|---|---|
committer | GitHub | 2022-11-14 19:33:51 +0000 |
commit | 70356358f69632b4384313d55037c1fab6677c3e (patch) | |
tree | 7a01395e842e6469e924cba98d8c964bbbb94f69 /entries/Mari/fib.js | |
parent | 6e7238a32e858ba0f297d65f66cd118434bc9d6a (diff) |
Add files via upload
Add Mari's entry
Diffstat (limited to 'entries/Mari/fib.js')
-rw-r--r-- | entries/Mari/fib.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/entries/Mari/fib.js b/entries/Mari/fib.js new file mode 100644 index 0000000..6708630 --- /dev/null +++ b/entries/Mari/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 |