Skip to content

Instantly share code, notes, and snippets.

@zamfi
zamfi / champagne.js
Last active October 5, 2017 17:25 — forked from anonymous/champagne.js
var circles = [];
function setup() {
createCanvas(400, 400);
var count = 0;
while (count < 20) {
circles.push({
x: random(width),
y: height,
vx: 0,
int trumpFactor;
void setup() {
size(500, 500);
}
void draw() {
background(255);
translate(width/2, height/2);
var x = [];
var y = [];
var xSpeed = [];
var ySpeed = [];
var colors = [];
function setup() {
createCanvas(400, 400);
for (var index = 0; index < 100; index = index + 1) {
var circles = [];
function setup() {
createCanvas(400, 400);
for (var index = 0; index < 100; index = index + 1) {
circles[index] = {
x: width / 2,
y: height / 2,
xSpeed: random(-5, 5),
@zamfi
zamfi / pong.js
Created February 22, 2018 23:49
Pong!
var puck = {
x: 200,
y: 200,
xSpeed: 3,
ySpeed: -1,
r: 15
};
var edgeOffset = 20;
var player1 = {
<html>
<head>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="tracery.js"></script>
<title>Text Generator</title>
</head>
<body>
<button onclick="addNewTrace()">One more!</button>
<div id="main"></div>
class Blinker {
public:
Blinker(int pin, float periodSeconds, float onSeconds = 0.5, float delayUntilStart = 0.0) {
this->pin = pin;
period = periodSeconds * 1000;
onTime = onSeconds * 1000;
offset = delayUntilStart * 1000;
nextOn = millis() + offset;
pinMode(pin, OUTPUT);
}
-ENDMESSAGE- because it :: 0.8181818181818182 (9:2)
-ENDMESSAGE- mile :: 0.18181818181818182 (2:9)
-ENDMESSAGE- thank you :: 0.7692307692307693 (10:3)
able to :: 0.7692307692307693 (10:3)
all agree :: 0.14285714285714285 (2:12)
all agree -ENDMESSAGE- :: 0.09090909090909091 (1:10)
average :: 0.21739130434782608 (5:18)
be able :: 0.8181818181818182 (9:2)
be able to :: 0.8181818181818182 (9:2)
be around :: 0.23076923076923078 (3:10)
var poses = [
{
"nose": {
"x": 333.79916958873963,
"y": 281.8711811385424,
"confidence": 0.9843198657035828
},
"leftEye": {
"x": 385.9717814127604,
"y": 245.32875046163042,
@zamfi
zamfi / hues-array.js
Last active September 13, 2020 04:39
var hues = [14,134,13,65,134,243,95,68,345];
colorMode(HSB);
noStroke();
for (var i = 0; i < hues.length; i += 1) {
fill(hues[i], 100, 100);
ellipse(20+i * 30, height/2, 15);
}