- Nature of Code Additional videos (as challenges?)
- Elastic Collisions (Chapter 6 reference)
- Exercise 5.8 - image flow field
- Exercise 5.13 - group path following
- Dragon Curve (unfoloding) - chapter 8
- Exercise 8.9 and 8.10 - animating / physics trees?
- Slime Mold (related to chapter 5?)
- ml5.js new tutorials
This file contains 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 stars = []; | |
let factor = 100; | |
let speedSlider; | |
function setup() { | |
createCanvas(windowWidth, windowHeight); | |
speedSlider = createSlider(0, 20, 2, 0.1); | |
for (let i = 0; i < 500; i++) { | |
stars[i] = createVector( | |
random(-width*factor,width*factor), |
This file contains 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
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 |
This file contains 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
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); | |
} | |
} |
This file contains 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
Falling Sand | |
K-d Tree | |
Fast Blur | |
Slime Mold | |
Spider Web | |
K-means | |
image stippling | |
Wave collapse function | |
Skyline Viz | |
Dancing Skeleton |
This file contains 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
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 protected]
This file contains 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
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; |
This file contains 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
// 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); |
This file contains 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
function pickOne(list) { | |
var index = -1; | |
var r = random(1); | |
while (r > 0) { | |
index++; | |
r = r - list[index].prob; | |
} | |
return list[index]; | |
} |
NewerOlder