This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let bint2bin = (bint) => { | |
| let bintarr = bint.split(" "); // puts the string of numbers seperated by spaces into an array | |
| let togg = false; // toggles whether the number means 0 or 1 (false is 0, true is 1) | |
| let result = ""; // the string we will put all the binary numbers into | |
| for (let i = 0; i < bintarr.length; i++) { | |
| let str = ""; // string of 0s or 1s to add to result | |
| for (let n = 0; n < parseInt(bintarr[i]); n++) { | |
| if (togg) { | |
| str += "1"; // adds a 1 to str | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| IIC.onChat((id,n,m) => { | |
| if (n !== "Name") { | |
| switch (m) { | |
| case "hello": | |
| say("Hello there!"); | |
| break; | |
| } | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var refreshRate = 100; var particleLimit = 15; | |
| var snake = { | |
| x: (window.innerWidth * Math.random()) - window.pageXOffset, | |
| y: (window.innerHeight * Math.random()) - window.pageYOffset, | |
| dx: Math.ceil(Math.random() * 30) - 15, | |
| dy: Math.ceil(Math.random() * 30) - 15, | |
| atan2: Math.atan2(this.dx, this.dy) + (Math.PI / 2), body: [], | |
| update: function () { | |
| if (this.x < 0) { this.x = 0; this.dx = -this.dx;} | |
| else if (this.x > window.innerWidth) { this.x = window.innerWidth; this.dx = -this.dx; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function () { var refreshRate = 100; var particleLimit = 15; var snake = { x: (window.innerWidth * Math.random()) - window.pageXOffset, y: (window.innerHeight * Math.random()) - window.pageYOffset, dx: Math.ceil(Math.random() * 30) - 15, dy: Math.ceil(Math.random() * 30) - 15, atan2: Math.atan2(this.dx, this.dy) + (Math.PI / 2), body: [], update: function () { // IIC.setAngle(Math.ceil(Math.random() * 360) * Math.PI / 180); if (this.x < 0) { this.x = 0; this.dx = -this.dx; } else if (this.x > window.innerWidth) { this.x = window.innerWidth; this.dx = -this.dx; } if (this.y < 0) { this.y = 0; this.dy = -this.dy; } else if (this.y > window.innerHeight) { this.y = window.innerHeight; this.dy = -this.dy; } var ddx = (this.dx + ((Math.random() * 10) - 5)); var ddy = (this.dy + ((Math.random() * 10) - 5)); this.x = this.x + ddx; this.y = this.y + ddy; this.atan2 = M |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // MultiPlayerPiano.com | |
| // Paste into JS Console: | |
| var currentchord = 0; | |
| var c = ["c3","e3","g3"]; | |
| var em = ["b3","e3","g3"]; | |
| var am = ["a3","c3","e3"]; | |
| var f = ["a3","c3","f3"]; | |
| var song = [c,em,am,f]; | |
| window.addEventListener("keyup", function (e) {if (e.keyCode==32) {MPP.press(song[currentchord][0],1);MPP.press(song[currentchord][1],1);MPP.press(song[currentchord][2],1);}}); | |
| setInterval(function(){currentchord++;if(currentchord==4){currentchord=0}},2000) |
NewerOlder