Skip to content

Commit

Permalink
add PRNG arg into previouses sketches using sketch-common/strange-att…
Browse files Browse the repository at this point in the history
…ractors.js
  • Loading branch information
nclslbrn committed Nov 2, 2024
1 parent 4252433 commit 85d244e
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"sketch:buildAll": "node tasks/build-all-sketches.mjs"
},
"dependencies": {
"@nclslbrn/artistry-swatch": "^0.0.6",
"@nclslbrn/artistry-swatch": "^0.0.7",
"@nclslbrn/plot-writer": "^0.1.10",
"@thi.ng/adapt-dpi": "^2.2.49",
"@thi.ng/date": "^2.7.20",
Expand Down
2 changes: 1 addition & 1 deletion sketch/chaotic-system/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import p5 from 'p5'
//import p5 from 'p5'
import '../framed-canvas.css'
import { getPalette } from '@nclslbrn/artistry-swatch'
import infobox from '../../sketch-common/infobox'
Expand Down
2 changes: 1 addition & 1 deletion sketch/clifford-attractor/clifford-attractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const sketch = (p5) => {
sketch.init = () => {
console.log('init')

strangeAttractors(p5).init('clifford')
strangeAttractors(p5).init('clifford', () => p5.random())
points = []
pointsHistory = []
for (let x = 0; x < width; x += res) {
Expand Down
2 changes: 1 addition & 1 deletion sketch/de-jong-attractor/de-jong-attractor.back.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const sketch = (p5) => {
}
}
sketch.init = () => {
strangeAttractors(p5).init('de_jong')
strangeAttractors().init('de_jong', () => Math.random())
points = initPoints.map((p) => ({
...p
}))
Expand Down
2 changes: 1 addition & 1 deletion sketch/de-jong-attractor/de-jong-attractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const sketch = {
},
init: () => {
progressBar.reset()
strangeAttractors().init('de_jong')
strangeAttractors().init('de_jong', () => Math.random())
scale = 0.5 + Math.ceil(Math.random() * 12)
points = []
lines = []
Expand Down
2 changes: 1 addition & 1 deletion sketch/framed-swirl/framed-swirl.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const sketch = (p5) => {
functionNames[p5.floor(p5.random() * functionNames.length)]
attractor =
attractorNames[p5.floor(p5.random() * attractorNames.length)]
strangeAttractors(p5).init(attractor)
strangeAttractors(p5).init(attractor, () => p5.random())
cartel.innerHTML = ''
cartel.innerHTML += `<p>a ${strFromVar(
planeFunction
Expand Down

0 comments on commit 85d244e

Please sign in to comment.