Guide for pushing p5.js sketch folder to a new GitHub repo
If you have never used git before on your computer!
$ git config --global user.name username
$ git config --global user.email email@email.com
10 REM POKE 230,32 : REM page 1 | |
20 REM POKE 230,64 : REM page 2 | |
30 REM POKE 49236,0 : REM display page 1 | |
40 REM POKE 49237,0 : REM display page 2 | |
100 HGR:HGR2 | |
105 W = 140 : H = 90 : SL = 50 | |
110 TH = 0 | |
120 SCR = 0 | |
125 GOSUB 1000 |
function setup() { | |
createCanvas(400, 400); | |
const url = 'https://www.random.org/integers/?num=10&min=2&max=1316&col=1&base=10&format=plain&rnd=new'; | |
loadStrings(url, gotData); | |
function gotData(data) { | |
console.log(data); | |
} | |
} |
Falling Sand | |
K-d Tree | |
Fast Blur | |
Slime Mold | |
Spider Web | |
K-means | |
image stippling | |
Wave collapse function | |
Skyline Viz | |
Dancing Skeleton |
function setup() { | |
noCanvas(); | |
let button = createButton('start'); | |
button.mousePressed(function() { | |
let speech = new p5.Speech(); | |
let speechRec = new p5.SpeechRec('en-US', gotSpeech); | |
let continuous = true; | |
let interim = false; | |
speechRec.start(continuous, interim); |
$ git config --global user.name username
$ git config --global user.email email@email.com
import java.math.BigDecimal; | |
import java.math.BigInteger; | |
import java.math.MathContext; | |
int digits = 11; | |
MathContext mc = new MathContext(digits*digits + 1); | |
BigDecimal c = new BigDecimal(0.25); | |
BigDecimal hundred = new BigDecimal(100); | |
BigDecimal e = BigDecimal.ONE.divide(hundred.pow(digits-1), mc); | |
BigDecimal z = BigDecimal.ZERO; |
// Without Promises | |
setTimeout(function() { | |
console.log('first thing'); | |
setTimeout(function() { | |
console.log('then second'); | |
setTimeout(function() { | |
console.log('and now the third') | |
}, 1000); | |
}, 1000) | |
}, 1000); |
function pickOne(list) { | |
var index = -1; | |
var r = random(1); | |
while (r > 0) { | |
index++; | |
r = r - list[index].prob; | |
} | |
return list[index]; | |
} |
// https://api.mapbox.com/styles/v1/mapbox/streets-v8/static/0,0,2/600x600?access_token=pk.eyJ1IjoiY29kaW5ndHJhaW4iLCJhIjoiY2l6MDJ0Mjk5MDQ1dzJ3bzRiM29zaW16ayJ9.guiqnHMGUq196Zxa1d3UPg | |
var mapimg; | |
var zoom = 1; | |
var data; | |
var ww = 900; | |
var hh = 900; | |
var clat = 0; //37.7749; | |
var clon = 0; //-122.4194; |
var mapimg; | |
var bounds; | |
function setup() { | |
createCanvas(800, 600); | |
angleMode(RADIANS); | |
var size = [800, 600]; | |
//var center = [2.3522, 48.8566]; | |
var center = [2.3522, 48.8566]; |