Copy disabled (too large)
Download .txt
Showing preview only (63,332K chars total). Download the full file to get everything.
Repository: CodingTrain/Coding-Challenges
Branch: main
Commit: 576bc7c1b60e
Files: 1172
Total size: 100.7 MB
Directory structure:
gitextract_t56dc836/
├── 001_StarField/
│ ├── P5/
│ │ ├── Star.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_001_StarField/
│ │ ├── CC_001_StarField.pde
│ │ └── Star.pde
│ └── sketch.pdez
├── 002_MengerSponge/
│ ├── P5/
│ │ ├── box.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_002_MengerSponge/
│ │ ├── Box.pde
│ │ └── CC_002_MengerSponge.pde
│ └── sketch.pdez
├── 003_Snake_game/
│ ├── P5/
│ │ ├── index.html
│ │ ├── sketch.js
│ │ └── snake.js
│ └── Processing/
│ ├── CC_003_Snake_game/
│ │ ├── CC_003_Snake_game.pde
│ │ └── Snake.pde
│ └── sketch.pdez
├── 004_PurpleRain/
│ ├── P5/
│ │ ├── drop.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_004_PurpleRain/
│ │ ├── CC_004_PurpleRain.pde
│ │ └── Drop.pde
│ └── sketch.pdez
├── 005_Space_invaders/
│ ├── P5/
│ │ ├── drop.js
│ │ ├── flower.js
│ │ ├── index.html
│ │ ├── ship.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_005_Space_invaders/
│ │ ├── CC_005_Space_invaders.pde
│ │ ├── Drop.pde
│ │ ├── Flower.pde
│ │ └── Ship.pde
│ └── sketch.pdez
├── 006_Mitosis/
│ ├── P5/
│ │ ├── cell.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_006_Mitosis/
│ │ ├── CC_006_Mitosis.pde
│ │ └── Cell.pde
│ └── sketch.pdez
├── 007_SolarSystemGenerator/
│ ├── P5/
│ │ ├── index.html
│ │ ├── planet.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_007_SolarSystemGenerator/
│ │ ├── CC_007_SolarSystemGenerator.pde
│ │ └── Planet.pde
│ └── sketch.pdez
├── 008_SolarSystemGenerator3D/
│ ├── P5/
│ │ ├── Planet.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_008_SolarSystemGenerator3D/
│ │ ├── CC_008_SolarSystemGenerator3D.pde
│ │ └── Planet.pde
│ └── sketch.pdez
├── 009_SolarSystemGenerator3D_texture/
│ ├── P5/
│ │ ├── Planet.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_009_SolarSystemGenerator3D_texture/
│ │ ├── CC_009_SolarSystemGenerator3D_texture.pde
│ │ └── Planet.pde
│ └── sketch.pdez
├── 010_Maze_DFS/
│ ├── P5/
│ │ ├── cell.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_010_Maze_DFS/
│ │ ├── CC_010_Maze_DFS.pde
│ │ └── cell.pde
│ └── sketch.pdez
├── 011_PerlinNoiseTerrain/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_011_PerlinNoiseTerrain/
│ │ └── CC_011_PerlinNoiseTerrain.pde
│ └── sketch.pdez
├── 012_LorenzAttractor/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_012_LorenzAttractor/
│ │ └── CC_012_LorenzAttractor.pde
│ └── sketch.pdez
├── 013_ReactionDiffusion/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_013_ReactionDiffusion/
│ │ └── CC_013_ReactionDiffusion.pde
│ └── sketch.pdez
├── 014_FractalTree/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_014_FractalTree/
│ │ └── CC_014_FractalTree.pde
│ └── sketch.pdez
├── 015_FractalTreeArray/
│ ├── P5/
│ │ ├── branch.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_015_FractalTreeArray/
│ │ ├── Branch.pde
│ │ └── CC_015_FractalTreeArray.pde
│ └── sketch.pdez
├── 016_LSystem/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_016_LSystem/
│ │ └── CC_016_LSystem.pde
│ └── sketch.pdez
├── 017_SpaceColonizer/
│ ├── P5/
│ │ ├── branch.js
│ │ ├── index.html
│ │ ├── leaf.js
│ │ ├── sketch.js
│ │ └── tree.js
│ └── Processing/
│ ├── CC_017_SpaceColonizer/
│ │ ├── Branch.pde
│ │ ├── CC_017_SpaceColonizer.pde
│ │ ├── Leaf.pde
│ │ └── Tree.pde
│ └── sketch.pdez
├── 018_SpaceColonizer3D/
│ └── Processing/
│ ├── CC_018_SpaceColonizer3D/
│ │ ├── Branch.pde
│ │ ├── CC_018_SpaceColonizer3D.pde
│ │ ├── Leaf.pde
│ │ └── Tree.pde
│ └── sketch.pdez
├── 019_Superellipse/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_019_Superellipse/
│ │ ├── CC_019_Superellipse.pde
│ │ └── Slider.pde
│ └── sketch.pdez
├── 020_ClothSimulation/
│ ├── P5/
│ │ ├── index.html
│ │ ├── particle.js
│ │ ├── sketch.js
│ │ ├── spring.js
│ │ ├── style.css
│ │ └── toxiclibs/
│ │ ├── toxichelper.js
│ │ └── toxiclibs.js
│ └── Processing/
│ ├── CC_020_Cloth2D/
│ │ ├── CC_020_Cloth2D.pde
│ │ ├── Particle.pde
│ │ └── Spring.pde
│ ├── CC_020_Cloth3D/
│ │ └── Processing/
│ │ ├── CC_020_Cloth3D/
│ │ │ ├── CC_020_Cloth3D.pde
│ │ │ ├── Particle.pde
│ │ │ └── Spring.pde
│ │ └── sketch.pdez
│ └── sketch.pdez
├── 021_Mandelbrot/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_021_Mandelbrot/
│ │ └── CC_021_Mandelbrot.pde
│ └── sketch.pdez
├── 022_JuliaSet/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_022_JuliaSet/
│ │ └── CC_022_JuliaSet.pde
│ └── sketch.pdez
├── 023_SuperShape2D/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_023_SuperShape2D/
│ │ └── CC_023_SuperShape2D.pde
│ └── sketch.pdez
├── 024_PerlinNoiseFlowField/
│ ├── P5/
│ │ ├── index.html
│ │ ├── particle.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_024_PerlinNoiseFlowField/
│ │ ├── CC_024_PerlinNoiseFlowField.pde
│ │ ├── Particle.pde
│ │ └── flowfield.pde
│ └── sketch.pdez
├── 025_SphereGeometry/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_025_SphereGeometry/
│ │ └── CC_025_SphereGeometry.pde
│ └── sketch.pdez
├── 026_SuperShape3D/
│ └── Processing/
│ ├── CC_026_SuperShape3D/
│ │ └── CC_026_SuperShape3D.pde
│ └── sketch.pdez
├── 027_FireWorks/
│ ├── P5/
│ │ ├── firework.js
│ │ ├── index.html
│ │ ├── particle.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_027_FireWorks_2D/
│ │ ├── CC_027_FireWorks_2D.pde
│ │ ├── Particle.pde
│ │ └── ParticleSystem.pde
│ ├── CC_027_FireWorks_3D/
│ │ ├── CC_027_FireWorks_3D.pde
│ │ ├── Particle.pde
│ │ └── ParticleSystem.pde
│ └── sketch.pdez
├── 028_MetaBalls/
│ ├── P5/
│ │ ├── blob.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_028_MetaBalls/
│ │ ├── Blob.pde
│ │ └── CC_028_MetaBalls.pde
│ └── sketch.pdez
├── 029_SmartRockets/
│ ├── P5/
│ │ ├── dna.js
│ │ ├── index.html
│ │ ├── population.js
│ │ ├── rocket.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_029_SmartRockets/
│ │ ├── CC_029_SmartRockets.pde
│ │ ├── Dna.pde
│ │ ├── Population.pde
│ │ └── Rocket.pde
│ └── sketch.pdez
├── 030_Phyllotaxis/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_030_Phyllotaxis/
│ │ └── CC_030_Phyllotaxis.pde
│ └── sketch.pdez
├── 031_FlappyBird/
│ ├── P5/
│ │ ├── bird.js
│ │ ├── index.html
│ │ ├── pipe.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_031_FlappyBird/
│ │ ├── Bird.pde
│ │ ├── CC_031_FlappyBird.pde
│ │ └── Pipe.pde
│ └── sketch.pdez
├── 032.1_agar.io/
│ ├── P5/
│ │ ├── blob.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_032_agar.io/
│ │ ├── Blob.pde
│ │ └── CC_032_agar.io.pde
│ └── sketch.pdez
├── 032.2_agar.io_sockets/
│ └── Node/
│ ├── package.json
│ ├── public/
│ │ ├── blob.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── server.js
├── 033_poisson_disc/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_033_poisson_disc/
│ │ └── CC_033_poisson_disc.pde
│ └── sketch.pdez
├── 034_DLA/
│ ├── P5/
│ │ ├── index.html
│ │ ├── sketch.js
│ │ └── walker.js
│ └── Processing/
│ ├── CC_034_DLA/
│ │ ├── CC_034_DLA.pde
│ │ └── Walker.pde
│ └── sketch.pdez
├── 035.1_TSP/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_035_1_TSP/
│ │ └── CC_035_1_TSP.pde
│ └── sketch.pdez
├── 035.2_LexicographicOrder/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_035_2_LexicographicOrder/
│ │ └── CC_035_2_LexicographicOrder.pde
│ └── sketch.pdez
├── 035.3_TSP_Lexical/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_035_3_TSP_Lexical/
│ │ └── CC_035_3_TSP_Lexical.pde
│ └── sketch.pdez
├── 035.4_TSP_GA/
│ ├── P5/
│ │ ├── ga.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_035_4_TSP_GA/
│ │ ├── CC_035_4_TSP_GA.pde
│ │ └── ga.pde
│ └── sketch.pdez
├── 036_Blobby/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_036_Blobby/
│ │ └── CC_036_Blobby.pde
│ └── sketch.pdez
├── 037_diastic/
│ ├── P5/
│ │ ├── index.html
│ │ ├── rainbow.txt
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_037_diastic/
│ │ └── CC_037_diastic/
│ │ ├── CC_037_diastic.pde
│ │ └── data/
│ │ └── rainbow.txt
│ └── sketch.pdez
├── 038_word_interactor/
│ └── P5/
│ ├── index.html
│ └── sketch.js
├── 039_madlibs/
│ └── P5/
│ ├── index.html
│ ├── madlibs.txt
│ └── sketch.js
├── 040.1_wordcounts/
│ ├── P5/
│ │ ├── index.html
│ │ ├── rainbow.txt
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_040_1_wordcounts/
│ │ ├── CC_040_1_wordcounts.pde
│ │ └── data/
│ │ └── rainbow.txt
│ └── sketch.pdez
├── 040.3_tf-idf/
│ └── P5/
│ ├── files/
│ │ ├── eclipse.txt
│ │ ├── fish.txt
│ │ ├── phadke.txt
│ │ ├── rainbow.txt
│ │ ├── sports.txt
│ │ ├── test.txt
│ │ └── tree.txt
│ ├── index.html
│ └── sketch.js
├── 041_ClappyBird/
│ ├── P5/
│ │ ├── bird.js
│ │ ├── index.html
│ │ ├── pipe.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_041_ClappyBird/
│ │ ├── Bird.pde
│ │ ├── CC_041_ClappyBird.pde
│ │ └── Pipe.pde
│ └── sketch.pdez
├── 042.1_markov-chain/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_042_1_markov-chain/
│ │ └── CC_042_1_markov_chain/
│ │ └── CC_042_1_markov_chain.pde
│ └── sketch.pdez
├── 042.2_markov-chain-names/
│ ├── P5/
│ │ ├── index.html
│ │ ├── names.txt
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_042_2_markov-chain-names/
│ │ └── CC_042_2_markov_chain_names/
│ │ ├── CC_042_2_markov_chain_names.pde
│ │ └── data/
│ │ └── names.txt
│ └── sketch.pdez
├── 043_ContextFreeGrammar/
│ └── P5/
│ ├── index.html
│ ├── libraries/
│ │ └── tracery.js
│ └── sketch.js
├── 044_afinn111SentimentAnalysis/
│ └── P5/
│ ├── AFINN-111.txt
│ ├── afinn111-edited.json
│ ├── convert.js
│ ├── index.html
│ └── sketch.js
├── 045_FirebaseSavingDrawing/
│ └── P5/
│ ├── index.html
│ └── sketch.js
├── 046_Asteroids/
│ ├── P5/
│ │ ├── asteroid.js
│ │ ├── index.html
│ │ ├── laser.js
│ │ ├── ship.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_046_Asteroids/
│ │ ├── Asteroid.pde
│ │ ├── CC_046_Asteroids.pde
│ │ ├── Laser.pde
│ │ └── Ship.pde
│ └── sketch.pdez
├── 047_PixelSorting/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_047_PixelSorting/
│ │ └── CC_047_PixelSorting.pde
│ ├── CC_047_PixelSortingAnimation/
│ │ └── CC_047_PixelSortingAnimation.pde
│ └── sketch.pdez
├── 048_TweetsByMonth/
│ ├── P5/
│ │ ├── flotus.json
│ │ ├── index.html
│ │ ├── potus.json
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_048_TweetsByMonth/
│ │ ├── CC_048_TweetsByMonth.pde
│ │ ├── flotus.json
│ │ └── potus.json
│ └── sketch.pdez
├── 049_ObamaMosaic/
│ └── Processing/
│ ├── CC_049_ObamaMosaic/
│ │ ├── CC_049_ObamaMosaic.pde
│ │ └── data/
│ │ └── photos/
│ │ └── readme.txt
│ └── sketch.pdez
├── 050.1_CirclePackingAnimated/
│ ├── P5/
│ │ ├── CC_050.1_A_CirclePackingAnimated/
│ │ │ ├── Circle.js
│ │ │ ├── index.html
│ │ │ └── sketch.js
│ │ └── CC_050.1_B_CirclePackingAnimatedText/
│ │ ├── Circle.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_050_1_A_CirclePackingAnimated/
│ │ ├── CC_050_1_A_CirclePackingAnimated.pde
│ │ └── Circle.pde
│ ├── CC_050_1_B_CirclePackingAnimatedText/
│ │ ├── CC_050_1_B_CirclePackingAnimatedText.pde
│ │ └── Circle.pde
│ └── sketch.pdez
├── 050.2_CirclePackingImage/
│ ├── P5/
│ │ ├── Circle.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_050_2_CirclePackingImage/
│ │ ├── CC_050_2_CirclePackingImage.pde
│ │ └── Circle.pde
│ └── sketch.pdez
├── 051_astar/
│ ├── P5/
│ │ ├── index.html
│ │ ├── sketch.js
│ │ └── spot.js
│ └── Processing/
│ ├── CC_051_astar/
│ │ ├── CC_051_astar.pde
│ │ └── Spot.pde
│ └── sketch.pdez
├── 052_random_walk/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_052_random_walk/
│ │ └── CC_052_random_walk.pde
│ └── sketch.pdez
├── 053_random_walk_levy/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_053_random_walk_levy/
│ │ └── CC_053_random_walk_levy.pde
│ └── sketch.pdez
├── 054.1_StarPatterns/
│ ├── P5/
│ │ ├── edge.js
│ │ ├── hankin.js
│ │ ├── index.html
│ │ ├── polygon.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_054_StarPatterns/
│ │ ├── CC_054_StarPatterns.pde
│ │ ├── Edge.pde
│ │ ├── Hankin.pde
│ │ ├── Polygon.pde
│ │ └── Slider.pde
│ └── sketch.pdez
├── 054.2_StarPatterns/
│ └── P5/
│ ├── edge.js
│ ├── hankin.js
│ ├── index.html
│ ├── polygon.js
│ └── sketch.js
├── 055_Roses/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_055_Roses/
│ │ └── CC_055_Roses.pde
│ └── sketch.pdez
├── 056_attraction_repulsion/
│ ├── P5/
│ │ ├── index.html
│ │ ├── particle.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_056_attraction_repulsion/
│ │ ├── CC_056_attraction_repulsion.pde
│ │ └── Particle.pde
│ └── sketch.pdez
├── 057_Earthquake_Viz/
│ ├── P5/
│ │ ├── all_month.csv
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_057_Earthquake_Viz/
│ │ └── CC_057_Earthquake_Viz.pde
│ └── sketch.pdez
├── 058_EarthQuakeViz3D/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_058_EarthQuakeViz3D/
│ │ └── CC_058_EarthQuakeViz3D.pde
│ └── sketch.pdez
├── 059_Steering_Text_Paths/
│ └── P5/
│ ├── AvenirNextLTPro-Demi.otf
│ ├── index.html
│ ├── sketch.js
│ └── vehicle.js
├── 060_Butterfly_Wings/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_060_Butterfly_Wings/
│ │ └── CC_060_Butterfly_Wings.pde
│ └── sketch.pdez
├── 061_fractal_spirograph/
│ ├── P5/
│ │ ├── index.html
│ │ ├── orbit.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_061_fractal_spirograph/
│ │ ├── CC_061_fractal_spirograph.pde
│ │ └── Orbit.pde
│ └── sketch.pdez
├── 062_plinko/
│ └── P5/
│ ├── boundary.js
│ ├── index.html
│ ├── particle.js
│ ├── plinko.js
│ └── sketch.js
├── 063_unikitty_flag/
│ └── Processing/
│ ├── CC_063_unikitty_flag/
│ │ ├── CC_063_unikitty_flag.pde
│ │ ├── Particle.pde
│ │ └── Spring.pde
│ └── sketch.pdez
├── 064.1_ForwardKinematics/
│ ├── P5/
│ │ └── CC_064.1_A_ForwardKinematics/
│ │ ├── index.html
│ │ ├── segment.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_064_1_A_ForwardKinematics/
│ │ ├── CC_064_1_A_ForwardKinematics.pde
│ │ └── Segment.pde
│ ├── CC_064_1_B_ForwardKinematics/
│ │ ├── CC_064_1_B_ForwardKinematics.pde
│ │ └── Segment.pde
│ └── sketch.pdez
├── 064.2_InverseKinematics/
│ ├── P5/
│ │ ├── index.html
│ │ ├── segment.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_064_2_InverseKinematics/
│ │ ├── CC_064_2_InverseKinematics.pde
│ │ └── Segment.pde
│ └── sketch.pdez
├── 064.3_InverseKinematics_fixed/
│ ├── P5/
│ │ ├── index.html
│ │ ├── robotarm.js
│ │ ├── segment.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_064_3_InverseKinematics_fixed/
│ │ ├── CC_064_3_InverseKinematics_fixed.pde
│ │ └── Segment.pde
│ └── sketch.pdez
├── 064.4_InverseKinematics_array/
│ ├── P5/
│ │ ├── index.html
│ │ ├── segment.js
│ │ ├── sketch.js
│ │ └── tentacle.js
│ └── Processing/
│ ├── CC_064_4_InverseKinematics_array/
│ │ ├── CC_064_4_InverseKinematics_array.pde
│ │ ├── Segment.pde
│ │ └── Tentacle.pde
│ └── sketch.pdez
├── 065.1_binary_tree/
│ ├── P5/
│ │ ├── index.html
│ │ ├── node.js
│ │ ├── sketch.js
│ │ └── tree.js
│ └── Processing/
│ ├── CC_065_1_binary_tree/
│ │ ├── CC_065_1_binary_tree.pde
│ │ ├── Node.pde
│ │ └── Tree.pde
│ └── sketch.pdez
├── 065.2_binary_tree_viz/
│ ├── P5/
│ │ ├── index.html
│ │ ├── node.js
│ │ ├── sketch.js
│ │ └── tree.js
│ └── Processing/
│ ├── CC_065_2_binary_tree_viz/
│ │ ├── CC_065_2_binary_tree_viz.pde
│ │ ├── Node.pde
│ │ └── Tree.pde
│ └── sketch.pdez
├── 066_timer/
│ └── P5/
│ ├── index.html
│ └── sketch.js
├── 067_Pong/
│ ├── P5/
│ │ ├── index.html
│ │ ├── paddle.js
│ │ ├── puck.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_067_Pong/
│ │ ├── CC_067_Pong.pde
│ │ ├── Paddle.pde
│ │ └── Puck.pde
│ └── sketch.pdez
├── 068_BFS_kevin_bacon/
│ └── P5/
│ ├── graph.js
│ ├── index.html
│ ├── kevinbacon.json
│ ├── node.js
│ └── sketch.js
├── 069_steering_evolution/
│ ├── P5/
│ │ ├── index.html
│ │ ├── sketch.js
│ │ └── vehicle.js
│ └── Processing/
│ ├── CC_069_steering_evolution/
│ │ ├── CC_069_steering_evolution.pde
│ │ └── Vehicle.pde
│ └── sketch.pdez
├── 070.1_similarity_score/
│ └── P5/
│ ├── index.html
│ ├── movies.json
│ └── sketch.js
├── 070.2_nearest_neighbors/
│ └── P5/
│ ├── index.html
│ ├── movies.json
│ └── sketch.js
├── 070.3_movie_recommender/
│ └── P5/
│ ├── index.html
│ ├── movies.json
│ └── sketch.js
├── 071_minesweeper/
│ ├── P5/
│ │ ├── cell.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_071_minesweeper/
│ │ ├── CC_071_minesweeper.pde
│ │ └── Cell.pde
│ └── sketch.pdez
├── 072_Frogger/
│ ├── P5/
│ │ ├── car.js
│ │ ├── frog.js
│ │ ├── index.html
│ │ ├── log.js
│ │ ├── rectangle.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_072_Frogger_original/
│ │ ├── CC_072_Frogger_original.pde
│ │ ├── Car.pde
│ │ ├── Frog.pde
│ │ ├── Log.pde
│ │ └── Rectangle.pde
│ ├── CC_072_Frogger_refactored/
│ │ ├── CC_072_Frogger_refactored.pde
│ │ ├── Frog.pde
│ │ ├── Lane.pde
│ │ ├── Obstacle.pde
│ │ └── Rectangle.pde
│ └── sketch.pdez
├── 073_Acrostic/
│ └── P5/
│ ├── index.html
│ └── sketch.js
├── 074_Clock/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_074_Clock/
│ │ └── CC_074_Clock.pde
│ └── sketch.pdez
├── 075_Wikipedia/
│ └── P5/
│ ├── index.html
│ └── sketch.js
├── 076_10PRINT/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_076_10PRINT/
│ │ └── CC_076_10PRINT.pde
│ └── sketch.pdez
├── 077_Recursion/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_077_Recursion/
│ │ └── CC_077_Recursion.pde
│ └── sketch.pdez
├── 078_Simple_Particle_System/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_078_Simple_Particle_System/
│ │ ├── CC_078_Simple_Particle_System.pde
│ │ └── Particle.pde
│ └── sketch.pdez
├── 079_Number_Guessing_Chatbot/
│ └── P5/
│ ├── brain.rive
│ ├── index.html
│ └── sketch.js
├── 080_Voice_Chatbot_with_p5.Speech/
│ └── P5/
│ ├── brain.rive
│ ├── index.html
│ ├── libraries/
│ │ └── p5.speech.js
│ └── sketch.js
├── 081.1_Circle_Morphing_Part_1/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_081_1_Circle_Morphing_Part_1/
│ │ └── CC_081_1_Circle_Morphing_Part_1.pde
│ └── sketch.pdez
├── 081.2_Circle_Morphing_Part_2/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_081_2_Circle_Morphing_Part_2/
│ │ └── CC_081_2_Circle_Morphing_Part_2.pde
│ └── sketch.pdez
├── 082_Image_Chrome_Extension_The_Ex-Kitten-sion/
│ └── JavaScript/
│ ├── kitten.js
│ └── manifest.json
├── 083_Chrome_Extension_with_p5js_Sketch/
│ └── JavaScript/
│ ├── manifest.json
│ └── sketch.js
├── 084_Word_Definition_Extension/
│ └── JavaScript/
│ ├── background.js
│ ├── content.js
│ ├── manifest.json
│ └── sketch/
│ ├── index.html
│ └── sketch.js
├── 085_The_Game_of_Life/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_085_The_Game_of_Life/
│ │ └── CC_085_The_Game_of_Life.pde
│ └── sketch.pdez
├── 086_beesandbombs/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_086_beesandbombs/
│ │ └── CC_086_beesandbombs.pde
│ └── sketch.pdez
├── 087_3D_Knots/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_087_3D_Knots/
│ │ └── CC_087_3D_Knots.pde
│ └── sketch.pdez
├── 088_snowfall/
│ ├── P5/
│ │ ├── index.html
│ │ ├── sketch.js
│ │ └── snowflake.js
│ └── Processing/
│ ├── CC_088_snowfall/
│ │ ├── CC_088_snowfall.pde
│ │ └── snowflake.pde
│ └── sketch.pdez
├── 089_langtonsant/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_089_langtonsant/
│ │ └── CC_089_langtonsant.pde
│ └── sketch.pdez
├── 090_dithering/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_090_dithering/
│ │ └── CC_090_dithering.pde
│ └── sketch.pdez
├── 091_snakesladders/
│ ├── P5/
│ │ ├── index.html
│ │ ├── player.js
│ │ ├── sketch.js
│ │ └── tile.js
│ └── Processing/
│ ├── CC_091_snakesladders/
│ │ ├── CC_091_snakesladders.pde
│ │ ├── Label.pde
│ │ ├── Player.pde
│ │ └── Tile.pde
│ └── sketch.pdez
├── 092_xor/
│ ├── P5/
│ │ ├── index.html
│ │ ├── libraries/
│ │ │ ├── matrix.js
│ │ │ └── nn.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_092_xor/
│ │ ├── CC_092_xor.pde
│ │ ├── Matrix.java
│ │ ├── Neural_Network.pde
│ │ └── data.pde
│ └── sketch.pdez
├── 093_DoublePendulum/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_093_DoublePendulum/
│ │ └── CC_093_DoublePendulum.pde
│ └── sketch.pdez
├── 094_2048/
│ ├── P5/
│ │ ├── config.js
│ │ ├── game.js
│ │ ├── grid.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_094_2048/
│ │ └── CC_094_2048.pde
│ └── sketch.pdez
├── 095_Approximating_Pi/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_095_Approximating_Pi/
│ │ └── CC_095_Approximating_Pi.pde
│ └── sketch.pdez
├── 096_Visualizing_the_Digits_of_Pi/
│ ├── P5/
│ │ ├── index.html
│ │ ├── pi-1million.txt
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_096_Visualizing_the_Digits_of_Pi/
│ │ ├── CC_096_Visualizing_the_Digits_of_Pi.pde
│ │ └── pi-1million.txt
│ └── sketch.pdez
├── 097.1_Book_of_Pi_Part_1/
│ └── Processing/
│ ├── CC_097_1_Book_of_Pi_Part_1/
│ │ ├── CC_097_1_Book_of_Pi_Part_1.pde
│ │ ├── pi-10million.txt
│ │ └── pi-1million.txt
│ └── sketch.pdez
├── 097.2_Book_of_Pi_Part_2/
│ └── Processing/
│ ├── CC_097_2_Book_of_Pi_Part_2/
│ │ ├── CC_097_2_Book_of_Pi_Part_2.pde
│ │ ├── pi-1000.txt
│ │ ├── pi-10million.txt
│ │ └── pi-1million.txt
│ └── sketch.pdez
├── 098.1_QuadTree/
│ ├── P5/
│ │ ├── index.html
│ │ ├── quadtree.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_098.1_QuadTree/
│ │ ├── CC_098.1_QuadTree.pde
│ │ ├── Point.pde
│ │ ├── Rectangle.pde
│ │ └── quadtree.pde
│ └── sketch.pdez
├── 098.3_QuadTree_Collisions/
│ ├── P5/
│ │ ├── index.html
│ │ ├── particle.js
│ │ ├── quadtree.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_098.3_QuadTree_Collisions/
│ │ ├── CC_098.3_QuadTree_Collisions.pde
│ │ ├── Point.pde
│ │ ├── Rectangle.pde
│ │ └── quadtree.pde
│ └── sketch.pdez
├── 099_ColorPredictor/
│ └── P5/
│ ├── index.html
│ ├── lib/
│ │ ├── matrix.js
│ │ └── nn.js
│ └── sketch.js
├── 100.1_NeuroEvolution_FlappyBird/
│ ├── P5/
│ │ ├── bird.js
│ │ ├── ga.js
│ │ ├── index.html
│ │ ├── neuralnetwork/
│ │ │ ├── matrix.js
│ │ │ └── nn.js
│ │ ├── pipe.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_100_1_NeuroEvolution_FlappyBird/
│ │ ├── CC_100_1_NeuroEvolution_FlappyBird.pde
│ │ ├── GA.pde
│ │ ├── Matrix.java
│ │ ├── Neural_Network.pde
│ │ ├── bird.pde
│ │ └── pipe.pde
│ └── sketch.pdez
├── 100.5_NeuroEvolution_FlappyBird/
│ └── P5/
│ ├── bad_bird.json
│ ├── best_bird.json
│ ├── bird.js
│ ├── index.html
│ ├── neuralnetwork/
│ │ ├── matrix.js
│ │ └── nn.js
│ ├── pipe.js
│ └── sketch.js
├── 101_MayThe4th/
│ ├── P5/
│ │ ├── AvenirNextLTPro-Demi.otf
│ │ ├── index.html
│ │ ├── sketch.js
│ │ └── space.txt
│ └── Processing/
│ ├── CC_101_MayThe4th/
│ │ ├── CC_101_MayThe4th.pde
│ │ └── data/
│ │ └── space.txt
│ └── sketch.pdez
├── 102_WaterRipples/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_102_WaterRipples/
│ │ └── CC_102_WaterRipples.pde
│ └── sketch.pdez
├── 103_Flames/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_103_Flames/
│ │ └── CC_103_Flames.pde
│ └── sketch.pdez
├── 104_tf_linear_regression/
│ └── P5/
│ ├── index.html
│ └── sketch.js
├── 105_tf_polynomial_regression/
│ └── P5/
│ ├── index.html
│ └── sketch.js
├── 106_xor_tfjs/
│ └── P5/
│ ├── index.html
│ └── sketch.js
├── 107_sandpiles/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_107_sandpiles/
│ │ └── CC_107_sandpiles.pde
│ └── sketch.pdez
├── 108_barnsley_fern/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_108_barnsley_fern/
│ │ └── CC_108_barnsley_fern.pde
│ └── sketch.pdez
├── 109_subscriber_map/
│ └── P5/
│ ├── countries.json
│ ├── index.html
│ ├── sketch.js
│ └── subscribers_geo.csv
├── 110.1_recaman/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_110_recaman/
│ │ ├── Arc.pde
│ │ └── CC_110_recaman.pde
│ └── sketch.pdez
├── 110.2_recaman_music/
│ └── P5/
│ ├── index.html
│ └── sketch.js
├── 111_animated_sprite/
│ ├── P5/
│ │ ├── horse/
│ │ │ └── horse.json
│ │ ├── index.html
│ │ ├── sketch.js
│ │ └── sprite.js
│ └── Processing/
│ ├── CC_111_animated_sprite/
│ │ ├── CC_111_animated_sprite.pde
│ │ ├── horse/
│ │ │ └── horse.json
│ │ └── sprite.pde
│ └── sketch.pdez
├── 112_3D_Rendering/
│ ├── P5/
│ │ ├── index.html
│ │ ├── matrix.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_112_3D_Rendering/
│ │ ├── CC_112_3D_Rendering.pde
│ │ └── matrix.pde
│ └── sketch.pdez
├── 113_Hypercube/
│ ├── P5/
│ │ ├── P4Vector.js
│ │ ├── index.html
│ │ ├── matrix.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_113_Hypercube/
│ │ ├── CC_113_Hypercube.pde
│ │ ├── P4Vector.pde
│ │ └── matrix.pde
│ └── sketch.pdez
├── 114_BubbleSortViz/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_114_BubbleSortViz/
│ │ └── CC_114_BubbleSortViz.pde
│ └── sketch.pdez
├── 115_Snake_Game_Redux/
│ ├── P5/
│ │ ├── index.html
│ │ ├── sketch.js
│ │ └── snake.js
│ └── Processing/
│ ├── Snake_Game_Redux/
│ │ ├── Snake_Game_Redux.pde
│ │ └── snake.pde
│ └── sketch.pdez
├── 116_Lissajous/
│ ├── P5/
│ │ ├── curve.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_116_Lissajous/
│ │ ├── CC_116_Lissajous.pde
│ │ └── Curve.pde
│ └── sketch.pdez
├── 117_SevenSegmentDisplay/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_117_SevenSegmentDisplay/
│ │ └── CC_117_SevenSegmentDisplay.pde
│ └── sketch.pdez
├── 118_Mastodon_TreeBot/
│ └── Node/
│ ├── .env-sample
│ ├── .gitignore
│ ├── bot.js
│ ├── package.json
│ └── treegen/
│ └── treegen.pde
├── 119_Binary_to_Decimal_Conversion/
│ ├── P5/
│ │ ├── bit.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_119_Binary_to_Decimal_Conversion/
│ │ ├── CC_119_Binary_to_Decimal_Conversion.pde
│ │ └── bit.pde
│ └── sketch.pdez
├── 120_Bit_Shifting/
│ ├── P5/
│ │ ├── bit.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_120_Bit_Shifting/
│ │ ├── Button.pde
│ │ ├── CC_120_Bit_Shifting.pde
│ │ ├── Label.pde
│ │ └── bit.pde
│ └── sketch.pdez
├── 121_Logo_1/
│ ├── P5/
│ │ ├── index.html
│ │ ├── sketch.js
│ │ └── turtle.js
│ └── Processing/
│ ├── CC_121_Logo_1/
│ │ ├── CC_121_Logo_1.pde
│ │ ├── Turtle.pde
│ │ └── code.txt
│ └── sketch.pdez
├── 121_Logo_2/
│ ├── P5/
│ │ ├── command.js
│ │ ├── index.html
│ │ ├── parser.js
│ │ ├── sketch.js
│ │ └── turtle.js
│ └── Processing/
│ ├── CC_121_Logo_2/
│ │ ├── CC_121_Logo_2.pde
│ │ ├── Command.pde
│ │ ├── Parser.pde
│ │ ├── Turtle.pde
│ │ └── code.txt
│ └── sketch.pdez
├── 122_QuickDraw_1/
│ └── Node/
│ ├── package.json
│ ├── public/
│ │ ├── index.html
│ │ └── sketch.js
│ └── server.js
├── 122_QuickDraw_2/
│ └── P5/
│ ├── index.html
│ └── sketch.js
├── 123_ChaosGame_1/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_123_ChaosGame_1/
│ │ └── CC_123_ChaosGame_1.pde
│ └── sketch.pdez
├── 123_ChaosGame_2/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_123_ChaosGame_2/
│ │ └── CC_123_ChaosGame_2.pde
│ └── sketch.pdez
├── 124_Flocking_Boids/
│ ├── P5/
│ │ ├── boid.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC124_Flocking_Boids/
│ │ ├── CC124_Flocking_Boids.pde
│ │ └── boid.pde
│ └── sketch.pdez
├── 125_Fourier_Series/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_125_Fourier_Series/
│ │ └── CC_125_Fourier_Series.pde
│ └── sketch.pdez
├── 126_Toothpicks/
│ ├── P5/
│ │ ├── index.html
│ │ ├── sketch.js
│ │ └── toothpick.js
│ └── Processing/
│ ├── sketch.pdez
│ └── toothpicks/
│ ├── Toothpick.pde
│ └── toothpicks.pde
├── 127_Snowflake_Brownian/
│ ├── P5/
│ │ ├── index.html
│ │ ├── particle.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_127_Snowflake_Brownian/
│ │ ├── CC_127_Snowflake_Brownian.pde
│ │ └── Particle.pde
│ └── sketch.pdez
├── 128_SketchRNN_Snowflakes/
│ └── P5/
│ ├── index.html
│ └── sketch.js
├── 129_Koch_Snowflake/
│ ├── P5/
│ │ ├── index.html
│ │ ├── segment.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_129_Koch_Snowflake/
│ │ ├── CC_129_Koch_Snowflake.pde
│ │ └── Segment.pde
│ └── sketch.pdez
├── 130_Fourier_Transform_1/
│ ├── P5/
│ │ ├── codingtrain.js
│ │ ├── fourier.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_130_Fourier_Transform/
│ │ ├── CC_130_Fourier_Transform.pde
│ │ ├── DFT.pde
│ │ ├── train.json
│ │ └── wave.pde
│ └── sketch.pdez
├── 130_Fourier_Transform_2/
│ └── P5/
│ ├── fourier.js
│ ├── index.html
│ └── sketch.js
├── 130_Fourier_Transform_3/
│ ├── P5/
│ │ ├── codingtrain.js
│ │ ├── fourier.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_130_Fourier_Transform/
│ │ ├── CC_130_Fourier_Transform.pde
│ │ ├── Complex_Number.pde
│ │ └── DFT.pde
│ └── sketch.pdez
├── 131_BouncingDVDLogo/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_131_BouncingDVDLogo/
│ │ └── CC_131_BouncingDVDLogo.pde
│ └── sketch.pdez
├── 132_FluidSimulation/
│ ├── P5/
│ │ ├── fluid.js
│ │ ├── fluid_utils.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_132_FluidSimulation/
│ │ ├── CC_132_FluidSimulation.pde
│ │ ├── Fluid.pde
│ │ └── MoreFluid.pde
│ └── sketch.pdez
├── 133_Times_Tables_Cardioid/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_133_TimesTablesCardioid/
│ │ └── CC_133_TimesTablesCardioid.pde
│ └── sketch.pdez
├── 134_Heart_Curve_1/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_134_Heart_Curve_1/
│ │ └── CC_134_Heart_Curve_1.pde
│ └── sketch.pdez
├── 134_Heart_Curve_2/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_134_Heart_Curve_2/
│ │ └── CC_134_Heart_Curve_2.pde
│ └── sketch.pdez
├── 135_GIF_Loop/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_135_GIF_Loop/
│ │ └── CC_135_GIF_Loop.pde
│ └── sketch.pdez
├── 136_Polar_Noise_Loop_1/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_136_Polar_Noise_Loop_1/
│ │ └── CC_136_Polar_Noise_Loop_1.pde
│ └── sketch.pdez
├── 136_Polar_Noise_Loop_2/
│ ├── P5/
│ │ ├── index.html
│ │ ├── noiseLoop.js
│ │ ├── particle.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_136_Polar_Noise_Loop_2/
│ │ ├── CC_136_Polar_Noise_Loop_2.pde
│ │ ├── NoiseLoop.pde
│ │ └── Particle.pde
│ └── sketch.pdez
├── 137_4D_Noise_Loop/
│ ├── P5/
│ │ ├── OpenSimplexNoise.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_137_4D_Noise_Loop/
│ │ ├── CC_137_4D_Noise_Loop.pde
│ │ └── OpenSimplexNoise.java
│ └── sketch.pdez
├── 138_Angry_Birds/
│ └── P5/
│ ├── bird.js
│ ├── box.js
│ ├── ground.js
│ ├── index.html
│ ├── sketch.js
│ └── slingshot.js
├── 139_Pi_Collisions/
│ └── P5/
│ ├── block.js
│ ├── index.html
│ └── sketch.js
├── 140_Pi_Leibniz/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_140_Pi_Leibniz/
│ │ └── CC_140_Pi_Leibniz.pde
│ └── sketch.pdez
├── 141_Mandelbrot_Pi/
│ └── Processing/
│ ├── CC_141_Mandelbrot_Pi/
│ │ └── CC_141_Mandelbrot_Pi.pde
│ └── sketch.pdez
├── 142_Rubiks_Cube_1/
│ ├── P5/
│ │ ├── Cubie.js
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_142_Rubiks_Cube_1/
│ │ ├── CC_142_Rubiks_Cube_1.pde
│ │ └── Cubie.pde
│ └── sketch.pdez
├── 142_Rubiks_Cube_2/
│ └── Processing/
│ ├── CC_142_Rubiks_Cube_2/
│ │ ├── CC_142_Rubiks_Cube_2.pde
│ │ ├── Cubie.pde
│ │ ├── Face.pde
│ │ └── controls.pde
│ └── sketch.pdez
├── 142_Rubiks_Cube_3/
│ └── Processing/
│ ├── CC_142_Rubiks_Cube_3/
│ │ ├── CC_142_Rubiks_Cube_3.pde
│ │ ├── Cubie.pde
│ │ ├── Face.pde
│ │ ├── Move.pde
│ │ ├── controls.pde
│ │ └── turns.pde
│ └── sketch.pdez
├── 143_QuickSort/
│ └── P5/
│ ├── index.html
│ └── sketch.js
├── 144_Black_Hole_Newtonian/
│ ├── P5/
│ │ ├── blackhole.js
│ │ ├── index.html
│ │ ├── photon.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_114_Black_Hole_Newtonian/
│ │ ├── CC_114_Black_Hole_Newtonian.pde
│ │ ├── blackhole.pde
│ │ └── photon.pde
│ └── sketch.pdez
├── 145_Ray_Casting/
│ ├── P5/
│ │ ├── boundary.js
│ │ ├── index.html
│ │ ├── particle.js
│ │ ├── ray.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_145_Ray_Casting/
│ │ ├── CC_145_Ray_Casting.pde
│ │ ├── boundary.pde
│ │ ├── particle.pde
│ │ └── ray.pde
│ └── sketch.pdez
├── 146_Rendering_Ray_Casting/
│ ├── P5/
│ │ ├── boundary.js
│ │ ├── index.html
│ │ ├── particle.js
│ │ ├── ray.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_146_Rendering_Ray_Casting/
│ │ ├── Boundary.pde
│ │ ├── CC_146_Rendering_Ray_Casting.pde
│ │ ├── Particle.pde
│ │ └── Ray.pde
│ └── sketch.pdez
├── 147_Chrome_Dinosaur_Game/
│ ├── P5/
│ │ ├── index.html
│ │ ├── sketch.js
│ │ ├── train.js
│ │ └── unicorn.js
│ └── Processing/
│ ├── CC_147_Chrome_Dinosaur_Game/
│ │ ├── CC_147_Chrome_Dinosaur_Game.pde
│ │ ├── train.pde
│ │ └── unicorn.pde
│ └── sketch.pdez
├── 148_Gift_Wrapping/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_148_Gift_Wrapping/
│ │ ├── CC_148_Gift_Wrapping.pde
│ │ └── sorting.pde
│ └── sketch.pdez
├── 149_Tic_Tac_Toe/
│ ├── P5/
│ │ ├── index.html
│ │ ├── sketch.js
│ │ └── style.css
│ └── Processing/
│ ├── CC_149_Tic_Tac_Toe/
│ │ └── CC_149_Tic_Tac_Toe.pde
│ └── sketch.pdez
├── 150_Ai_Rainbows_Runway/
│ └── P5/
│ ├── index.html
│ ├── sketch.js
│ └── style.css
├── 151_Ukulele_Tuner/
│ └── P5/
│ ├── index.html
│ ├── sketch.js
│ └── style.css
├── 152_RDP_Algorithm/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_152_RDP/
│ │ └── CC_152_RDP.pde
│ └── sketch.pdez
├── 153_Interactive_SketchRRN/
│ └── P5/
│ ├── index.html
│ ├── rdp.js
│ └── sketch.js
├── 154_Tic_Tac_Toe_Minimax/
│ ├── P5/
│ │ ├── index.html
│ │ ├── minimax.js
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_154_Tic_Tac_Toe_Minimax/
│ │ ├── CC_154_Tic_Tac_Toe_Minimax.pde
│ │ └── Minimax.pde
│ └── sketch.pdez
├── 155_Kaleidoscope_Snowflake/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ └── Processing/
│ ├── CC_155_Kaleidoscope_Snowflake/
│ │ └── CC_155_Kaleidoscope_Snowflake.pde
│ └── sketch.pdez
├── 156_Pi_Digits/
│ ├── Node/
│ │ ├── index.js
│ │ ├── package.json
│ │ ├── pi-million.txt
│ │ └── public/
│ │ ├── index.html
│ │ ├── sketch.js
│ │ └── style.css
│ └── P5/
│ ├── index.html
│ ├── pi-million.txt
│ ├── sketch.js
│ └── style.css
├── 157_Zoom_Annotations/
│ ├── 1-basic/
│ │ ├── index.html
│ │ └── sketch.js
│ └── 2-final/
│ ├── index.html
│ └── sketch.js
├── 158_Shape_Classifier/
│ ├── dataset/
│ │ └── generate_dataset_shape_classifier/
│ │ └── generate_dataset_shape_classifier.pde
│ ├── dataset-p5/
│ │ ├── index.html
│ │ └── sketch.js
│ ├── mouse/
│ │ ├── index.html
│ │ ├── model/
│ │ │ ├── model.json
│ │ │ └── model_meta.json
│ │ └── sketch.js
│ ├── training/
│ │ ├── index.html
│ │ ├── model/
│ │ │ ├── model.json
│ │ │ └── model_meta.json
│ │ └── sketch.js
│ └── webcam/
│ ├── index.html
│ ├── model/
│ │ ├── model.json
│ │ └── model_meta.json
│ └── sketch.js
├── 159_simple_pendulum_simulation/
│ ├── P5/
│ │ ├── index.html
│ │ └── sketch.js
│ ├── Processing/
│ │ ├── cc_159_simple_pendulum_simulation/
│ │ │ └── cc_159_simple_pendulum_simulation.pde
│ │ └── sketch.pdez
│ ├── array-of-pendulums/
│ │ ├── index.html
│ │ ├── pendulum.js
│ │ ├── sketch.js
│ │ └── style.css
│ └── pendulum-oop/
│ ├── index.html
│ ├── pendulum.js
│ ├── sketch.js
│ └── style.css
├── 160_spring_forces/
│ ├── simple-spring/
│ │ ├── index.html
│ │ └── sketch.js
│ ├── simple-spring-port/
│ │ └── cc160_simple_spring_port/
│ │ └── cc160_simple_spring_port.pde
│ ├── soft-spring/
│ │ ├── index.html
│ │ ├── particle.js
│ │ ├── sketch.js
│ │ └── spring.js
│ ├── soft-spring-port/
│ │ └── cc160_soft_spring_port/
│ │ ├── Particle.pde
│ │ ├── Spring.pde
│ │ └── cc160_soft_spring_port.pde
│ ├── spring-oop/
│ │ ├── index.html
│ │ ├── particle.js
│ │ ├── sketch.js
│ │ └── spring.js
│ ├── spring-oop-port/
│ │ └── cc160_spring_oop_port/
│ │ ├── Particle.pde
│ │ ├── Spring.pde
│ │ └── cc160_spring_oop_port.pde
│ ├── spring-vector/
│ │ ├── index.html
│ │ └── sketch.js
│ └── spring-vector-port/
│ └── cc160_spring_vector_port/
│ └── cc160_spring_vector_port.pde
├── 161_pi_from_random/
│ ├── from-pi/
│ │ ├── index.html
│ │ ├── pi1000000.txt
│ │ └── sketch.js
│ └── from-random/
│ ├── index.html
│ ├── milliondigits.txt
│ └── sketch.js
├── 162_self_avoiding_walk/
│ ├── 3d/
│ │ ├── index.html
│ │ ├── sketch.js
│ │ └── spot.js
│ ├── alpha-random-walk/
│ │ ├── index.html
│ │ └── sketch.js
│ ├── backtracking/
│ │ ├── index.html
│ │ ├── sketch.js
│ │ └── spot.js
│ ├── basic/
│ │ ├── index.html
│ │ └── sketch.js
│ ├── bezier/
│ │ ├── index.html
│ │ ├── sketch.js
│ │ └── spot.js
│ └── recursion/
│ ├── index.html
│ └── sketch.js
├── 163_Bezier/
│ ├── basic-bezier/
│ │ ├── index.html
│ │ └── sketch.js
│ ├── bezier-editor/
│ │ ├── index.html
│ │ └── sketch.js
│ ├── bezier-formula/
│ │ ├── index.html
│ │ ├── particle.js
│ │ └── sketch.js
│ ├── bezier-vertex/
│ │ ├── index.html
│ │ └── sketch.js
│ ├── cardioid-bezier/
│ │ ├── index.html
│ │ └── sketch.js
│ ├── cubic/
│ │ ├── index.html
│ │ ├── particle.js
│ │ └── sketch.js
│ └── quadratic/
│ ├── index.html
│ └── sketch.js
├── 164_Slitscan/
│ └── Processing/
│ ├── CC_164_Time_Slitscan/
│ │ └── CC_164_Time_Slitscan.pde
│ ├── CC_164_Time_Slitscan_Horizontal/
│ │ └── CC_164_Time_Slitscan_Horizontal.pde
│ ├── CC_164_Time_Slitscan_Radial/
│ │ └── CC_164_Time_Slitscan_Radial.pde
│ ├── Continuous_Slitscan/
│ │ └── Continuous_Slitscan.pde
│ ├── Image_Slices/
│ │ └── Image_Slices.pde
│ ├── Image_Slices_Wave/
│ │ └── Image_Slices_Wave.pde
│ ├── Radial_Slitscan/
│ │ └── Radial_Slitscan.pde
│ ├── Time_Grid/
│ │ └── Time_Grid.pde
│ └── sketch.pdez
├── 165_Slide_Puzzle/
│ ├── slide-puzzle-canvas/
│ │ ├── index.html
│ │ ├── sketch.js
│ │ └── tile.js
│ ├── slide-puzzle-image/
│ │ ├── index.html
│ │ ├── sketch.js
│ │ └── tile.js
│ └── slide-puzzle-video/
│ ├── index.html
│ ├── sketch.js
│ └── tile.js
├── 166_Ascii_Image/
│ ├── ascii-image-canvas/
│ │ ├── index.html
│ │ ├── p5.js
│ │ ├── sketch.js
│ │ └── style.css
│ ├── ascii-image-dom/
│ │ ├── index.html
│ │ ├── p5.js
│ │ ├── sketch.js
│ │ └── style.css
│ ├── ascii-text/
│ │ ├── gloria.txt
│ │ ├── index.html
│ │ ├── p5.js
│ │ ├── sketch.js
│ │ └── style.css
│ ├── ascii-video/
│ │ ├── index.html
│ │ ├── p5.js
│ │ ├── sketch.js
│ │ └── style.css
│ └── ascii-weather-api/
│ ├── gloria.txt
│ ├── index.html
│ ├── p5.js
│ ├── sketch.js
│ └── style.css
├── 167_Prime_Spiral/
│ ├── P5/
│ │ ├── number-spiral/
│ │ │ ├── index.html
│ │ │ └── sketch.js
│ │ ├── prime-random/
│ │ │ ├── index.html
│ │ │ └── sketch.js
│ │ ├── prime-spiral/
│ │ │ ├── index.html
│ │ │ └── sketch.js
│ │ ├── shapes-color/
│ │ │ ├── index.html
│ │ │ └── sketch.js
│ │ └── spiral-3d/
│ │ ├── index.html
│ │ └── sketch.js
│ ├── Processing/
│ │ ├── number_spiral/
│ │ │ └── number_spiral.pde
│ │ ├── prime_random/
│ │ │ ├── Spiral.pde
│ │ │ └── prime_random.pde
│ │ ├── prime_spiral/
│ │ │ └── prime_spiral.pde
│ │ ├── shapes_color/
│ │ │ └── shapes_color.pde
│ │ ├── sketch.pdez
│ │ └── spiral_3d/
│ │ ├── Spot.pde
│ │ └── spiral_3d.pde
│ └── README.md
├── 168_Mandelbulb/
│ └── Processing/
│ ├── MandelBulb_Cloud/
│ │ ├── MandelBulb_Cloud.pde
│ │ └── mandelbulb.txt
│ ├── MandelBulb_Color/
│ │ ├── MandelBulb_Color.pde
│ │ └── mandelbulb.txt
│ ├── MandelBulb_Shape/
│ │ ├── MandelBulb_Shape.pde
│ │ └── mandelbulb.txt
│ ├── RayMarching_SDF/
│ │ └── RayMarching_SDF.pde
│ ├── Voxels/
│ │ └── Voxels.pde
│ └── sketch.pdez
├── 169_Pi_Day/
│ ├── Processing/
│ │ ├── Pie.pde
│ │ ├── Pie_in_the_Sky.pde
│ │ ├── Plate.pde
│ │ └── one-million.txt
│ └── p5/
│ ├── index.html
│ ├── one-million.txt
│ ├── pie.js
│ ├── plate.js
│ └── sketch.js
├── LICENSE
├── README.md
└── zip_to_pdez.sh
================================================
FILE CONTENTS
================================================
================================================
FILE: 001_StarField/P5/Star.js
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/17WoOqgXsRM
function Star() {
this.x = random(-width, width);
this.y = random(-height, height);
this.z = random(width);
this.pz = this.z;
this.update = function() {
this.z = this.z - speed;
if (this.z < 1) {
this.z = width;
this.x = random(-width, width);
this.y = random(-height, height);
this.pz = this.z;
}
};
this.show = function() {
fill(255);
noStroke();
var sx = map(this.x / this.z, 0, 1, 0, width);
var sy = map(this.y / this.z, 0, 1, 0, height);
var r = map(this.z, 0, width, 16, 0);
ellipse(sx, sy, r, r);
var px = map(this.x / this.pz, 0, 1, 0, width);
var py = map(this.y / this.pz, 0, 1, 0, height);
this.pz = this.z;
stroke(255);
line(px, py, sx, sy);
};
}
================================================
FILE: 001_StarField/P5/index.html
================================================
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>StarField_p5.js</title>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/addons/p5.sound.min.js"></script>
<script type="text/javascript" src="sketch.js"></script>
<script type="text/javascript" src="Star.js"></script>
<style> body {padding: 0; margin: 0;} canvas {vertical-align: top;} </style>
</head>
<body>
</body>
</html>
================================================
FILE: 001_StarField/P5/sketch.js
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/17WoOqgXsRM
let stars = [];
let speed;
function setup() {
createCanvas(600, 600);
for (let i = 0; i < 800; i++) {
stars[i] = new Star();
}
}
function draw() {
speed = map(mouseX, 0, width, 0, 50);
background(0);
translate(width / 2, height / 2);
for (let i = 0; i < stars.length; i++) {
stars[i].update();
stars[i].show();
}
}
================================================
FILE: 001_StarField/Processing/CC_001_StarField/CC_001_StarField.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/17WoOqgXsRM
// I create an array named "stars",
// it will be filled with 800 elements made with the Star() class.
Star[] stars = new Star[800];
// I create a variable "speed", it'll be useful to control the speed of stars.
float speed;
void setup() {
size(600, 600);
// I fill the array with a for loop;
// running 800 times, it creates a new star using the Star() class.
for (int i = 0; i < stars.length; i++) {
stars[i] = new Star();
}
}
void draw() {
// i link the value of the speed variable to the mouse position.
speed = map(mouseX, 0, width, 0, 50);
background(0);
// I shift the entire composition,
// moving its center from the top left corner to the center of the canvas.
translate(width/2, height/2);
// I draw each star, running the "update" method to update its position and
// the "show" method to show it on the canvas.
for (int i = 0; i < stars.length; i++) {
stars[i].update();
stars[i].show();
}
}
================================================
FILE: 001_StarField/Processing/CC_001_StarField/Star.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/17WoOqgXsRM
// I create a "Star" Class.
class Star {
// I create variables to specify the x and y of each star.
float x;
float y;
// I create "z", a variable I'll use in a formula to modify the stars position.
float z;
// I create an other variable to store the previous value of the z variable.
// (the value of the z variable at the previous frame).
float pz;
Star() {
// I place values in the variables
x = random(-width/2, width/2);
// note: height and width are the same: the canvas is a square.
y = random(-height/2, height/2);
// note: the z value can't exceed the width/2 (and height/2) value,
// beacuse I'll use "z" as divisor of the "x" and "y",
// whose values are also between "0" and "width/2".
z = random(width/2);
// I set the previous position of "z" in the same position of "z",
// which it's like to say that the stars are not moving during the first frame.
pz = z;
}
void update() {
// In the formula to set the new stars coordinates
// I'll divide a value for the "z" value and the outcome will be
// the new x-coordinate and y-coordinate of the star.
// Which means if I decrease the value of "z" (which is a divisor),
// the outcome will be bigger.
// Wich means the more the speed value is bigger, the more the "z" decrease,
// and the more the x and y coordinates increase.
// Note: the "z" value is the first value I updated for the new frame.
z = z - speed;
// when the "z" value equals to 1, I'm sure the star have passed the
// borders of the canvas( probably it's already far away from the borders),
// so i can place it on more time in the canvas, with new x, y and z values.
// Note: in this way I also avoid a potential division by 0.
if (z < 1) {
z = width/2;
x = random(-width/2, width/2);
y = random(-height/2, height/2);
pz = z;
}
}
void show() {
fill(255);
noStroke();
// with theese "map", I get the new star positions
// the division x / z get a number between 0 and a very high number,
// we map this number (proportionally to a range of 0 - 1), inside a range of 0 - width/2.
// In this way we are sure the new coordinates "sx" and "sy" move faster at each frame
// and which they finish their travel outside of the canvas (they finish when "z" is less than a).
float sx = map(x / z, 0, 1, 0, width/2);
float sy = map(y / z, 0, 1, 0, height/2);;
// I use the z value to increase the star size between a range from 0 to 16.
float r = map(z, 0, width/2, 16, 0);
ellipse(sx, sy, r, r);
// Here i use the "pz" valute to get the previous position of the stars,
// so I can draw a line from the previous position to the new (current) one.
float px = map(x / pz, 0, 1, 0, width/2);
float py = map(y / pz, 0, 1, 0, height/2);
// Placing here this line of code, I'm sure the "pz" value are updated after the
// coordinates are already calculated; in this way the "pz" value is always equals
// to the "z" value of the previous frame.
pz = z;
stroke(255);
line(px, py, sx, sy);
}
}
================================================
FILE: 002_MengerSponge/P5/box.js
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for this video: https://youtu.be/LG8ZK-rRkXo
function Box(x, y, z, r) {
this.pos = createVector(x, y, z);
this.r = r;
this.generate = function() {
let boxes = [];
for (let x = -1; x < 2; x++) {
for (let y = -1; y < 2; y++) {
for (let z = -1; z < 2; z++) {
let sum = abs(x) + abs(y) + abs(z);
let newR = this.r / 3;
if (sum > 1) {
let b = new Box(
this.pos.x + x * newR,
this.pos.y + y * newR,
this.pos.z + z * newR,
newR
);
boxes.push(b);
}
}
}
}
return boxes;
};
this.show = function() {
push();
translate(this.pos.x, this.pos.y, this.pos.z);
box(this.r);
pop();
};
}
================================================
FILE: 002_MengerSponge/P5/index.html
================================================
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>MengerSponge_p5.js</title>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/addons/p5.sound.min.js"></script>
<script type="text/javascript" src="sketch.js"></script>
<script type="text/javascript" src="box.js"></script>
<style> body {padding: 0; margin: 0;} canvas {vertical-align: top;} </style>
</head>
<body>
</body>
</html>
================================================
FILE: 002_MengerSponge/P5/sketch.js
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for this video: https://youtu.be/LG8ZK-rRkXo
var a = 0;
var sponge = [];
function setup() {
createCanvas(400, 400, WEBGL);
// as of p5.js 0.6.0, normal material is no longer the default and
// has to be explicitly selected.
normalMaterial();
// An array of Box objects
// Star with one
var b = new Box(0, 0, 0, 200);
sponge.push(b);
}
function mousePressed() {
// Generate the next set of boxes
var next = [];
for (var i = 0; i < sponge.length; i++) {
var b = sponge[i];
var newBoxes = b.generate();
next = next.concat(newBoxes);
}
sponge = next;
}
function draw() {
background(51);
rotateX(a);
rotateY(a * 0.4);
rotateZ(a * 0.1);
// Show what you've got!
for (var i = 0; i < sponge.length; i++) {
sponge[i].show();
}
a += 0.01;
}
================================================
FILE: 002_MengerSponge/Processing/CC_002_MengerSponge/Box.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for this video: https://youtu.be/LG8ZK-rRkXo
class Box {
PVector pos;
float r;
Box(float x, float y, float z, float r_) {
pos = new PVector(x, y, z);
r = r_;
}
ArrayList<Box> generate() {
ArrayList<Box> boxes = new ArrayList<Box>();
for (int x = -1; x < 2; x++) {
for (int y = -1; y < 2; y++) {
for (int z = -1; z < 2; z++) {
int sum = abs(x) + abs(y) + abs(z);
float newR = r/3;
if (sum > 1) {
Box b = new Box(pos.x+x*newR, pos.y+ y*newR, pos.z+z*newR, newR);
boxes.add(b);
}
}
}
}
return boxes;
}
void show() {
pushMatrix();
translate(pos.x, pos.y, pos.z);
noStroke();
fill(255);
box(r);
popMatrix();
}
}
================================================
FILE: 002_MengerSponge/Processing/CC_002_MengerSponge/CC_002_MengerSponge.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for this video: https://youtu.be/LG8ZK-rRkXo
float a = 0;
ArrayList<Box> sponge;
void setup() {
size(400, 400, P3D);
// An array of Box objects
sponge = new ArrayList<Box>();
// Star with one
Box b = new Box(0, 0, 0, 200);
sponge.add(b);
}
void mousePressed() {
// Generate the next set of boxes
ArrayList<Box> next = new ArrayList<Box>();
for (Box b : sponge) {
ArrayList<Box> newBoxes = b.generate();
next.addAll(newBoxes);
}
sponge = next;
}
void draw() {
background(51);
stroke(255);
noFill();
lights();
translate(width/2, height/2);
rotateX(a);
rotateY(a*0.4);
rotateZ(a*0.1);
// Show what you've got!
for (Box b : sponge) {
b.show();
}
a += 0.01;
}
================================================
FILE: 003_Snake_game/P5/index.html
================================================
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Snake Game</title>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/addons/p5.sound.min.js"></script>
<script type="text/javascript" src="sketch.js"></script>
<script type="text/javascript" src="snake.js"></script>
</head>
<body>
</body>
</html>
================================================
FILE: 003_Snake_game/P5/sketch.js
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/AaGK-fj-BAM
let s;
let scl = 20;
let food;
function setup() {
createCanvas(600, 600);
s = new Snake();
frameRate(10);
pickLocation();
}
function pickLocation() {
let cols = floor(width / scl);
let rows = floor(height / scl);
food = createVector(floor(random(cols)), floor(random(rows)));
food.mult(scl);
}
function mousePressed() {
s.total++;
}
function draw() {
background(51);
if (s.eat(food)) {
pickLocation();
}
s.death();
s.update();
s.show();
fill(255, 0, 100);
rect(food.x, food.y, scl, scl);
}
function keyPressed() {
if (keyCode === UP_ARROW) {
s.dir(0, -1);
} else if (keyCode === DOWN_ARROW) {
s.dir(0, 1);
} else if (keyCode === RIGHT_ARROW) {
s.dir(1, 0);
} else if (keyCode === LEFT_ARROW) {
s.dir(-1, 0);
}
}
================================================
FILE: 003_Snake_game/P5/snake.js
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/AaGK-fj-BAM
function Snake() {
this.x = 0;
this.y = 0;
this.xspeed = 1;
this.yspeed = 0;
this.total = 0;
this.tail = [];
this.eat = function(pos) {
let d = dist(this.x, this.y, pos.x, pos.y);
if (d < 1) {
this.total++;
return true;
} else {
return false;
}
};
this.dir = function(x, y) {
this.xspeed = x;
this.yspeed = y;
};
this.death = function() {
for (let i = 0; i < this.tail.length; i++) {
let pos = this.tail[i];
let d = dist(this.x, this.y, pos.x, pos.y);
if (d < 1) {
console.log('starting over');
this.total = 0;
this.tail = [];
}
}
};
this.update = function() {
for (let i = 0; i < this.tail.length - 1; i++) {
this.tail[i] = this.tail[i + 1];
}
if (this.total >= 1) {
this.tail[this.total - 1] = createVector(this.x, this.y);
}
this.x = this.x + this.xspeed * scl;
this.y = this.y + this.yspeed * scl;
this.x = constrain(this.x, 0, width - scl);
this.y = constrain(this.y, 0, height - scl);
};
this.show = function() {
fill(255);
for (let i = 0; i < this.tail.length; i++) {
rect(this.tail[i].x, this.tail[i].y, scl, scl);
}
rect(this.x, this.y, scl, scl);
};
}
================================================
FILE: 003_Snake_game/Processing/CC_003_Snake_game/CC_003_Snake_game.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/AaGK-fj-BAM
Snake s;
int scl = 20;
PVector food;
void setup() {
size(600, 600);
s = new Snake();
frameRate(10);
pickLocation();
}
void pickLocation() {
int cols = width/scl;
int rows = height/scl;
food = new PVector(floor(random(cols)), floor(random(rows)));
food.mult(scl);
}
void mousePressed() {
s.total++;
}
void draw() {
background(51);
if (s.eat(food)) {
pickLocation();
}
s.death();
s.update();
s.show();
fill(255, 0, 100);
rect(food.x, food.y, scl, scl);
}
void keyPressed() {
if (keyCode == UP) {
s.dir(0, -1);
} else if (keyCode == DOWN) {
s.dir(0, 1);
} else if (keyCode == RIGHT) {
s.dir(1, 0);
} else if (keyCode == LEFT) {
s.dir(-1, 0);
}
}
================================================
FILE: 003_Snake_game/Processing/CC_003_Snake_game/Snake.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/AaGK-fj-BAM
class Snake {
float x = 0;
float y = 0;
float xspeed = 1;
float yspeed = 0;
int total = 0;
ArrayList<PVector> tail = new ArrayList<PVector>();
Snake() {
}
boolean eat(PVector pos) {
float d = dist(x, y, pos.x, pos.y);
if (d < 1) {
total++;
return true;
} else {
return false;
}
}
void dir(float x, float y) {
xspeed = x;
yspeed = y;
}
void death() {
for (int i = 0; i < tail.size(); i++) {
PVector pos = tail.get(i);
float d = dist(x, y, pos.x, pos.y);
if (d < 1) {
println("starting over");
total = 0;
tail.clear();
}
}
}
void update() {
//println(total + " " + tail.size());
if (total > 0) {
if (total == tail.size() && !tail.isEmpty()) {
tail.remove(0);
}
tail.add(new PVector(x, y));
}
x = x + xspeed*scl;
y = y + yspeed*scl;
x = constrain(x, 0, width-scl);
y = constrain(y, 0, height-scl);
}
void show() {
fill(255);
for (PVector v : tail) {
rect(v.x, v.y, scl, scl);
}
rect(x, y, scl, scl);
}
}
================================================
FILE: 004_PurpleRain/P5/drop.js
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/KkyIDI6rQJI
function Drop() {
this.x = random(width);
this.y = random(-500, -50);
this.z = random(0, 20);
this.len = map(this.z, 0, 20, 10, 20);
this.yspeed = map(this.z, 0, 20, 1, 20);
this.fall = function() {
this.y = this.y + this.yspeed;
var grav = map(this.z, 0, 20, 0, 0.2);
this.yspeed = this.yspeed + grav;
if (this.y > height) {
this.y = random(-200, -100);
this.yspeed = map(this.z, 0, 20, 4, 10);
}
};
this.show = function() {
var thick = map(this.z, 0, 20, 1, 3);
strokeWeight(thick);
stroke(138, 43, 226);
line(this.x, this.y, this.x, this.y + this.len);
};
}
================================================
FILE: 004_PurpleRain/P5/index.html
================================================
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Purple Rain</title>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/addons/p5.sound.min.js"></script>
<script type="text/javascript" src="sketch.js"></script>
<script type="text/javascript" src="drop.js"></script>
</head>
<body>
</body>
</html>
================================================
FILE: 004_PurpleRain/P5/sketch.js
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/KkyIDI6rQJI
// Purple Rain
// (138, 43, 226)
// (230, 230, 250) // background
var drops = [];
function setup() {
createCanvas(640, 360);
for (var i = 0; i < 500; i++) {
drops[i] = new Drop();
}
}
function draw() {
background(230, 230, 250);
for (var i = 0; i < drops.length; i++) {
drops[i].fall();
drops[i].show();
}
}
================================================
FILE: 004_PurpleRain/Processing/CC_004_PurpleRain/CC_004_PurpleRain.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/KkyIDI6rQJI
// Purple Rain
// (138, 43, 226)
// (230, 230, 250) // background
Drop[] drops = new Drop[500]; // array of drop objects
void setup() {
size(640, 360); // size of the window
for (int i = 0; i < drops.length; i++) { // we create the drops
drops[i] = new Drop();
}
}
void draw() {
background(230, 230, 250); // background color in RGB color cordinates
for (int i = 0; i < drops.length; i++) {
drops[i].fall(); // sets the shape and speed of drop
drops[i].show(); // render drop
}
}
================================================
FILE: 004_PurpleRain/Processing/CC_004_PurpleRain/Drop.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/KkyIDI6rQJI
// map function documentation : https://processing.org/reference/map_.html
//we create an object drop first and the create an array of those objects
class Drop {
float x; // x postion of drop
float y; // y position of drop
float z; // z position of drop , determines whether the drop is far or near
float len; // length of the drop
float yspeed; // speed of te drop
//near means closer to the screen , ie the higher the z value ,closer the drop is to the screen.
Drop() {
x = random(width); // random x position ie width because anywhere along the width of screen
y = random(-500, -50); // random y position, negative values because drop first begins off screen to give a realistic effect
z = random(0, 20); // z value is to give a perspective view , farther and nearer drops effect
len = map(z, 0, 20, 10, 20); // if z is near then drop is longer
yspeed = map(z, 0, 20, 1, 20); // if z is near drop is faster
}
void fall() { // function to determine the speed and shape of the drop
y = y + yspeed; // increment y position to give the effect of falling
float grav = map(z, 0, 20, 0, 0.2); // if z is near then gravity on drop is more
yspeed = yspeed + grav; // speed increases as gravity acts on the drop
if (y > height) { // repositions the drop after it has 'disappeared' from screen
y = random(-200, -100);
yspeed = map(z, 0, 20, 4, 10);
}
}
void show() { // function to render the drop onto the screen
float thick = map(z, 0, 20, 1, 3); //if z is near , drop is more thicker
strokeWeight(thick); // weight of the drop
stroke(138, 43, 226); // purple color
line(x, y, x, y+len); // draws the line with two points
}
}
================================================
FILE: 005_Space_invaders/P5/drop.js
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/biN3v3ef-Y0
function Drop(x, y) {
this.x = x;
this.y = y;
this.r = 8;
this.toDelete = false;
this.show = function() {
noStroke();
fill(150, 0, 255);
ellipse(this.x, this.y, this.r * 2, this.r * 2);
};
this.evaporate = function() {
this.toDelete = true;
};
this.hits = function(flower) {
var d = dist(this.x, this.y, flower.x, flower.y);
if (d < this.r + flower.r) {
return true;
} else {
return false;
}
};
this.move = function() {
this.y = this.y - 5;
};
}
================================================
FILE: 005_Space_invaders/P5/flower.js
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/biN3v3ef-Y0
function Flower(x, y) {
this.x = x;
this.y = y;
this.r = 30;
this.xdir = 1;
this.grow = function() {
this.r = this.r + 2;
};
this.shiftDown = function() {
this.xdir *= -1;
this.y += this.r;
};
this.move = function() {
this.x = this.x + this.xdir;
};
this.show = function() {
noStroke();
fill(255, 0, 200, 150);
ellipse(this.x, this.y, this.r * 2, this.r * 2);
};
}
================================================
FILE: 005_Space_invaders/P5/index.html
================================================
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Space Invaders</title>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/addons/p5.sound.min.js"></script>
<script type="text/javascript" src="sketch.js"></script>
<script type="text/javascript" src="flower.js"></script>
<script type="text/javascript" src="drop.js"></script>
<script type="text/javascript" src="ship.js"></script>
</head>
<body>
</body>
</html>
================================================
FILE: 005_Space_invaders/P5/ship.js
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/biN3v3ef-Y0
function Ship() {
this.x = width / 2;
this.xdir = 0;
this.show = function() {
fill(255);
rectMode(CENTER);
rect(this.x, height - 20, 20, 60);
};
this.setDir = function(dir) {
this.xdir = dir;
};
this.move = function(dir) {
this.x += this.xdir * 5;
};
}
================================================
FILE: 005_Space_invaders/P5/sketch.js
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/biN3v3ef-Y0
var ship;
var flowers = [];
var drops = [];
function setup() {
createCanvas(600, 400);
ship = new Ship();
// drop = new Drop(width/2, height/2);
for (var i = 0; i < 6; i++) {
flowers[i] = new Flower(i * 80 + 80, 60);
}
}
function draw() {
background(51);
ship.show();
ship.move();
for (var i = 0; i < drops.length; i++) {
drops[i].show();
drops[i].move();
for (var j = 0; j < flowers.length; j++) {
if (drops[i].hits(flowers[j])) {
flowers[j].grow();
drops[i].evaporate();
}
}
}
var edge = false;
for (var i = 0; i < flowers.length; i++) {
flowers[i].show();
flowers[i].move();
if (flowers[i].x > width || flowers[i].x < 0) {
edge = true;
}
}
if (edge) {
for (var i = 0; i < flowers.length; i++) {
flowers[i].shiftDown();
}
}
for (var i = drops.length - 1; i >= 0; i--) {
if (drops[i].toDelete) {
drops.splice(i, 1);
}
}
}
function keyReleased() {
if (key != ' ') {
ship.setDir(0);
}
}
function keyPressed() {
if (key === ' ') {
var drop = new Drop(ship.x, height);
drops.push(drop);
}
if (keyCode === RIGHT_ARROW) {
ship.setDir(1);
} else if (keyCode === LEFT_ARROW) {
ship.setDir(-1);
}
}
================================================
FILE: 005_Space_invaders/Processing/CC_005_Space_invaders/CC_005_Space_invaders.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/biN3v3ef-Y0
Ship ship;
Flower[] flowers = new Flower[6];
ArrayList<Drop> drops = new ArrayList<Drop>();
void setup() {
size(600, 400);
ship = new Ship();
// drop = new Drop(width/2, height/2);
for (int i = 0; i < flowers.length; i++) {
flowers[i] = new Flower(i*80+80, 60);
}
}
void draw() {
background(51);
ship.show();
ship.move();
for (Drop d : drops) {
d.show();
d.move();
for (int j = 0; j < flowers.length; j++) {
if (d.hits(flowers[j])) {
flowers[j].grow();
d.evaporate();
}
}
}
boolean edge = false;
for (int i = 0; i < flowers.length; i++) {
flowers[i].show();
flowers[i].move();
if (flowers[i].x > width || flowers[i].x < 0) {
edge = true;
}
}
if (edge) {
for (int i = 0; i < flowers.length; i++) {
flowers[i].shiftDown();
}
}
for (int i = drops.size()-1; i >= 0; i--) {
Drop d = drops.get(i);
if (d.toDelete) {
drops.remove(i);
}
}
}
void keyReleased() {
if (key != ' ') {
ship.setDir(0);
}
}
void keyPressed() {
if (key == ' ') {
Drop drop = new Drop(ship.x, height);
drops.add(drop);
}
if (keyCode == RIGHT) {
ship.setDir(1);
} else if (keyCode == LEFT) {
ship.setDir(-1);
}
}
================================================
FILE: 005_Space_invaders/Processing/CC_005_Space_invaders/Drop.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/biN3v3ef-Y0
class Drop {
float x, y, r;
boolean toDelete;
Drop(float x, float y) {
this.x = x;
this.y = y;
this.r = 8;
this.toDelete = false;
}
void show() {
noStroke();
fill(150, 0, 255);
ellipse(this.x, this.y, this.r*2, this.r*2);
}
void evaporate() {
this.toDelete = true;
}
boolean hits(Flower flower) {
float d = dist(this.x, this.y, flower.x, flower.y);
if (d < this.r + flower.r) {
return true;
} else {
return false;
}
}
void move() {
this.y = this.y - 5;
}
}
================================================
FILE: 005_Space_invaders/Processing/CC_005_Space_invaders/Flower.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/biN3v3ef-Y0
class Flower {
float x, y, r, xdir;
Flower(float x, float y) {
this.x = x;
this.y = y;
this.r = 30;
this.xdir = 1;
}
void grow() {
this.r = this.r + 2;
}
void shiftDown() {
this.xdir *= -1;
this.y += this.r;
}
void move() {
this.x = this.x + this.xdir;
}
void show() {
noStroke();
fill(255, 0, 200, 150);
ellipse(this.x, this.y, this.r*2, this.r*2);
}
}
================================================
FILE: 005_Space_invaders/Processing/CC_005_Space_invaders/Ship.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/biN3v3ef-Y0
class Ship {
float x, xdir;
Ship() {
this.x = width/2;
this.xdir = 0;
}
void show() {
fill(255);
rectMode(CENTER);
rect(this.x, height-20, 20, 60);
}
void setDir(float dir) {
this.xdir = dir;
}
void move() {
this.x += this.xdir*5;
}
}
================================================
FILE: 006_Mitosis/P5/cell.js
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/jxGS3fKPKJA
function Cell(pos, r, c) {
if (pos) {
this.pos = pos.copy();
} else {
this.pos = createVector(random(width), random(height));
}
this.r = r || 60;
this.c = c || color(random(100, 255), 0, random(100, 255), 100);
this.clicked = function(x, y) {
var d = dist(this.pos.x, this.pos.y, x, y);
if (d < this.r) {
return true;
} else {
return false;
}
};
this.mitosis = function() {
//this.pos.x += random(-this.r, this.r);
var cell = new Cell(this.pos, this.r * 0.8, this.c);
return cell;
};
this.move = function() {
var vel = p5.Vector.random2D();
this.pos.add(vel);
};
this.show = function() {
noStroke();
fill(this.c);
ellipse(this.pos.x, this.pos.y, this.r, this.r);
};
}
================================================
FILE: 006_Mitosis/P5/index.html
================================================
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Mitosis</title>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/addons/p5.sound.min.js"></script>
<script type="text/javascript" src="sketch.js"></script>
<script type="text/javascript" src="cell.js"></script>
</head>
<body>
</body>
</html>
================================================
FILE: 006_Mitosis/P5/sketch.js
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/jxGS3fKPKJA
var cells = [];
function setup() {
createCanvas(700, 700);
cells.push(new Cell());
cells.push(new Cell());
}
function draw() {
background(200);
for (var i = 0; i < cells.length; i++) {
cells[i].move();
cells[i].show();
}
}
function mousePressed() {
for (var i = cells.length - 1; i >= 0; i--) {
if (cells[i].clicked(mouseX, mouseY)) {
cells.push(cells[i].mitosis());
cells.push(cells[i].mitosis());
cells.splice(i, 1);
}
}
}
================================================
FILE: 006_Mitosis/Processing/CC_006_Mitosis/CC_006_Mitosis.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/jxGS3fKPKJA
ArrayList<Cell> cells = new ArrayList<Cell>();
void setup() {
size(700, 700);
cells.add(new Cell());
cells.add(new Cell());
}
void draw() {
background(200);
for (Cell c : cells) {
c.move();
c.show();
}
}
void mousePressed() {
for (int i = cells.size()-1; i >= 0; i--) {
Cell c = cells.get(i);
if (c.clicked(mouseX, mouseY)) {
cells.add(c.mitosis());
cells.add(c.mitosis());
cells.remove(i);
}
}
}
================================================
FILE: 006_Mitosis/Processing/CC_006_Mitosis/Cell.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/jxGS3fKPKJA
class Cell {
PVector pos;
float r;
color c;
Cell(PVector pos, float r, color c) {
this.pos = pos.copy();
this.r = r;
this.c = c;
}
Cell() {
this.pos = new PVector(random(width), random(height));
this.r = 60;
this.c = color(random(100, 255), 0, random(100, 255), 100);
}
boolean clicked(int x, int y) {
float d = dist(this.pos.x, this.pos.y, x, y);
if (d < this.r) {
return true;
} else {
return false;
}
}
Cell mitosis() {
Cell cell = new Cell(this.pos, this.r*0.8, this.c);
return cell;
}
void move() {
PVector vel = PVector.random2D();
this.pos.add(vel);
}
void show() {
noStroke();
fill(this.c);
ellipse(this.pos.x, this.pos.y, this.r, this.r);
}
}
================================================
FILE: 007_SolarSystemGenerator/P5/index.html
================================================
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Solar System Generator</title>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/addons/p5.sound.min.js"></script>
<script type="text/javascript" src="sketch.js"></script>
<script type="text/javascript" src="planet.js"></script>
</head>
<body>
</body>
</html>
================================================
FILE: 007_SolarSystemGenerator/P5/planet.js
================================================
class Planet {
constructor(radius, distance, orbitspeed, angle) {
this.radius = radius;
this.distance = distance;
this.orbitspeed = orbitspeed;
this.angle = angle;
this.planets = [];
}
orbit() {
this.angle += this.orbitspeed;
for (let i in this.planets) {
this.planets[i].orbit();
}
}
spawnMoons(total, level) {
for (let i = 0; i < total; i++) {
let r = this.radius / (level * 2);
let d = random(50, 150);
let o = random(-0.1, 0.1);
let a = random(TWO_PI);
this.planets.push(new Planet(r, d / level, o, a));
if (level < 3) {
let num = Math.floor(random(0, 4));
this.planets[i].spawnMoons(num, level + 1);
}
}
}
show() {
push();
fill(255, 100);
rotate(this.angle);
translate(this.distance, 0);
ellipse(0, 0, this.radius * 2);
for (let i in this.planets) {
this.planets[i].show();
}
pop();
}
}
================================================
FILE: 007_SolarSystemGenerator/P5/sketch.js
================================================
// port of Daniel Shiffman's pde SolarSystemGenerator by madacoo
function setup() {
createCanvas(600, 600);
sun = new Planet(50, 0, 0, random(TWO_PI));
sun.spawnMoons(5, 1);
}
function draw() {
background(51);
translate(width / 2, height / 2);
sun.show();
sun.orbit();
}
================================================
FILE: 007_SolarSystemGenerator/Processing/CC_007_SolarSystemGenerator/CC_007_SolarSystemGenerator.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/l8SiJ-RmeHU
Planet sun;
void setup() {
size(600, 600);
sun = new Planet(50, 0, 0);
sun.spawnMoons(5, 1);
}
void draw() {
background(0);
translate(width/2, height/2);
sun.show();
sun.orbit();
}
================================================
FILE: 007_SolarSystemGenerator/Processing/CC_007_SolarSystemGenerator/Planet.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/l8SiJ-RmeHU
class Planet {
float radius;
float distance;
Planet[] planets;
float angle;
float orbitspeed;
Planet(float r, float d, float o) {
radius = r;
distance = d;
angle = random(TWO_PI);
orbitspeed = o;
//println(angle);
}
void orbit() {
angle = angle + orbitspeed;
if (planets != null) {
for (int i = 0; i < planets.length; i++) {
planets[i].orbit();
}
}
}
void spawnMoons(int total, int level) {
planets = new Planet[total];
for (int i = 0; i < planets.length; i++) {
float r = radius/(level*2);
float d = random(50, 150);
float o = random(-0.1, 0.1);
planets[i] = new Planet(r, d/level, o);
if (level < 3) {
int num = int(random(0,4));
planets[i].spawnMoons(num, level+1);
}
}
}
void show() {
pushMatrix();
fill(255, 100);
rotate(angle);
translate(distance, 0);
ellipse(0, 0, radius*2, radius*2);
if (planets != null) {
for (int i = 0; i < planets.length; i++) {
planets[i].show();
}
}
popMatrix();
}
}
================================================
FILE: 008_SolarSystemGenerator3D/P5/Planet.js
================================================
// Solar System in Processing - Part 2 (3D)
// The Coding Train / Daniel Shiffman
// https://thecodingtrain.com/CodingChallenges/008-solarsystemgenerator3d.html
// https://youtu.be/dncudkelNxw
// https://editor.p5js.org/codingtrain/sketches/QIB-sT10
class Planet {
constructor(r, d, o) {
this.v = p5.Vector.random3D();
this.radius = r;
this.distance = d;
this.v.mult(this.distance);
this.angle = random(TWO_PI);
this.orbitspeed = o;
this.planets = null;
}
orbit() {
this.angle = this.angle + this.orbitspeed;
if (this.planets != null) {
for (let i = 0; i < this.planets.length; i++) {
this.planets[i].orbit();
}
}
}
spawnMoons(total, level) {
this.planets = [];
for (let i = 0; i < total; i++) {
let r = this.radius / (level * 2);
let d = random(this.radius + r, (this.radius + r) * 2);
let o = random(-0.1, 0.1);
this.planets[i] = new Planet(r, d, o);
if (level < 2) {
let num = int(random(0, 3));
this.planets[i].spawnMoons(num, level + 1);
}
}
}
show() {
push();
noStroke();
let v2 = createVector(1, 0, 1);
let p = this.v.cross(v2);
// Rotation around a 0-length axis doesn't work in p5.js, so don't do that.
if (p.x != 0 || p.y != 0 || p.z != 0) {
rotate(this.angle, p);
}
stroke(255);
//line(0, 0, 0, this.v.x, this.v.y, this.v.z);
//line(0, 0, 0, p.x, p.y, p.z);
translate(this.v.x, this.v.y, this.v.z);
noStroke();
fill(255);
sphere(this.radius);
//ellipse(0, 0, this.radius * 2, this.radius * 2);
if (this.planets != null) {
for (let i = 0; i < this.planets.length; i++) {
this.planets[i].show();
}
}
pop();
}
}
================================================
FILE: 008_SolarSystemGenerator3D/P5/index.html
================================================
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Solar System Generator - Part 2 (3D) - Coding Challenge #8</title>
<script src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/freshfork/p5.EasyCam@1.0.10/p5.easycam.min.js"></script>
</head>
<body>
<script src="Planet.js"></script>
<script src="sketch.js"></script>
</body>
</html>
================================================
FILE: 008_SolarSystemGenerator3D/P5/sketch.js
================================================
// Solar System in Processing - Part 2 (3D)
// The Coding Train / Daniel Shiffman
// https://thecodingtrain.com/CodingChallenges/008-solarsystemgenerator3d.html
// https://youtu.be/dncudkelNxw
// https://editor.p5js.org/codingtrain/sketches/QIB-sT10
// Since PeasyCam is only for Java, this instead uses p5.EasyCam,
// which is based on PeasyCam but is made for p5.js.
// It can be found here: https://github.com/freshfork/p5.EasyCam
let sun;
let cam;
function setup() {
let canvas = createCanvas(600, 600, WEBGL);
// Disable the context menu on the canvas so the camera can use the right mouse button
canvas.elt.oncontextmenu = () => false;
cam = createEasyCam({ distance: 500 });
sun = new Planet(50, 0, 0);
sun.spawnMoons(4, 1);
}
function draw() {
background(0);
lights();
sun.show();
sun.orbit();
}
================================================
FILE: 008_SolarSystemGenerator3D/Processing/CC_008_SolarSystemGenerator3D/CC_008_SolarSystemGenerator3D.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/dncudkelNxw
import peasy.*;
Planet sun;
PeasyCam cam;
void setup() {
size(600, 600, P3D);
cam = new PeasyCam(this, 500);
sun = new Planet(50, 0, 0);
sun.spawnMoons(4, 1);
}
void draw() {
background(0);
lights();
sun.show();
sun.orbit();
}
================================================
FILE: 008_SolarSystemGenerator3D/Processing/CC_008_SolarSystemGenerator3D/Planet.pde
================================================
// Solar System in Processing - Part 2 (3D)
// The Coding Train / Daniel Shiffman
// https://thecodingtrain.com/CodingChallenges/008-solarsystemgenerator3d.html
// https://youtu.be/dncudkelNxw
class Planet {
float radius;
float distance;
Planet[] planets;
float angle;
float orbitspeed;
PVector v;
Planet(float r, float d, float o) {
v = PVector.random3D();
radius = r;
distance = d;
v.mult(distance);
angle = random(TWO_PI);
orbitspeed = o;
}
void orbit() {
angle = angle + orbitspeed;
if (planets != null) {
for (int i = 0; i < planets.length; i++) {
planets[i].orbit();
}
}
}
void spawnMoons(int total, int level) {
planets = new Planet[total];
for (int i = 0; i < planets.length; i++) {
float r = radius/(level*2);
float d = random((radius + r), (radius+r)*2);
float o = random(-0.1, 0.1);
planets[i] = new Planet(r, d, o);
if (level < 2) {
int num = int(random(0, 3));
planets[i].spawnMoons(num, level+1);
}
}
}
void show() {
pushMatrix();
noStroke();
PVector v2 = new PVector(1, 0, 1);
PVector p = v.cross(v2);
rotate(angle, p.x, p.y, p.z);
stroke(255);
//line(0, 0, 0, v.x, v.y, v.z);
//line(0, 0, 0, p.x, p.y, p.z);
translate(v.x, v.y, v.z);
noStroke();
fill(255);
sphere(radius);
//ellipse(0, 0, radius*2, radius*2);
if (planets != null) {
for (int i = 0; i < planets.length; i++) {
planets[i].show();
}
}
popMatrix();
}
}
================================================
FILE: 009_SolarSystemGenerator3D_texture/P5/Planet.js
================================================
// Solar System in Processing - Part 3 (3D textures)
// The Coding Train / Daniel Shiffman
// https://thecodingtrain.com/CodingChallenges/009-solarsystemgenerator3d-texture.html
// https://youtu.be/FGAwi7wpU8c
// https://editor.p5js.org/codingtrain/sketches/SD8a6k6A
class Planet {
constructor(r, d, o, img) {
this.v = p5.Vector.random3D();
this.radius = r;
this.distance = d;
this.v.mult(this.distance);
this.angle = random(TWO_PI);
this.orbitspeed = o;
this.planets = null;
// Since there is no direct equivalent of PShape in p5.js, we have
// to save the texture for later use instead of creating a globe.
this.texture = img;
}
orbit() {
this.angle = this.angle + this.orbitspeed;
if (this.planets != null) {
for (let i = 0; i < this.planets.length; i++) {
this.planets[i].orbit();
}
}
}
spawnMoons(total, level) {
this.planets = [];
for (let i = 0; i < total; i++) {
let r = this.radius / (level * 2);
let d = random(this.radius + r, (this.radius + r) * 2);
let o = random(-0.1, 0.1);
let index = int(random(0, textures.length));
this.planets[i] = new Planet(r, d, o, textures[index]);
if (level < 2) {
let num = int(random(0, 3));
this.planets[i].spawnMoons(num, level + 1);
}
}
}
show() {
push();
noStroke();
let v2 = createVector(1, 0, 1);
let p = this.v.cross(v2);
// Rotation around a 0-length axis doesn't work in p5.js, so don't do that.
if (p.x != 0 || p.y != 0 || p.z != 0) {
rotate(this.angle, p);
}
stroke(255);
//line(0, 0, 0, this.v.x, this.v.y, this.v.z);
//line(0, 0, 0, p.x, p.y, p.z);
translate(this.v.x, this.v.y, this.v.z);
noStroke();
fill(255);
// Since we don't have a PShape, we draw a textured sphere instead.
texture(this.texture);
sphere(this.radius);
//ellipse(0, 0, this.radius * 2, this.radius * 2);
if (this.planets != null) {
for (let i = 0; i < this.planets.length; i++) {
this.planets[i].show();
}
}
pop();
}
}
================================================
FILE: 009_SolarSystemGenerator3D_texture/P5/index.html
================================================
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Solar System Generator - Part 3 (3D textures) - Coding Challenge #9</title>
<script src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/freshfork/p5.EasyCam@1.0.10/p5.easycam.min.js"></script>
</head>
<body>
<script src="Planet.js"></script>
<script src="sketch.js"></script>
</body>
</html>
================================================
FILE: 009_SolarSystemGenerator3D_texture/P5/sketch.js
================================================
// Solar System in Processing - Part 3 (3D textures)
// The Coding Train / Daniel Shiffman
// https://thecodingtrain.com/CodingChallenges/009-solarsystemgenerator3d-texture.html
// https://youtu.be/FGAwi7wpU8c
// https://editor.p5js.org/codingtrain/sketches/SD8a6k6A
// Since PeasyCam is only for Java, this instead uses p5.EasyCam,
// which is based on PeasyCam but is made for p5.js.
// It can be found here: https://github.com/freshfork/p5.EasyCam
// A significant difference from the Processing version is that p5.js
// does not have the PShape object, so we cannot use that to store the
// geometry along with its texture and so on. Instead, we have to apply
// the texture image every time through draw(), right before drawing
// the sphere that the texture should be applied to.
//
// Luckily, this is not difficult - we simply have to make the Planet
// store the chosen texture image instead of the shape that uses it,
// and instead of replacing the call to sphere() with a call to shape()
// we add a call to texture() right before the sphere() call.
let sun;
let cam;
let sunTexture;
const textures = [];
// Because of the asynchronous nature of file loading in JavaScript, we
// have to load the images in p5.js' preload() instead of in setup().
function preload() {
sunTexture = loadImage('data/sun.jpg');
textures[0] = loadImage('data/mars.jpg');
textures[1] = loadImage('data/earth.jpg');
textures[2] = loadImage('data/mercury.jpg');
}
function setup() {
let canvas = createCanvas(600, 600, WEBGL);
// Disable the context menu on the canvas so the camera can use the right mouse button
canvas.elt.oncontextmenu = () => false;
cam = createEasyCam({ distance: 500 });
sun = new Planet(50, 0, 0, sunTexture);
sun.spawnMoons(4, 1);
}
function draw() {
background(0);
ambientLight(255, 255, 255);
pointLight(255, 255, 255, 0, 0, 0);
sun.show();
sun.orbit();
}
================================================
FILE: 009_SolarSystemGenerator3D_texture/Processing/CC_009_SolarSystemGenerator3D_texture/CC_009_SolarSystemGenerator3D_texture.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/FGAwi7wpU8c
import peasy.*;
Planet sun;
PeasyCam cam;
PImage sunTexture;
PImage[] textures = new PImage[3];
void setup() {
size(600, 600, P3D);
sunTexture = loadImage("sun.jpg");
textures[0] = loadImage("mars.jpg");
textures[1] = loadImage("earth.jpg");
textures[2] = loadImage("mercury.jpg");
cam = new PeasyCam(this, 500);
sun = new Planet(50, 0, 0, sunTexture);
sun.spawnMoons(4, 1);
}
void draw() {
background(0);
ambientLight(255,255,255);
pointLight(255, 255, 255, 0, 0, 0);
sun.show();
sun.orbit();
}
================================================
FILE: 009_SolarSystemGenerator3D_texture/Processing/CC_009_SolarSystemGenerator3D_texture/Planet.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/FGAwi7wpU8c
class Planet {
float radius;
float distance;
Planet[] planets;
float angle;
float orbitspeed;
PVector v;
PShape globe;
Planet(float r, float d, float o, PImage img) {
v = PVector.random3D();
radius = r;
distance = d;
v.mult(distance);
angle = random(TWO_PI);
orbitspeed = o;
noStroke();
noFill();
globe = createShape(SPHERE, radius);
globe.setTexture(img);
}
void orbit() {
angle = angle + orbitspeed;
if (planets != null) {
for (int i = 0; i < planets.length; i++) {
planets[i].orbit();
}
}
}
void spawnMoons(int total, int level) {
planets = new Planet[total];
for (int i = 0; i < planets.length; i++) {
float r = radius/(level*2);
float d = random((radius + r), (radius+r)*2);
float o = random(-0.1, 0.1);
int index = int(random(0,textures.length));
planets[i] = new Planet(r, d, o, textures[index]);
if (level < 2) {
int num = int(random(0,3));
planets[i].spawnMoons(num, level+1);
}
}
}
void show() {
pushMatrix();
noStroke();
PVector v2 = new PVector(1, 0, 1);
PVector p = v.cross(v2);
rotate(angle, p.x, p.y, p.z);
stroke(255);
//line(0, 0, 0, v.x, v.y, v.z);
//line(0, 0, 0, p.x, p.y, p.z);
translate(v.x, v.y, v.z);
noStroke();
fill(255);
shape(globe);
//sphere(radius);
//ellipse(0, 0, radius*2, radius*2);
if (planets != null) {
for (int i = 0; i < planets.length; i++) {
planets[i].show();
}
}
popMatrix();
}
}
================================================
FILE: 010_Maze_DFS/P5/cell.js
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Videos
// https://youtu.be/HyK_Q5rrcr4
// https://youtu.be/D8UgRyRnvXU
// https://youtu.be/8Ju_uxJ9v44
// https://youtu.be/_p5IH0L63wo
// Depth-first search
// Recursive backtracker
// https://en.wikipedia.org/wiki/Maze_generation_algorithm
function Cell(i, j) {
this.i = i;
this.j = j;
this.walls = [true, true, true, true];
this.visited = false;
this.checkNeighbors = function() {
let neighbors = [];
let top = grid[index(i, j - 1)];
let right = grid[index(i + 1, j)];
let bottom = grid[index(i, j + 1)];
let left = grid[index(i - 1, j)];
if (top && !top.visited) {
neighbors.push(top);
}
if (right && !right.visited) {
neighbors.push(right);
}
if (bottom && !bottom.visited) {
neighbors.push(bottom);
}
if (left && !left.visited) {
neighbors.push(left);
}
if (neighbors.length > 0) {
let r = floor(random(0, neighbors.length));
return neighbors[r];
} else {
return undefined;
}
};
this.highlight = function() {
let x = this.i * w;
let y = this.j * w;
noStroke();
fill(0, 0, 255, 100);
rect(x, y, w, w);
};
this.show = function() {
let x = this.i * w;
let y = this.j * w;
stroke(255);
if (this.walls[0]) {
line(x, y, x + w, y);
}
if (this.walls[1]) {
line(x + w, y, x + w, y + w);
}
if (this.walls[2]) {
line(x + w, y + w, x, y + w);
}
if (this.walls[3]) {
line(x, y + w, x, y);
}
if (this.visited) {
noStroke();
fill(255, 0, 255, 100);
rect(x, y, w, w);
}
};
}
================================================
FILE: 010_Maze_DFS/P5/index.html
================================================
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>maze_challenge</title>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/addons/p5.sound.min.js"></script>
<script type="text/javascript" src="sketch.js"></script>
<script type="text/javascript" src="cell.js"></script>
<style> body {padding: 20px; margin: 0;} canvas {vertical-align: top;} </style>
</head>
<body>
</body>
</html>
================================================
FILE: 010_Maze_DFS/P5/sketch.js
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Videos
// https://youtu.be/HyK_Q5rrcr4
// https://youtu.be/D8UgRyRnvXU
// https://youtu.be/8Ju_uxJ9v44
// https://youtu.be/_p5IH0L63wo
// Depth-first search
// Recursive backtracker
// https://en.wikipedia.org/wiki/Maze_generation_algorithm
let cols, rows;
let w = 20;
let grid = [];
let current;
let stack = [];
function setup() {
createCanvas(600, 600);
cols = floor(width / w);
rows = floor(height / w);
for (let j = 0; j < rows; j++) {
for (let i = 0; i < cols; i++) {
var cell = new Cell(i, j);
grid.push(cell);
}
}
current = grid[0];
}
function draw() {
background(51);
for (let i = 0; i < grid.length; i++) {
grid[i].show();
}
current.visited = true;
current.highlight();
// STEP 1
let next = current.checkNeighbors();
if (next) {
next.visited = true;
// STEP 2
stack.push(current);
// STEP 3
removeWalls(current, next);
// STEP 4
current = next;
} else if (stack.length > 0) {
current = stack.pop();
}
}
function index(i, j) {
if (i < 0 || j < 0 || i > cols - 1 || j > rows - 1) {
return -1;
}
return i + j * cols;
}
function removeWalls(a, b) {
let x = a.i - b.i;
if (x === 1) {
a.walls[3] = false;
b.walls[1] = false;
} else if (x === -1) {
a.walls[1] = false;
b.walls[3] = false;
}
let y = a.j - b.j;
if (y === 1) {
a.walls[0] = false;
b.walls[2] = false;
} else if (y === -1) {
a.walls[2] = false;
b.walls[0] = false;
}
}
================================================
FILE: 010_Maze_DFS/Processing/CC_010_Maze_DFS/CC_010_Maze_DFS.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Videos
// https://youtu.be/HyK_Q5rrcr4
// https://youtu.be/D8UgRyRnvXU
// https://youtu.be/8Ju_uxJ9v44
// https://youtu.be/_p5IH0L63wo
// Depth-first search
// Recursive backtracker
// https://en.wikipedia.org/wiki/Maze_generation_algorithm
int cols, rows;
int w = 20;
ArrayList<Cell> grid = new ArrayList<Cell>();
Cell current;
ArrayList<Cell> stack = new ArrayList<Cell>();
void setup() {
size(600, 600);
cols = floor(width/w);
rows = floor(height/w);
//frameRate(5);
for (int j = 0; j < rows; j++) {
for (int i = 0; i < cols; i++) {
Cell cell = new Cell(i, j);
grid.add(cell);
}
}
current = grid.get(0);
}
void draw() {
background(51);
for (int i = 0; i < grid.size(); i++) {
grid.get(i).show();
}
current.visited = true;
current.highlight();
// STEP 1
Cell next = current.checkNeighbors();
if (next != null) {
next.visited = true;
// STEP 2
stack.add(current);
// STEP 3
removeWalls(current, next);
// STEP 4
current = next;
} else if (stack.size() > 0) {
current = stack.remove(stack.size()-1);
}
}
int index(int i, int j) {
if (i < 0 || j < 0 || i > cols-1 || j > rows-1) {
return 0;
}
return i + j * cols;
}
void removeWalls(Cell a, Cell b) {
int x = a.i - b.i;
if (x == 1) {
a.walls[3] = false;
b.walls[1] = false;
} else if (x == -1) {
a.walls[1] = false;
b.walls[3] = false;
}
int y = a.j - b.j;
if (y == 1) {
a.walls[0] = false;
b.walls[2] = false;
} else if (y == -1) {
a.walls[2] = false;
b.walls[0] = false;
}
}
================================================
FILE: 010_Maze_DFS/Processing/CC_010_Maze_DFS/cell.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Videos
// https://youtu.be/HyK_Q5rrcr4
// https://youtu.be/D8UgRyRnvXU
// https://youtu.be/8Ju_uxJ9v44
// https://youtu.be/_p5IH0L63wo
// Depth-first search
// Recursive backtracker
// https://en.wikipedia.org/wiki/Maze_generation_algorithm
class Cell {
int i, j;
boolean[] walls = {true, true, true, true};
boolean visited = false;
Cell(int ii, int jj) {
i = ii;
j = jj;
}
Cell checkNeighbors() {
ArrayList<Cell> neighbors = new ArrayList<Cell>();
Cell top = grid.get(index(i, j-1));
Cell right = grid.get(index(i+1, j));
Cell bottom = grid.get(index(i, j+1));
Cell left = grid.get(index(i-1, j));
if (top != null && !top.visited) {
neighbors.add(top);
}
if (right != null && !right.visited) {
neighbors.add(right);
}
if (bottom != null && !bottom.visited) {
neighbors.add(bottom);
}
if (left != null && !left.visited) {
neighbors.add(left);
}
if (neighbors.size() > 0) {
int r = floor(random(0, neighbors.size()));
return neighbors.get(r);
} else {
return null;
}
}
void highlight() {
int x = this.i*w;
int y = this.j*w;
noStroke();
fill(0, 0, 255, 100);
rect(x, y, w, w);
}
void show() {
int x = this.i*w;
int y = this.j*w;
stroke(255);
if (this.walls[0]) {
line(x , y , x + w, y);
}
if (this.walls[1]) {
line(x + w, y , x + w, y + w);
}
if (this.walls[2]) {
line(x + w, y + w, x , y + w);
}
if (this.walls[3]) {
line(x , y + w, x , y);
}
if (this.visited) {
noStroke();
fill(255, 0, 255, 100);
rect(x, y, w, w);
}
}
}
================================================
FILE: 011_PerlinNoiseTerrain/P5/index.html
================================================
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Purple Rain</title>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/addons/p5.sound.min.js"></script>
<script type="text/javascript" src="sketch.js"></script>
</head>
<body>
</body>
</html>
================================================
FILE: 011_PerlinNoiseTerrain/P5/sketch.js
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/IKB1hWWedMk
// Edited by SacrificeProductions
var cols, rows;
var scl = 20;
var w = 1400;
var h = 1000;
var flying = 0;
var terrain = [];
function setup() {
createCanvas(600, 600, WEBGL);
cols = w / scl;
rows = h / scl;
for (var x = 0; x < cols; x++) {
terrain[x] = [];
for (var y = 0; y < rows; y++) {
terrain[x][y] = 0; //specify a default value for now
}
}
}
function draw() {
flying -= 0.1;
var yoff = flying;
for (var y = 0; y < rows; y++) {
var xoff = 0;
for (var x = 0; x < cols; x++) {
terrain[x][y] = map(noise(xoff, yoff), 0, 1, -100, 100);
xoff += 0.2;
}
yoff += 0.2;
}
background(0);
translate(0, 50);
rotateX(PI / 3);
fill(200, 200, 200, 50);
translate(-w / 2, -h / 2);
for (var y = 0; y < rows - 1; y++) {
beginShape(TRIANGLE_STRIP);
for (var x = 0; x < cols; x++) {
vertex(x * scl, y * scl, terrain[x][y]);
vertex(x * scl, (y + 1) * scl, terrain[x][y + 1]);
}
endShape();
}
}
================================================
FILE: 011_PerlinNoiseTerrain/Processing/CC_011_PerlinNoiseTerrain/CC_011_PerlinNoiseTerrain.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/IKB1hWWedMk
int cols, rows;
int scl = 20;
int w = 2000;
int h = 1600;
float flying = 0;
float[][] terrain;
void setup() {
size(600, 600, P3D);
cols = w / scl;
rows = h/ scl;
terrain = new float[cols][rows];
}
void draw() {
flying -= 0.1;
float yoff = flying;
for (int y = 0; y < rows; y++) {
float xoff = 0;
for (int x = 0; x < cols; x++) {
terrain[x][y] = map(noise(xoff, yoff), 0, 1, -100, 100);
xoff += 0.2;
}
yoff += 0.2;
}
background(0);
stroke(255);
noFill();
translate(width/2, height/2+50);
rotateX(PI/3);
translate(-w/2, -h/2);
for (int y = 0; y < rows-1; y++) {
beginShape(TRIANGLE_STRIP);
for (int x = 0; x < cols; x++) {
vertex(x*scl, y*scl, terrain[x][y]);
vertex(x*scl, (y+1)*scl, terrain[x][y+1]);
//rect(x*scl, y*scl, scl, scl);
}
endShape();
}
}
================================================
FILE: 012_LorenzAttractor/P5/index.html
================================================
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>lorenz-attractor</title>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/addons/p5.sound.min.js"></script>
<script type="text/javascript" src="sketch.js"></script>
<style>
body {
margin:0;
margin-left:45px;
padding:0;
overflow: hidden;
}
canvas {
margin:auto;
}
</style>
</head>
<body>
</body>
</html>
================================================
FILE: 012_LorenzAttractor/P5/sketch.js
================================================
let x = 0.01;
let y = 0;
let z = 0;
let a = 10;
let b = 28;
let c = 8.0 / 3.0;
let points = new Array();
function setup() {
createCanvas(800, 600, WEBGL);
colorMode(HSB);
}
function draw() {
background(0);
let dt = 0.01;
let dx = a * (y - x) * dt;
let dy = (x * (b - z) - y) * dt;
let dz = (x * y - c * z) * dt;
x = x + dx;
y = y + dy;
z = z + dz;
points.push(new p5.Vector(x, y, z));
translate(0, 0, -80);
let camX = map(mouseX, 0, width, -200, 200);
let camY = map(mouseY, 0, height, -200, 200);
camera(camX, camY, height / 2.0 / tan((PI * 30.0) / 180.0), 0, 0, 0, 0, 1, 0);
//translate(width/2, height/2);
scale(5);
stroke(255);
noFill();
let hu = 0;
beginShape();
for (let v of points) {
stroke(hu, 255, 255);
vertex(v.x, v.y, v.z);
//var offset = p5.Vector.random3D();
//offset.mult(0.1);
//v.add(offset);
hu += 1;
if (hu > 255) {
hu = 0;
}
}
endShape();
//println(x,y,z);
}
================================================
FILE: 012_LorenzAttractor/Processing/CC_012_LorenzAttractor/CC_012_LorenzAttractor.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for this video: https://youtu.be/f0lkz2gSsIk
import peasy.*;
float x = 0.01;
float y = 0;
float z = 0;
float a = 10;
float b = 28;
float c = 8.0/3.0;
ArrayList<PVector> points = new ArrayList<PVector>();
PeasyCam cam;
void setup() {
size(800, 600, P3D);
colorMode(HSB);
cam = new PeasyCam(this, 500);
}
void draw() {
background(0);
float dt = 0.01;
float dx = (a * (y - x))*dt;
float dy = (x * (b - z) - y)*dt;
float dz = (x * y - c * z)*dt;
x = x + dx;
y = y + dy;
z = z + dz;
points.add(new PVector(x, y, z));
translate(0, 0, -80);
//translate(width/2, height/2);
scale(5);
stroke(255);
noFill();
float hu = 0;
beginShape();
for (PVector v : points) {
stroke(hu, 255, 255);
vertex(v.x, v.y,v.z);
//PVector offset = PVector.random3D();
//offset.mult(0.1);
//v.add(offset);
hu += 0.1;
if (hu > 255) {
hu = 0;
}
}
endShape();
//println(x,y,z);
}
================================================
FILE: 013_ReactionDiffusion/P5/index.html
================================================
<html>
<head>
<meta charset="UTF-8">
<script language="javascript" type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.min.js"></script>
<!-- uncomment lines below to include extra p5 libraries -->
<!---->
<!--<script language="javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/addons/p5.sound.min.js"></script>-->
<script language="javascript" type="text/javascript" src="sketch.js"></script>
<!-- this line removes any default padding and style. you might only need one of these values set. -->
<style> body {padding: 0; margin: 0;} </style>
</head>
<body>
</body>
</html>
================================================
FILE: 013_ReactionDiffusion/P5/sketch.js
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for this video: https://youtu.be/BV9ny785UNc
// Written entirely based on
// http://www.karlsims.com/rd.html
// Also, for reference
// http://hg.postspectacular.com/toxiclibs/src/44d9932dbc9f9c69a170643e2d459f449562b750/src.sim/toxi/sim/grayscott/GrayScott.java?at=default
var grid;
var next;
var dA = 1;
var dB = 0.5;
var feed = 0.055;
var k = 0.062;
function setup() {
createCanvas(200, 200);
pixelDensity(1);
grid = [];
next = [];
for (var x = 0; x < width; x++) {
grid[x] = [];
next[x] = [];
for (var y = 0; y < height; y++) {
grid[x][y] = {
a: 1,
b: 0
};
next[x][y] = {
a: 1,
b: 0
};
}
}
for (var i = 100; i < 110; i++) {
for (var j = 100; j < 110; j++) {
grid[i][j].b = 1;
}
}
}
function draw() {
background(51);
for (var x = 1; x < width - 1; x++) {
for (var y = 1; y < height - 1; y++) {
var a = grid[x][y].a;
var b = grid[x][y].b;
next[x][y].a = a + dA * laplaceA(x, y) - a * b * b + feed * (1 - a);
next[x][y].b = b + dB * laplaceB(x, y) + a * b * b - (k + feed) * b;
next[x][y].a = constrain(next[x][y].a, 0, 1);
next[x][y].b = constrain(next[x][y].b, 0, 1);
}
}
loadPixels();
for (var x = 0; x < width; x++) {
for (var y = 0; y < height; y++) {
var pix = (x + y * width) * 4;
var a = next[x][y].a;
var b = next[x][y].b;
var c = floor((a - b) * 255);
c = constrain(c, 0, 255);
pixels[pix + 0] = c;
pixels[pix + 1] = c;
pixels[pix + 2] = c;
pixels[pix + 3] = 255;
}
}
updatePixels();
swap();
}
function laplaceA(x, y) {
var sumA = 0;
sumA += grid[x][y].a * -1;
sumA += grid[x - 1][y].a * 0.2;
sumA += grid[x + 1][y].a * 0.2;
sumA += grid[x][y + 1].a * 0.2;
sumA += grid[x][y - 1].a * 0.2;
sumA += grid[x - 1][y - 1].a * 0.05;
sumA += grid[x + 1][y - 1].a * 0.05;
sumA += grid[x + 1][y + 1].a * 0.05;
sumA += grid[x - 1][y + 1].a * 0.05;
return sumA;
}
function laplaceB(x, y) {
var sumB = 0;
sumB += grid[x][y].b * -1;
sumB += grid[x - 1][y].b * 0.2;
sumB += grid[x + 1][y].b * 0.2;
sumB += grid[x][y + 1].b * 0.2;
sumB += grid[x][y - 1].b * 0.2;
sumB += grid[x - 1][y - 1].b * 0.05;
sumB += grid[x + 1][y - 1].b * 0.05;
sumB += grid[x + 1][y + 1].b * 0.05;
sumB += grid[x - 1][y + 1].b * 0.05;
return sumB;
}
function swap() {
var temp = grid;
grid = next;
next = temp;
}
================================================
FILE: 013_ReactionDiffusion/Processing/CC_013_ReactionDiffusion/CC_013_ReactionDiffusion.pde
================================================
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for this video: https://youtu.be/BV9ny785UNc
// Written entirely based on
// http://www.karlsims.com/rd.html
// Also, for reference
// http://hg.postspectacular.com/toxiclibs/src/44d9932dbc9f9c69a170643e2d459f449562b750/src.sim/toxi/sim/grayscott/GrayScott.java?at=default
Cell[][] grid;
Cell[][] prev;
void setup() {
size(300, 300);
grid = new Cell[width][height];
prev = new Cell[width][height];
for (int i = 0; i < width; i++) {
for (int j = 0; j < height; j ++) {
float a = 1;
float b = 0;
grid[i][j] = new Cell(a, b);
prev[i][j] = new Cell(a, b);
}
}
for (int n = 0; n < 10; n++) {
int startx = int(random(20, width-20));
int starty = int(random(20, height-20));
for (int i = startx; i < startx+10; i++) {
for (int j = starty; j < starty+10; j ++) {
float a = 1;
float b = 1;
grid[i][j] = new Cell(a, b);
prev[i][j] = new Cell(a, b);
}
}
}
}
float dA = 1.0;
float dB = 0.5;
float feed = 0.055;
float k = 0.062;
class Cell {
float a;
float b;
Cell(float a_, float b_) {
a = a_;
b = b_;
}
}
void update() {
for (int i = 1; i < width-1; i++) {
for (int j = 1; j < height-1; j ++) {
Cell spot = prev[i][j];
Cell newspot = grid[i][j];
float a = spot.a;
float b = spot.b;
float laplaceA = 0;
laplaceA += a*-1;
laplaceA += prev[i+1][j].a*0.2;
laplaceA += prev[i-1][j].a*0.2;
laplaceA += prev[i][j+1].a*0.2;
laplaceA += prev[i][j-1].a*0.2;
laplaceA += prev[i-1][j-1].a*0.05;
laplaceA += prev[i+1][j-1].a*0.05;
laplaceA += prev[i-1][j+1].a*0.05;
laplaceA += prev[i+1][j+1].a*0.05;
float laplaceB = 0;
laplaceB += b*-1;
laplaceB += prev[i+1][j].b*0.2;
laplaceB += prev[i-1][j].b*0.2;
laplaceB += prev[i][j+1].b*0.2;
laplaceB += prev[i][j-1].b*0.2;
laplaceB += prev[i-1][j-1].b*0.05;
laplaceB += prev[i+1][j-1].b*0.05;
laplaceB += prev[i-1][j+1].b*0.05;
laplaceB += prev[i+1][j+1].b*0.05;
newspot.a = a + (dA*laplaceA - a*b*b + feed*(1-a))*1;
newspot.b = b + (dB*laplaceB + a*b*b - (k+feed)*b)*1;
newspot.a = constrain(newspot.a, 0, 1);
newspot.b = constrain(newspot.b, 0, 1);
}
}
}
void swap() {
Cell[][] temp = prev;
prev = grid;
grid = temp;
}
void draw() {
println(frameRate);
for (int i = 0; i < 1; i++) {
update();
swap();
}
loadPixels();
for (int i = 1; i < width-1; i++) {
for (int j = 1; j < height-1; j ++) {
Cell spot = grid[i][j];
float a = spot.a;
float b = spot.b;
int pos = i + j * width;
pixels[pos] = color((a-b)*255);
}
}
updatePixels();
}
================================================
FILE: 014_FractalTree/P5/index.html
================================================
<html>
<head>
<meta charset="UTF-8">
<script language="javascript" type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.min.js"></script>
<!-- uncomment lines below to include extra p5 libraries -->
<!--<script language="javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/addons/p5.sound.min.js"></script>-->
<script language="javascript" type="text/javascript" src="sketch.js"></script>
<!-- this line removes any default padding and style. you might only need one of these values set. -->
<style> body {padding: 0; margin: 0;} </style>
</head>
<body>
</body>
</html>
================================================
FILE: 014_FractalTree/P5/sketch.js
================================================
// Fractal Tree
// The Coding Train / Daniel Shiffman
// https://thecodingtrain.com/challenges/14-fractal-trees-recursive
// https://youtu.be/0jjeOYMjmDU
// https://editor.p5js.org/codingtrain/sketches/xTjmYXU3q
let angle = 0;
let slider;
function setup() {
createCanvas(640, 360);
slider = createSlider(0, TWO_PI, PI / 4, 0.01);
}
function draw() {
background(0);
angle = slider.value();
stroke(255);
strokeWeight(2);
translate(width * 0.5, height);
branch(100);
}
function branch(len) {
line(0, 0, 0, -len);
translate(0, -len);
if (len > 4) {
push();
rotate(angle);
branch(len * 0.67);
pop();
push();
rotate(-angle);
branch(len * 0.67);
pop();
}
}
================================================
FILE: 014_FractalTree/Processing/CC_014_FractalTree/CC_014_FractalTree.pde
================================================
// Coding Train
// Ported to processing by Max (https://github.com/TheLastDestroyer)
// Origional JS by Daniel Shiffman
// http://patreon.com/codingtrain
// Code for: https://youtu.be/0jjeOYMjmDU
float angle = 45;
float branch_ratio = 0.67;
void setup(){
size(400,400);
}
void draw(){
background(51);
stroke(255);
translate(width/2, height);
branch(100);
}
void branch(float len){
line(0,0,0,-len);
translate(0, -len);
if (len > 4){
pushMatrix();
rotate(angle);
branch(len * branch_ratio);
popMatrix();
pushMatrix();
rotate(-angle);
branch(len * branch_ratio);
popMatrix();
}
}
void mouseWheel(MouseEvent event){
angle += event.getCount()/10.0;
}
================================================
FILE: 015_FractalTreeArray/P5/branch.js
================================================
function Branch(begin, end) {
this.begin = begin;
this.end = end;
this.finished = false;
this.jitter = function() {
this.end.x += random(-1, 1);
this.end.y += random(-1, 1);
};
this.show = function() {
stroke(255);
line(this.begin.x, this.begin.y, this.end.x, this.end.y);
};
this.branchA = function() {
var dir = p5.Vector.sub(this.end, this.begin);
dir.rotate(PI / 6);
dir.mult(0.67);
var newEnd = p5.Vector.add(this.end, dir);
var b = new Branch(this.end, newEnd);
return b;
};
this.branchB = function() {
var dir = p5.Vector.sub(this.end, this.begin);
dir.rotate(-PI / 4);
dir.mult(0.67);
var newEnd = p5.Vector.add(this.end, dir);
var b = new Branch(this.end, newEnd);
return b;
};
}
================================================
FILE: 015_FractalTreeArray/P5/index.html
================================================
<html>
<head>
<meta charset="UTF-8">
<script language="javascript" type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.min.js"></script>
<!-- uncomment lines below to include extra p5 libraries -->
<!--<script language="javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/addons/p5.sound.min.js"></script>-->
<script language="javascript" type="text/javascript" src="sketch.js"></script>
<script language="javascript" type="text/javascript" src="branch.js"></script>
<!-- this line removes any default padding and style. you might only need one of these values set. -->
<style> body {padding: 0; margin: 0;} </style>
</head>
<body>
</body>
</html>
================================================
FILE: 015_FractalTreeArray/P5/sketch.js
================================================
// Coding Rainbow
// Daniel Shiffman
// http://patreon.com/codingtrain
// Code for: https://youtu.be/fcdNSZ9IzJM
var tree = [];
var leaves = [];
var count = 0;
function setup() {
createCanvas(400, 400);
var a = createVector(width / 2, height);
var b = createVector(width / 2, height - 100);
var root = new Branch(a, b);
tree[0] = root;
}
function mousePressed() {
for (var i = tree.length - 1; i >= 0; i--) {
if (!tree[i].finished) {
tree.push(tree[i].branchA());
tree.push(tree[i].branchB());
}
tree[i].finished = true;
}
count++;
if (count === 6) {
for (var i = 0; i < tree.length; i++) {
if (!tree[i].finished) {
var leaf = tree[i].end.copy();
leaves.push(leaf);
}
}
}
}
function draw() {
background(51);
for (var i = 0; i < tree.length; i++) {
tree[i].show();
//tree[i].jitter();
}
for (var i = 0; i < leaves.length; i++) {
fill(255, 0, 100, 100);
noStroke();
ellipse(leaves[i].x, leaves[i].y, 8, 8);
leaves[i].y += random(0, 2);
}
}
================================================
FILE: 015_FractalTreeArray/Processing/CC_015_FractalTreeArray/Branch.pde
================================================
/**
* representing a Branch of the FractalTree
* @author Lukas Klassen
*/
class Branch{
/**
* Start and end Point of the Branch
*/
public PVector begin;
public PVector end;
public boolean finished = false;
/**
* create Branch with beginning and end-Point
* @param beging Startpoint
* @param end Endpoint
*/
Branch(PVector begin, PVector end){
this.begin = begin;
this.end = end;
}
/**
* jitters the Branch (randomly change the end-Point a bit)
*/
void jitter(){
end.x += random(-1, 1);
end.y += random(-1, 1);
}
/**
* displays the Branch
*/
void show(){
stroke(255);
line(begin.x, begin.y, end.x, end.y);
}
/**
* generates a new Branch for the right-side
*/
Branch branchA(){
PVector dir = PVector.sub(end, begin);
dir.rotate(PI / 6);
dir.mult(0.67);
PVector newEnd = PVector.add(end, dir);
Branch b = new Branch(end, newEnd);
return b;
}
/**
* generates a new Branch for the left-side
*/
Branch branchB(){
PVector dir = PVector.sub(end, begin);
dir.rotate(- PI / 4);
dir.mult(0.67);
PVector newEnd = PVector.add(end, dir);
Branch b = new Branch(end, newEnd);
return b;
}
}
================================================
FILE: 015_FractalTreeArray/Processing/CC_015_FractalTreeArray/CC_015_FractalTreeArray.pde
================================================
/**
* makes a FractalTree using Array(Lists)
* adds one Level per MouseClick
* at Level 6 Leaves will fall down
* @author Lukas Klassen
* translated version of CC_015_FractalTreeArray by Daniel Shiffmann
*/
/**
* global reference to Trees, Leaves and the amount of Levels
*/
ArrayList<Branch> tree = new ArrayList<Branch>();
ArrayList<PVector> leaves = new ArrayList<PVector>();
int count = 0;
/**
* sets the Tree up
*/
void setup(){
size(400,400);
//create root-Branch
PVector a = new PVector(width / 2, height);
PVector b = new PVector(width / 2, height - 100);
Branch root = new Branch(a, b);
tree.add(root);
}
/**
* adds another Layer every time the Mouse is pressed
*/
void mousePressed(){
for(int i = tree.size() -1; i >= 0; i--){
Branch current = tree.get(i);
//if the current Branch has no children: add them
if(!current.finished){
tree.add(current.branchA());
tree.add(current.branchB());
}
//now that Branch has children
current.finished = true;
}
//new Level added
count ++;
//on the 6. Level: spawn the Leaves
if(count == 6){
for(int i = 0; i < tree.size(); i++){
Branch current = tree.get(i);
//if the current Branch is on the last Level
if(!current.finished){
PVector leaf = current.end.copy();
leaves.add(leaf);
}
}
}
}
/**
* Displays the Tree
*/
void draw(){
background(51);
//forEach Branch of the Tree: Draw it
for(int i = 0; i < tree.size(); i++){
tree.get(i).show();
}
//forEach Leave: draw it
for(int i = 0; i < leaves.size(); i++){
fill(255, 0, 100, 100);
noStroke();
PVector leave = leaves.get(i);
ellipse(leave.x, leave.y, 8, 8);
//let the Leave fall
leave.y += random(0, 2);
}
}
================================================
FILE: 016_LSystem/P5/index.html
================================================
<html>
<head>
<meta charset="UTF-8">
<script language="javascript" type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.min.js"></script>
<!-- uncomment lines below to include extra p5 libraries -->
<!--<script language="javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/addons/p5.sound.min.js"></script>-->
<script language="javascript" type="text/javascript" src="sketch.js"></script>
<!-- this line removes any default padding and style. you might only need one of these values set. -->
</head>
<body>
</body>
</html>
================================================
FILE: 016_LSystem/P5/sketch.js
================================================
// Coding Rainbow
// Daniel Shiffman
// http://patreon.com/codingtrain
// Code for: https://youtu.be/E1B4UoSQMFw
// variables: A B
// axiom: A
// rules: (A → AB), (B → A)
var angle;
var axiom = 'F';
var sentence = axiom;
var len = 100;
var rules = [];
rules[0] = {
a: 'F',
b: 'FF+[+F-F-F]-[-F+F+F]'
};
function generate() {
len *= 0.5;
var nextSentence = '';
for (var i = 0; i < sentence.length; i++) {
var current = sentence.charAt(i);
var found = false;
for (var j = 0; j < rules.length; j++) {
if (current == rules[j].a) {
found = true;
nextSentence += rules[j].b;
break;
}
}
if (!found) {
nextSentence += current;
}
}
sentence = nextSentence;
createP(sentence);
turtle();
}
function turtle() {
background(51);
resetMatrix();
translate(width / 2, height);
stroke(255, 100);
for (var i = 0; i < sentence.length; i++) {
var current = sentence.charAt(i);
if (current == 'F') {
line(0, 0, 0, -len);
translate(0, -len);
} else if (current == '+') {
rotate(angle);
} else if (current == '-') {
rotate(-angle);
} else if (current == '[') {
push();
} else if (current == ']') {
pop();
}
}
}
function setup() {
createCanvas(400, 400);
angle = radians(25);
background(51);
createP(axiom);
turtle();
var button = createButton('generate');
button.mousePressed(generate);
}
================================================
FILE: 016_LSystem/Processing/CC_016_LSystem/CC_016_LSystem.pde
================================================
// Coding Train
// Ported to processing by Max (https://github.com/TheLastDestroyer)
// Origional JS by Daniel Shiffman
// http://patreon.com/codingtrain
// Code for: https://youtu.be/E1B4UoSQMFw
// variables: A B
// axiom: A
// rules: (A → AB), (B → A)
float angle;
String axiom = "F";
String sentence = axiom;
int len = 100;
Rule[] rules;
void setup(){
size(400,400);
rules = new Rule[1];
rules[0] = new Rule('F', "FF+[+F-F-F]-[-F+F+F]");
angle = radians(45);
background(51);
println(axiom);
turtle();
}
void draw(){
}
void mouseClicked(){
println("click");
generate();
}
class Rule {
char a;
String b;
Rule(char _a, String _b){
a = _a;
b = _b;
}
}
void generate(){
len *= 0.5;
String next_sentence = "";
for (int i = 0; i < sentence.length(); i++){
char current = sentence.charAt(i);
boolean found = false;
for (int j = 0; j < rules.length; j++){
if (current == rules[j].a){
found = true;
next_sentence += rules[j].b;
break;
}
}
if (!found){
next_sentence += current;
}
}
sentence = next_sentence;
println(sentence);
turtle();
}
void turtle(){
background(51);
resetMatrix();
translate(width/2, height);
stroke(255, 100);
for (int i = 0; i < sentence.length(); i++) {
char current = sentence.charAt(i);
if (current == 'F') {
line(0, 0, 0, -len);
translate(0, -len);
} else if (current == '+') {
rotate(angle);
} else if (current == '-') {
rotate(-angle);
} else if (current == '[') {
pushMatrix();
} else if (current == ']') {
popMatrix();
}
}
}
================================================
FILE: 017_SpaceColonizer/P5/branch.js
================================================
// Coding Rainbow
// Daniel Shiffman
// http://patreon.com/codingtrain
// Code for: https://youtu.be/kKT0v3qhIQY
function Branch(parent, pos, dir) {
this.pos = pos;
this.parent = parent;
this.dir = dir;
this.origDir = this.dir.copy();
this.count = 0;
this.len = 5;
this.reset = function() {
this.dir = this.origDir.copy();
this.count = 0;
};
this.next = function() {
var nextDir = p5.Vector.mult(this.dir, this.len);
var nextPos = p5.Vector.add(this.pos, nextDir);
var nextBranch = new Branch(this, nextPos, this.dir.copy());
return nextBranch;
};
this.show = function() {
if (parent != null) {
stroke(255);
line(this.pos.x, this.pos.y, this.parent.pos.x, this.parent.pos.y);
}
};
}
================================================
FILE: 017_SpaceColonizer/P5/index.html
================================================
<html>
<head>
<meta charset="UTF-8">
<script language="javascript" type="text/javascript" src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.min.js"></script>
<script language="javascript" type="text/javascript" src="sketch.js"></script>
<script language="javascript" type="text/javascript" src="branch.js"></script>
<script language="javascript" type="text/javascript" src="tree.js"></script>
<script language="javascript" type="text/javascript" src="leaf.js"></script>
</head>
<body>
</body>
</html>
================================================
FILE: 017_SpaceColonizer/P5/leaf.js
================================================
// Coding Rainbow
// Daniel Shiffman
// http://patreon.com/codingtrain
// Code for: https://youtu.be/kKT0v3qhIQY
function Leaf() {
this.pos = createVector(random(width), random(height - 100));
this.reached = false;
this.show = function() {
fill(255);
noStroke();
ellipse(this.pos.x, this.pos.y, 4, 4);
};
}
================================================
FILE: 017_SpaceColonizer/P5/sketch.js
================================================
// Coding Rainbow
// Daniel Shiffman
// http://patreon.com/codingtrain
// Code for: https://youtu.be/kKT0v3qhIQY
var tree;
var max_dist = 100;
var min_dist = 10;
function setup() {
createCanvas(400, 400);
tree = new Tree();
}
function draw() {
background(51);
tree.show();
tree.grow();
}
================================================
FILE: 017_SpaceColonizer/P5/tree.js
================================================
// Coding Rainbow
// Daniel Shiffman
// http://patreon.com/codingtrain
// Code for: https://youtu.be/kKT0v3qhIQY
function Tree() {
this.leaves = [];
this.branches = [];
for (var i = 0; i < 1500; i++) {
this.leaves.push(new Leaf());
}
var pos = createVector(width / 2, height);
var dir = createVector(0, -1);
var root = new Branch(null, pos, dir);
this.branches.push(root);
var current = root;
var found = false;
while (!found) {
for (var i = 0; i < this.leaves.length; i++) {
var d = p5.Vector.dist(current.pos, this.leaves[i].pos);
if (d < max_dist) {
found = true;
}
}
if (!found) {
var branch = current.next();
current = branch;
this.branches.push(current);
}
}
this.grow = function() {
for (var i = 0; i < this.leaves.length; i++) {
var leaf = this.leaves[i];
var closestBranch = null;
var record = max_dist;
for (var j = 0; j < this.branches.length; j++) {
var branch = this.branches[j];
var d = p5.Vector.dist(leaf.pos, branch.pos);
if (d < min_dist) {
leaf.reached = true;
closestBranch = null;
break;
} else if (d < record) {
closestBranch = branch;
record = d;
}
}
if (closestBranch != null) {
var newDir = p5.Vector.sub(leaf.pos, closestBranch.pos);
newDir.normalize();
closestBranch.dir.add(newDir);
closestBranch.count++;
}
}
for (var i = this.leaves.length - 1; i >= 0; i--) {
if (this.leaves[i].reached) {
this.leaves.splice(i, 1);
}
}
for (var i = this.branches.length - 1; i >= 0; i--) {
var branch = this.branches[i];
if (branch.count > 0) {
branch.dir.div(branch.count + 1);
this.branches.push(branch.next());
branch.reset();
}
}
};
this.show = function() {
for (var i = 0; i < this.leaves.length; i++) {
this.leaves[i].show();
}
for (var i = 0; i < this.branches.length; i++) {
this.branches[i].show();
}
};
}
================================================
FILE: 017_SpaceColonizer/Processing/CC_017_SpaceColonizer/Branch.pde
================================================
// Coding Rainbow
// Daniel Shiffman
// http://patreon.com/codingtrain
// Code for: https://youtu.be/kKT0v3qhIQY
class Branch {
Branch parent;
PVector pos;
PVector dir;
int count = 0;
PVector saveDir;
float len = 5;
Branch(PVector v, PVector d) {
parent = null;
pos = v.copy();
dir = d.copy();
saveDir = dir.copy();
}
Branch(Branch p) {
parent = p;
pos = parent.next();
dir = parent.dir.copy();
saveDir = dir.copy();
}
void reset() {
count = 0;
dir = saveDir.copy();
}
PVector next() {
PVector v = PVector.mult(dir, len);
PVector next = PVector.add(pos, v);
return next;
}
}
================================================
FILE: 017_SpaceColonizer/Processing/CC_017_SpaceColonizer/CC_017_SpaceColonizer.pde
================================================
// Coding Rainbow
// Daniel Shiffman
// http://patreon.com/codingtrain
// Code for: https://youtu.be/kKT0v3qhIQY
Tree tree;
float min_dist = 10;
float max_dist = 100;
void setup() {
size(600, 600);
tree = new Tree();
}
void draw() {
background(51);
tree.show();
tree.grow();
}
================================================
FILE: 017_SpaceColonizer/Processing/CC_017_SpaceColonizer/Leaf.pde
================================================
// Coding Rainbow
// Daniel Shiffman
// http://patreon.com/codingtrain
// Code for: https://youtu.be/kKT0v3qhIQY
class Leaf {
PVector pos;
boolean reached = false;
Leaf() {
pos = PVector.random2D();
pos.mult(random(width/2));
pos.x += width/2;
pos.y += height/2;
//pos = new PVector(random(10, width-10), random(10, height-40));
}
void reached() {
reached = true;
}
void show() {
fill(255);
noStroke();
ellipse(pos.x, pos.y, 4, 4);
}
}
================================================
FILE: 017_SpaceColonizer/Processing/CC_017_SpaceColonizer/Tree.pde
================================================
// Coding Rainbow
// Daniel Shiffman
// http://patreon.com/codingtrain
// Code for: https://youtu.be/kKT0v3qhIQY
class Tree {
ArrayList<Branch> branches = new ArrayList<Branch>();
ArrayList<Leaf> leaves = new ArrayList<Leaf>();
Tree() {
for (int i = 0; i < 2000; i++) {
leaves.add(new Leaf());
}
Branch root = new Branch(new PVector(width/2, height), new PVector(0, -1));
branches.add(root);
Branch current = new Branch(root);
while (!closeEnough(current)) {
Branch trunk = new Branch(current);
branches.add(trunk);
current = trunk;
}
}
boolean closeEnough(Branch b) {
for (Leaf l : leaves) {
float d = PVector.dist(b.pos, l.pos);
if (d < max_dist) {
return true;
}
}
return false;
}
void grow() {
for (Leaf l : leaves) {
Branch closest = null;
PVector closestDir = null;
float record = -1;
for (Branch b : branches) {
PVector dir = PVector.sub(l.pos, b.pos);
float d = dir.mag();
if (d < min_dist) {
l.reached();
closest = null;
break;
} else if (d > max_dist) {
} else if (closest == null || d < record) {
closest = b;
closestDir = dir;
record = d;
}
}
if (closest != null) {
closestDir.normalize();
closest.dir.add(closestDir);
closest.count++;
}
}
for (int i = leaves.size()-1; i >= 0; i--) {
if (leaves.get(i).reached) {
leaves.remove(i);
}
}
for (int i = branches.size()-1; i >= 0; i--) {
Branch b = branches.get(i);
if (b.count > 0) {
b.dir.div(b.count);
b.dir.normalize();
Branch newB = new Branch(b);
branches.add(newB);
b.reset();
}
}
}
void show() {
for (Leaf l : leaves) {
l.show();
}
for (Branch b : branches) {
if (b.parent != null) {
stroke(255);
line(b.pos.x, b.pos.y, b.parent.pos.x, b.parent.pos.y);
}
}
}
}
================================================
FILE: 018_SpaceColonizer3D/Processing/CC_018_SpaceColonizer3D/Branch.pde
================================================
// Coding Rainbow
// Daniel Shiffman
// http://patreon.com/codingtrain
// Code for: https://youtu.be/JcopTKXt8L8
class Branch {
Branch parent;
PVector pos;
PVector dir;
int count = 0;
PVector saveDir;
float len = 5;
Branch(PVector v, PVector d) {
parent = null;
pos = v.copy();
dir = d.copy();
saveDir = dir.copy();
}
Branch(Branch p) {
parent = p;
pos = parent.next();
dir = parent.dir.copy();
saveDir = dir.copy();
}
void reset() {
count = 0;
dir = saveDir.copy();
}
PVector next() {
PVector v = PVector.mult(dir, len);
PVector next = PVector.add(pos, v);
return next;
}
}
================================================
FILE: 018_SpaceColonizer3D/Processing/CC_018_SpaceColonizer3D/CC_018_SpaceColonizer3D.pde
================================================
// Coding Rainbow
// Daniel Shiffman
// http://patreon.com/codingtrain
// Code for: https://youtu.be/JcopTKXt8L8
import peasy.*;
Tree tree;
PeasyCam cam;
float min_dist = 5;
float max_dist = 200;
void setup() {
size(600, 900, P3D);
cam = new PeasyCam(this, 500);
tree = new Tree();
}
void draw() {
background(51);
tree.show();
tree.grow();
}
================================================
FILE: 018_SpaceColonizer3D/Processing/CC_018_SpaceColonizer3D/Leaf.pde
================================================
// Coding Rainbow
// Daniel Shiffman
// http://patreon.com/codingtrain
// Code for: https://youtu.be/JcopTKXt8L8
class Leaf {
PVector pos;
boolean reached = false;
Leaf() {
pos = PVector.random3D();
pos.mult(random(width/2));
pos.y -= height/4;
}
void reached() {
reached = true;
}
void show() {
fill(255);
noStroke();
pushMatrix();
translate(pos.x, pos.y, pos.z);
//sphere(4);
ellipse(0,0, 4, 4);
popMatrix();
}
}
================================================
FILE: 018_SpaceColonizer3D/Processing/CC_018_SpaceColonizer3D/Tree.pde
================================================
// Coding Rainbow
// Daniel Shiffman
// http://patreon.com/codingtrain
// Code for: https://youtu.be/JcopTKXt8L8
class Tree {
ArrayList<Branch> branches = new ArrayList<Branch>();
ArrayList<Leaf> leaves = new ArrayList<Leaf>();
Tree() {
for (int i = 0; i < 2000; i++) {
leaves.add(new Leaf());
}
Branch root = new Branch(new PVector(0,height/2), new PVector(0, -1));
branches.add(root);
Branch current = new Branch(root);
while (!closeEnough(current)) {
Branch trunk = new Branch(current);
branches.add(trunk);
current = trunk;
}
}
boolean closeEnough(Branch b) {
for (Leaf l : leaves) {
float d = PVector.dist(b.pos, l.pos);
if (d < max_dist) {
return true;
}
}
return false;
}
void grow() {
for (Leaf l : leaves) {
Branch closest = null;
PVector closestDir = null;
float record = -1;
for (Branch b : branches) {
PVector dir = PVector.sub(l.pos, b.pos);
float d = dir.mag();
if (d < min_dist) {
l.reached();
closest = null;
break;
} else if (d > max_dist) {
} else if (closest == null || d < record) {
closest = b;
closestDir = dir;
record = d;
}
}
if (closest != null) {
closestDir.normalize();
closest.dir.add(closestDir);
closest.count++;
}
}
for (int i = leaves.size()-1; i >= 0; i--) {
if (leaves.get(i).reached) {
leaves.remove(i);
}
}
for (int i = branches.size()-1; i >= 0; i--) {
Branch b = branches.get(i);
if (b.count > 0) {
b.dir.div(b.count);
PVector rand = PVector.random2D();
rand.setMag(0.3);
b.dir.add(rand);
b.dir.normalize();
Branch newB = new Branch(b);
branches.add(newB);
b.reset();
}
}
}
void show() {
for (Leaf l : leaves) {
l.show();
}
//for (Branch b : branches) {
for (int i = 0; i < branches.size(); i++) {
Branch b = branches.get(i);
if (b.parent != null) {
float sw = map(i, 0, branches.size(), 6, 0);
strokeWeight(sw);
stroke(255);
line(b.pos.x, b.pos.y, b.pos.z, b.parent.pos.x, b.parent.pos.y, b.parent.pos.z);
}
}
}
}
================================================
FILE: 019_Superellipse/P5/index.html
================================================
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Superellipse</title>
<script src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.min.js"></script>
<script src="sketch.js"></script>
</head>
<body></body>
</html>
================================================
FILE: 019_Superellipse/P5/sketch.js
================================================
// Superellipse
// Daniel Shiffman
// https://thecodingtrain.com/CodingChallenges/019-superellipse.html
// https://youtu.be/z86cx2A4_3E
// https://editor.p5js.org/codingtrain/sketches/Hk-1AMTgN
let slider;
function setup() {
createCanvas(400, 400);
slider = createSlider(0, 10, 2, 0.01);
}
function draw() {
background(51);
translate(width / 2, height / 2);
let a = 100;
let b = 100;
let n = slider.value();
stroke(255);
noFill();
beginShape();
for (let angle = 0; angle < TWO_PI; angle += 0.1) {
// Simple ellipse
// let x = r * cos(angle);
// let y = r * sin(angle);
// Superellipse
let na = 2 / n;
let x = pow(abs(cos(angle)), na) * a * sgn(cos(angle));
let y = pow(abs(sin(angle)), na) * b * sgn(sin(angle));
vertex(x, y);
}
endShape(CLOSE);
}
function sgn(val) {
if (val == 0) {
return 0;
}
return val / abs(val);
}
================================================
FILE: 019_Superellipse/Processing/CC_019_Superellipse/CC_019_Superellipse.pde
================================================
// Superellipse
// Daniel Shiffman
// https://thecodingtrain.com/CodingChallenges/019-superellipse.html
// https://youtu.be/z86cx2A4_3E
// https://editor.p5js.org/codingtrain/sketches/Hk-1AMTgN
// Processing transcription: Chuck England
Slider slider;
void setup() {
size(400, 400);
slider = new Slider(-width/2+20, -height/2+20, 0, 10, 2, 0.01);
}
void draw() {
background(51);
translate(width / 2, height / 2);
float a = 100;
float b = 100;
float n = slider.value();
//float n = 2;
stroke(255);
noFill();
beginShape();
for (float angle = 0; angle < TWO_PI; angle += 0.1) {
// Simple ellipse
// float x = r * cos(angle);
// float y = r * sin(angle);
// Superellipse
float na = 2 / n;
float x = pow(abs(cos(angle)), na) * a * sgn(cos(angle));
float y = pow(abs(sin(angle)), na) * b * sgn(sin(angle));
vertex(x, y);
}
endShape(CLOSE);
slider.show();
}
float sgn(float val) {
if (val == 0) {
return 0;
}
return val / abs(val);
}
================================================
FILE: 019_Superellipse/Processing/CC_019_Superellipse/Slider.pde
================================================
// Chuck England
// Written for Processing:
// Daniel Shiffman
// http://youtube.com/thecodingtrain
// http://codingtra.in
//
// Note that the original p5.js example uses a DOM
// object for the slider.
class Slider {
float x;
float y;
float min;
float max;
float value;
float increment;
float w = 200;
float h = 20;
float controlSize = 7;
Boolean isDragging = false;
Slider(float x_, float y_, float min_, float max_, float start_, float increment_) {
x = x_;
y = y_;
min = min_;
max = max_;
value = start_;
increment = increment_;
}
float value() {
return value;
}
void handleInteractions() {
if (isDragging) {
if (mousePressed) {
float x1 = screenX(xPosition(value), y);
float d = mouseX - x1;
float change = d * (max - min) / w;
value += change;
value -= value % increment;
value = min(max, max(min, value));
} else {
isDragging = false;
println("end drag");
}
} else {
float x1 = xPosition(value);
if (mousePressed && mouseY >= screenY(x1, y) && mouseY <= screenY(x1, y+h) && mouseX >= screenX(x1-controlSize/2,y) && mouseX <= screenX(x1+controlSize/2,y)) {
println("start drag");
isDragging = true;
}
}
}
float xPosition(float val) {
return min(x+w, max(x, map(val, min, max, x, x+w)));
}
void show() {
handleInteractions();
stroke(255);
fill(0);
rect(x, y + h/3, w, h/3, 2);
float x1 = xPosition(value);
stroke(200, 200, 200);
fill(128, 128, 128);
rect(x1-controlSize/2, y, controlSize, h, 2);
}
};
================================================
FILE: 020_ClothSimulation/P5/index.html
================================================
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.min.js"></script>
<meta charset="utf-8" />
<link rel="stylesheet" href="./style.css">
</head>
<body>
<script src="toxiclibs/toxiclibs.js"></script>
<script src="toxiclibs/toxichelper.js"></script>
<script language="javascript" type="text/javascript" src="sketch.js"></script>
<script language="javascript" type="text/javascript" src="particle.js"></script>
<script language="javascript" type="text/javascript" src="spring.js"></script>
</body>
</html>
================================================
FILE: 020_ClothSimulation/P5/particle.js
================================================
// 2D Cloth with toxiclibs
// The Coding Train / Daniel Shiffman
// https://thecodingtrain.com/CodingChallenges/020-cloth3d.html
// https://youtu.be/jrk_lOg_pVA
// https://editor.p5js.org/codingtrain/sketches/U6n24GfsD
class Particle extends VerletParticle2D {
constructor(x, y) {
super(x, y);
}
display() {
fill(255);
ellipse(this.x, this.y, 10, 10);
}
}
================================================
FILE: 020_ClothSimulation/P5/sketch.js
================================================
// 2D Cloth with toxiclibs
// The Coding Train / Daniel Shiffman
// https://thecodingtrain.com/CodingChallenges/020-cloth3d.html
// https://youtu.be/jrk_lOg_pVA
// https://editor.p5js.org/codingtrain/sketches/U6n24GfsD
let cols = 20;
let rows = 20;
let particles = make2DArray(cols, rows);
let springs = [];
let w = 10;
let physics;
function setup() {
createCanvas(400, 300);
physics = new VerletPhysics2D();
let gravity = new Vec2D(0, 1);
let gb = new GravityBehavior(gravity);
physics.addBehavior(gb);
let x = 100;
for (let i = 0; i < cols; i++) {
let y = 10;
for (let j = 0; j < rows; j++) {
let p = new Particle(x, y);
particles[i][j] = p;
physics.addParticle(p);
y = y + w;
}
x = x + w;
}
for (let i = 0; i < cols; i++) {
for (let j = 0; j < rows; j++) {
let a = particles[i][j];
if (i != cols - 1) {
let b1 = particles[i + 1][j];
let s1 = new Spring(a, b1);
springs.push(s1);
physics.addSpring(s1);
}
if (j != rows - 1) {
let b2 = particles[i][j + 1];
let s2 = new Spring(a, b2);
springs.push(s2);
physics.addSpring(s2);
}
}
}
particles[0][0].lock();
particles[cols - 1][0].lock();
}
function draw() {
background(0);
physics.update();
for (let i = 0; i < cols; i++) {
for (let j = 0; j < rows; j++) {
//particles[i][j].display();
}
}
for (let s of springs) {
s.display();
}
}
function make2DArray(cols, rows) {
var arr = new Array(cols);
for (var i = 0; i < arr.length; i++) {
arr[i] = new Array(rows);
}
return arr;
}
================================================
FILE: 020_ClothSimulation/P5/spring.js
================================================
// 2D Cloth with toxiclibs
// The Coding Train / Daniel Shiffman
// https://thecodingtrain.com/CodingChallenges/020-cloth3d.html
// https://youtu.be/jrk_lOg_pVA
// https://editor.p5js.org/codingtrain/sketches/U6n24GfsD
class Spring extends VerletSpring2D {
constructor(a, b) {
super(a, b, w, 1);
}
display() {
stroke(255);
strokeWeight(2);
line(this.a.x, this.a.y, this.b.x, this.b.y);
}
}
================================================
FILE: 020_ClothSimulation/P5/style.css
================================================
html, body {
margin: 0;
padding: 0;
}
input {
font-size: 32pt;
}
p {
font-size: 32pt;
color: #E51310;
}
canvas {
display: block;
}
================================================
FILE: 020_ClothSimulation/P5/toxiclibs/toxichelper.js
================================================
// The Nature of Code
// Daniel Shiffman
// http://natureofcode.com
// Making it easier to use all these classes
// Maybe this is a bad idea?
const VerletPhysics2D = toxi.physics2d.VerletPhysics2D;
const GravityBehavior = toxi.physics2d.behaviors.GravityBehavior;
const AttractionBehavior = toxi.physics2d.behaviors.AttractionBehavior;
const VerletParticle2D = toxi.physics2d.VerletParticle2D;
const VerletSpring2D = toxi.physics2d.VerletSpring2D;
const VerletMinDistanceSpring2D = toxi.physics2d.VerletMinDistanceSpring2D;
const Vec2D = toxi.geom.Vec2D;
const Rect = toxi.geom.Rect;
================================================
FILE: 020_ClothSimulation/P5/toxiclibs/toxiclibs.js
================================================
/*!
* toxiclibsjs - v0.3.3
* http://haptic-data.com/toxiclibsjs
* Created by [Kyle Phillips](http://haptic-data.com),
* based on original work by [Karsten Schmidt](http://toxiclibs.org).
* Licensed [GPLv2](http://www.gnu.org/licenses/lgpl-2.1.html)
*/
(function(f) {
if (typeof exports === "object" && typeof module !== "undefined") {
module.exports = f();
} else if (typeof define === "function" && define.amd) {
define([], f);
} else {
var g;
if (typeof window !== "undefined") {
g = window;
} else if (typeof global !== "undefined") {
g = global;
} else if (typeof self !== "undefined") {
g = self;
} else {
g = this;
}
g.toxi = f();
}
})(function() {
var define, module, exports;
return (function e(t, n, r) {
function s(o, u) {
if (!n[o]) {
if (!t[o]) {
var a = typeof require == "function" && require;
if (!u && a) return a(o, !0);
if (i) return i(o, !0);
var f = new Error("Cannot find module '" + o + "'");
throw ((f.code = "MODULE_NOT_FOUND"), f);
}
var l = (n[o] = { exports: {} });
t[o][0].call(
l.exports,
function(e) {
var n = t[o][1][e];
return s(n ? n : e);
},
l,
l.exports,
e,
t,
n,
r
);
}
return n[o].exports;
}
var i = typeof require == "function" && require;
for (var o = 0; o < r.length; o++) s(r[o]);
return s;
})(
{
1: [
function(require, module, exports) {
/** @module toxi.THREE */
module.exports = {
ToxiclibsSupport: require("./THREE/ToxiclibsSupport"),
};
},
{ "./THREE/ToxiclibsSupport": 2 },
],
2: [
function(require, module, exports) {
/*global THREE*/
var is = require("../internals/is");
/**
* @author Kyle Phillips / haptic-data.com
* a bridge between Toxiclibs.js and Three.js
*
* Three.js does type-checking to ensure that vectors, vertices and faces are of THREE's types
* this helps to do that conversion process.
*/
var ToxiclibsSupport = function(scene) {
if (THREE === undefined) {
throw new Error("THREE.js has not been loaded");
}
this.scene = scene;
this.objectDictionary = {};
};
ToxiclibsSupport.createLineGeometry = function(line3d, geometry) {
return ToxiclibsSupport.createMeshGeometry({ vertices: [line3d.a, line3d.b] }, geometry);
};
/**
* create a THREE.Geometry with matching vertices to your triangleMesh
* @param {toxi.geom.mesh.TriangleMesh} triangleMesh the toxiclibs.js triangle mesh to convert
* @param {THREE.Geometry} [geometry] optional geometry to pass in if you would prefer to update
* a geometry instead of create a new one
* @returns {THREE.Geometry}
*/
ToxiclibsSupport.createMeshGeometry = function createMeshGeometry(obj, geometry) {
geometry = geometry || new THREE.Geometry();
//create a map where the unique id of the Vertex
//references the index in the array
var idIndexMap = {};
var v, i, f, len, vertices;
//add all vertices
vertices = is.Array(obj) ? obj : obj.vertices;
len = vertices.length;
if (!vertices) {
throw new Error("no vertices found");
}
for (i = 0; i < len; i++) {
v = vertices[i];
geometry.vertices[i] = new THREE.Vector3(v.x, v.y, v.z);
idIndexMap[v.id] = i;
}
if (obj.faces) {
len = obj.faces.length;
for (i = 0; i < len; i++) {
f = obj.faces[i];
//normal.y *= -1;
//unlike toxiclibs, a face in three.js are indices related to the vertices array
geometry.faces[i] = new THREE.Face3(idIndexMap[f.a.id], idIndexMap[f.b.id], idIndexMap[f.c.id], new THREE.Vector3(f.normal.x, f.normal.y, f.normal.z));
}
}
geometry.computeCentroids();
geometry.computeVertexNormals();
return geometry;
};
ToxiclibsSupport.createMesh = function(triangleMesh, material) {
if (material === undefined) {
material = new THREE.MeshBasicMaterial();
}
var geometry = ToxiclibsSupport.createMeshGeometry(triangleMesh);
return new THREE.Mesh(geometry, material);
};
ToxiclibsSupport.createParticle = function(position, materials) {
var particle = new THREE.Particle(materials);
particle.position.x = position.x;
particle.position.y = position.y;
particle.position.z = position.z;
return particle;
};
ToxiclibsSupport.prototype = {
addLine: function(line3d, material) {
if (material === undefined) {
material = new THREE.LineBasicMaterial();
}
var geom = ToxiclibsSupport.createLineGeometry(line3d);
var line = new THREE.Line(geom, material);
this.scene.add(line);
return line;
},
/**
* add a toxiclibs.js mesh to the three.js scene
* @param {Object|toxi.geom.mesh.TriangleMesh} obj_or_mesh either an options object or
* the toxiclibsjs mesh
* --
* @param {toxi.geom.mesh.Trianglemesh} [obj_or_mesh.geometry] the mesh in the options object
* @param {THREE.Material} [obj_or_mesh.material] the three.js material for the mesh
* @param {boolean} [obj_or_mesh.holdInDictionary] should ToxiclibsSupport hold a reference?
* --
* @param {THREE.Material} [threeMaterials] the three.js material for the mesh
*/
addMesh: function(obj_or_mesh, threeMaterials) {
var toxiTriangleMesh;
if (arguments.length == 1) {
//it needs to be an param object
toxiTriangleMesh = obj_or_mesh.geometry;
threeMaterials = obj_or_mesh.materials;
} else {
toxiTriangleMesh = obj_or_mesh;
}
var threeMesh = this.createMesh(toxiTriangleMesh, threeMaterials);
this.scene.add(threeMesh);
return threeMesh;
},
addParticles: function(positions, material) {
if (material === undefined) {
material = new THREE.ParticleBasicMaterial();
}
positions = is.Array(positions) ? positions : [positions];
var particle = new THREE.Geometry(),
pos;
for (var i = 0, len = positions.length; i < len; i++) {
pos = positions[i];
particle.vertices[i] = new THREE.Vector3(pos.x, pos.y, pos.z);
}
var particleSystem = new THREE.ParticleSystem(particle, material);
this.scene.add(particleSystem);
return particle;
},
createMeshGeometry: function(triangleMesh) {
return ToxiclibsSupport.createMeshGeometry(triangleMesh);
},
createMesh: function(triangleMesh, material) {
return ToxiclibsSupport.createMesh(triangleMesh, material);
},
};
module.exports = ToxiclibsSupport;
},
{ "../internals/is": 106 },
],
3: [
function(require, module, exports) {
exports.accessCriteria = require("./color/accessCriteria");
//keep it uppercase also
exports.AccessCriteria = exports.accessCriteria;
exports.AlphaAccessor = require("./color/AlphaAccessor");
exports.CMYKAccessor = require("./color/CMYKAccessor");
exports.CMYKDDistanceProxy = require("./color/CMYKDistanceProxy");
exports.ColorGradient = require("./color/ColorGradient");
exports.ColorList = require("./color/ColorList");
exports.ColorRange = require("./color/ColorRange");
exports.ColorTheme = require("./color/ColorTheme");
exports.createListUsingStrategy = require("./color/createListUsingStrategy");
exports.HistEntry = require("./color/HistEntry");
exports.Histogram = require("./color/Histogram");
exports.HSVAccessor = require("./color/HSVAccessor");
exports.HSVDistanceProxy = require("./color/HSVDistanceProxy");
exports.Hue = require("./color/Hue");
exports.LuminanceAccessor = require("./color/LuminanceAccessor");
exports.namedColor = require("./color/namedColor");
exports.NamedColor = exports.namedColor;
exports.ProximityComparator = require("./color/ProximityComparator");
exports.RGBAccessor = require("./color/RGBAccessor");
exports.RGBDistanceProxy = require("./color/RGBDistanceProxy");
exports.TColor = require("./color/TColor");
exports.theory = require("./color/theory");
exports.ToneMap = require("./color/ToneMap");
},
{ "./color/AlphaAccessor": 4, "./color/CMYKAccessor": 5, "./color/CMYKDistanceProxy": 6, "./color/ColorGradient": 7, "./color/ColorList": 8, "./color/ColorRange": 9, "./color/ColorTheme": 10, "./color/HSVAccessor": 11, "./color/HSVDistanceProxy": 12, "./color/HistEntry": 13, "./color/Histogram": 14, "./color/Hue": 15, "./color/LuminanceAccessor": 16, "./color/ProximityComparator": 17, "./color/RGBAccessor": 18, "./color/RGBDistanceProxy": 19, "./color/TColor": 20, "./color/ToneMap": 21, "./color/accessCriteria": 22, "./color/createListUsingStrategy": 24, "./color/namedColor": 26, "./color/theory": 27 },
],
4: [
function(require, module, exports) {
module.exports = require("./accessors").AlphaAccessor;
},
{ "./accessors": 23 },
],
5: [
function(require, module, exports) {
module.exports = require("./accessors").CMYKAccessor;
},
{ "./accessors": 23 },
],
6: [
function(require, module, exports) {
module.exports = require("./distanceProxies").CMYKDistanceProxy;
},
{ "./distanceProxies": 25 },
],
7: [
function(require, module, exports) {
var filter = require("../internals").filter,
numberComparator = require("../internals").numberComparator,
mathUtils = require("../math/mathUtils"),
LinearInterpolation = require("../math/LinearInterpolation"),
ColorList = require("./ColorList");
//a protected object for every point on the gradient
var _GradPoint = function(p, c) {
this.pos = p;
this.color = c;
};
_GradPoint.prototype = {
compareTo: function(p) {
if (numberComparator(p.pos, this.pos) === 0) {
return 0;
}
return this.pos < p.pos ? -1 : 1;
},
getColor: function() {
return this.color;
},
getPosition: function() {
return this.pos;
},
};
var ColorGradient = function() {
this.gradient = [];
this.interpolator = new LinearInterpolation();
this.maxDither = 0;
};
ColorGradient.prototype = {
/**
* Adds a new color at specified position.
* @param {Number} p position in the gradient
* @param {toxi.color.TColor} c color to add
*/
addColorAt: function(p, c) {
this.gradient.push(new _GradPoint(p, c));
},
/**
* Calculates the gradient from specified position.
* @param {Number} pos position to start at (float)
* @param {Number} width (integer)
* @return list of interpolated gradient colors
*/
calcGradient: function(pos, width) {
if (arguments.length === 0) {
pos = this.gradient[0].getPosition();
var last = this.gradient[this.gradient.length - 1].getPosition();
width = Math.floor(last - pos);
}
var result = new ColorList();
if (this.gradient.length === 0) {
return result;
}
var frac = 0,
currPoint,
nextPoint,
endPos = pos + width,
i = 0,
l = this.gradient.length;
for (i = 0; i < l; i++) {
if (this.gradient[i].pos < pos) {
currPoint = this.gradient[i];
}
}
var isPremature = currPoint === undefined,
activeGradient;
if (!isPremature) {
activeGradient = filter(this.gradient, function(g) {
return g.pos >= currPoint.pos;
});
} else {
//start position is before 1st gradient color, so use whole
activeGradient = this.gradient;
currPoint = this.gradient[0];
}
var currWidth = 0;
//start over with i, and use it to iterate
i = 0;
l = activeGradient.length;
if (currPoint !== activeGradient[l - 1]) {
nextPoint = activeGradient[i];
if (isPremature) {
var d = currPoint.pos - pos;
currWidth = mathUtils.abs(d) > 0 ? 1 / d : 1;
} else {
if (nextPoint.pos - currPoint.pos > 0) {
currWidth = 1 / (nextPoint.pos - currPoint.pos);
}
}
}
while (pos < endPos) {
if (isPremature) {
frac = 1 - (currPoint.pos - pos) * currWidth;
} else {
frac = (pos - currPoint.pos) * currWidth;
}
//switch to next color?
if (frac > 1.0) {
currPoint = nextPoint;
isPremature = false;
i++;
if (i < activeGradient.length) {
nextPoint = activeGradient[i];
if (currPoint !== activeGradient[l - 1]) {
currWidth = 1 / (nextPoint.pos - currPoint.pos);
} else {
currWidth = 0;
}
frac = (pos - currPoint.pos) * currWidth;
}
}
if (currPoint !== activeGradient[l - 1]) {
var ditheredFrac = mathUtils.clip(frac + mathUtils.normalizedRandom() * this.maxDither, 0, 1);
ditheredFrac = this.interpolator.interpolate(0, 1, ditheredFrac);
result.add(currPoint.color.getBlended(nextPoint.color, ditheredFrac));
} else {
result.add(currPoint.color.copy());
}
pos++;
}
return result;
},
getGradientPoints: function() {
return this.gradient;
},
/**
* @return the interpolator
*/
getInterpolator: function() {
return this.interpolator;
},
/**
* @return the maximum dither amount.
*/
getMaxDither: function() {
return this.maxDither;
},
/**
* @param interpolator the interpolator to set
*/
setInterpolator: function(interpolator) {
this.interpolator = interpolator;
},
/**
* Sets the maximum dither amount. Setting this to values >0 will jitter the
* interpolated colors in the calculated gradient. The value range for this
* parameter is 0.0 (off) to 1.0 (100%).
* @param {Number} maxDither
*/
setMaxDither: function(maxDither) {
this.maxDither = mathUtils.clip(maxDither, 0, 1);
},
};
module.exports = ColorGradient;
},
{ "../internals": 98, "../math/LinearInterpolation": 119, "../math/mathUtils": 125, "./ColorList": 8 },
],
8: [
function(require, module, exports) {
var is = require("../internals/is"),
each = require("../internals/each"),
Iterator = require("../internals/Iterator"),
mathUtils = require("../math/mathUtils"),
TColor = require("./TColor"),
HSVDistanceProxy = require("./HSVDistanceProxy"),
RGBDistanceProxy = require("./RGBDistanceProxy"),
ProximityComparator = require("./ProximityComparator"),
AccessCriteria = require("./accessCriteria");
/**
* A container class of concrete colors. ColorLists can be built manually and
* are also created when working with {@link ColorRange}s. The class has various
* methods to manipulate all colors in the list in parallel, as well as sort
* them by various criteria.
* @see ColorRange
* @see AccessCriteria
*/
/**
@memberOf toxi.color
@class Creates a ColorList by wrapping the given ArrayList of colors. No copies
of the given colors are created (shallow copy only).
@param {TColor[]} colors
*/
var ColorList = function(colors) {
if (arguments.length > 1) {
return ColorList.call(this, arguments);
}
this.colors = [];
var i = 0;
if (is.Array(colors) && colors.length) {
if (typeof colors[0] === "number") {
//argb integers
for (i = 0, l = colors.length; i < l; i++) {
this.colors.push(TColor.newARGB(colors[i]));
}
} else {
//an array of tcolors
this.addAll(colors);
}
} else if (is.ColorList(colors)) {
for (i = 0, l = colors.size(); i < l; i++) {
this.add(colors.get(i));
}
} else if (is.TColor(colors)) {
//tcolor
this.add(colors);
}
};
ColorList.prototype = {
constructor: ColorList,
/**
* Adds a copy of the given color to the list
* @param {TColor} c
* @return itself
*/
add: function(c) {
this.colors.push(c.copy());
return this;
},
/**
* Adds all entries of the TColor collection to the list (shallow copy only,
* manipulating the new list will modify the original colors).
* @param {Array} collection
* @return itself
*/
addAll: function(collection) {
var self = this;
if (!is.Array(collection)) {
this.colors.push(collection);
} else {
each(collection, function(color) {
self.colors.push(color);
});
}
return this;
},
/**
* Adjusts the brightness component of all list colors by the given amount.
* @param step adjustment value
* @return itself
*/
adjustBrightness: function(step) {
each(this.colors, function(c) {
c.lighten(step);
});
return this;
},
/**
* Adjusts the saturation component of all list colors by the given amount.
* @param step
* adjustment value
* @return itself
*/
adjustSaturation: function(step) {
each(this.colors, function(c) {
c.saturate(step);
});
return this;
},
/**
* Sorts the list based on two criteria to create clusters/segments within
* the list.
* @param clusterCriteria main sort criteria
* @param subClusterCriteria secondary sort criteria
* @param numClusters number of clusters
* @param isReversed true, if reversed sort
* @return itself
*/
clusterSort: function(clusterCriteria, subClusterCriteria, numClusters, isReversed) {
var sorted = this.colors.slice(0),
clusters = [],
d = 1,
i = 0,
num = sorted.length,
slice;
sorted.sort(clusterCriteria.compare).reverse();
for (var j = 0; j < num; j++) {
var c = sorted[j];
if (c.getComponentValue(clusterCriteria) < d) {
slice = sorted.slice(i, j);
slice.sort(subClusterCriteria.compare);
clusters.push.apply(clusters, slice);
d -= 1.0 / numClusters;
i = j;
}
}
slice = [];
Array.prototype.push.apply(slice, sorted.slice(i, sorted.length));
slice.sort(subClusterCriteria.compare);
clusters.push.apply(clusters, slice);
if (isReversed) {
clusters.reverse();
}
this.colors = clusters;
return this;
},
/**
* Switches all list colors to their complementary color.
* @return itself
*/
complement: function() {
this.each(function(c) {
c.complement();
});
return this;
},
/**
* Checks if the given color is part of the list. Check is done by value,
* not instance.
* @param color
* @return true, if the color is present.
*/
contains: function(color) {
for (var i = 0, l = this.colors.length; i < l; i++) {
if (this.colors[i].equals(color)) {
return true;
}
}
return false;
},
each: function(fn) {
each(this.colors, fn);
return this;
},
/**
* Returns the color at the given index. This function follows Python
* convention, in that if the index is negative, it is considered relative
* to the list end. Therefore the color at index -1 is the last color in the
* list.
* @param i
* index
* @return color
*/
get: function(i) {
if (i < 0) {
i += this.colors.length;
}
return this.colors[i];
},
/**
* Calculates and returns the average color of the list.
* @return average color or null, if there're no entries yet.
*/
getAverage: function() {
var r = 0,
g = 0,
b = 0,
a = 0;
this.each(function(c) {
r += c.rgb[0];
g += c.rgb[1];
b += c.rgb[2];
a += c.alpha();
});
var num = this.colors.length;
if (num > 0) {
return TColor.newRGBA(r / num, g / num, b / num, a / num);
}
return undefined;
},
/**
* Creates a new ColorList by blending all colors in the list with each
* other (successive indices only)
* @param amount
* blend amount
* @return new color list
*/
getBlended: function(amount) {
var clrs = [],
len = this.colors.length;
for (var i = 0; i < len; i++) {
var index = i > 0 ? i - 1 : clrs.length - 1,
c = this.colors[index];
clrs.push(this.colors[i].getBlended(c, amount));
}
return new ColorList(clrs);
},
/**
* Finds and returns the darkest color of the list.
* @return darkest color or null if there're no entries yet.
*/
getDarkest: function() {
var darkest,
minBrightness = Number.MAX_VALUE;
this.each(function(c) {
var luma = c.luminance();
if (luma < minBrightness) {
darkest = c;
minBrightness = luma;
}
});
return darkest;
},
/**
* Finds and returns the lightest (luminance) color of the list.
* @return lightest color or null, if there're no entries yet.
*/
getLightest: function() {
var lightest,
maxBrightness = Number.MIN_VALUE;
this.each(function(c) {
var luma = c.luminance();
if (luma > maxBrightness) {
lightest = c;
maxBrightness = luma;
}
});
return lightest;
},
getRandom: function() {
var index = Math.floor(mathUtils.random(this.colors.length));
return this.colors[index];
},
getReverse: function() {
return new ColorList(this.colors).reverse();
},
invert: function() {
this.each(function(c) {
c.invert();
});
return this;
},
iterator: function() {
return new Iterator(this.colors);
},
reverse: function() {
this.colors.reverse();
return this;
},
rotateRYB: function(theta, isRadians) {
var angle;
if (theta !== Math.floor(theta) || isRadians) {
angle = mathUtils.degrees(theta);
} else {
angle = theta;
}
this.each(function(c) {
c.rotateRYB(angle);
});
return this;
},
size: function() {
return this.colors.length;
},
sort: function() {
return this.sortByCriteria(AccessCriteria.HUE, false);
},
/**
* Sorts the list using the given comparator.
* @param comp
* comparator
* @param isReversed
* true, if reversed sort
* @return itself
*/
sortByComparator: function(comp, isReversed) {
//if a normal ( a, b ) sort function instead of an AccessCriteria,
//wrap it so it can be invoked the same
if (typeof comp === "function" && typeof comp.compare === "undefined") {
comp = { compare: comp };
}
this.colors.sort(comp.compare);
if (isReversed) {
this.colors.reverse();
}
return this;
},
/**
* Sorts the list using the given {@link AccessCriteria}.
* @param criteria
* sort criteria
* @param isReversed
* true, if reversed sort
* @return itself
*/
sortByCriteria: function(criteria, isReversed) {
return this.sortByComparator(criteria, isReversed);
},
/**
* Sorts the list by relative distance to each predecessor, starting with
* the darkest color in the list.
* @param {toxi.color.*{DistanceProxy}} proxy
* @param isReversed
* true, if list is to be sorted in reverse.
* @return itself
*/
sortByDistance: function(proxy, isReversed) {
if (arguments.length === 1) {
isReversed = arguments[0];
proxy = new HSVDistanceProxy();
}
if (this.colors.length === 0) {
return this;
}
// Remove the darkest color from the stack,
// put it in the sorted list as starting element.
var root = this.getDarkest(),
stack = this.colors.slice(0),
sorted = [];
stack.splice(stack.indexOf(root), 1);
sorted.push(root);
// Now find the color in the stack closest to that color.
// Take this color from the stack and add it to the sorted list.
// Now find the color closest to that color, etc.
var sortedCount = 0;
while (stack.length > 1) {
var closest = stack[0],
lastSorted = sorted[sortedCount],
distance = proxy.distanceBetween(closest, lastSorted);
for (var i = stack.length - 1; i >= 0; i--) {
var c = stack[i],
d = proxy.distanceBetween(c, lastSorted);
if (d < distance) {
closest = c;
distance = d;
}
}
stack.splice(stack.indexOf(closest), 1);
sorted.push(closest);
sortedCount++;
}
sorted.push(stack[0]);
if (isReversed) {
sorted.reverse();
}
this.colors = sorted;
return this;
},
/**
* Sorts the list by proximity to the given target color (using RGB distance
* metrics).
* @see #sortByProximityTo(ReadonlyTColor, DistanceProxy, boolean)
* @param target
* color
* @param isReversed
* true, if reverse sorted
* @return sorted list
*/
sortByProximityTo: function(target, proxy, isReversed) {
if (arguments.length == 2) {
target = arguments[0];
proxy = new RGBDistanceProxy();
isReversed = arguments[1];
}
return this.sortByComparator(new ProximityComparator(target, proxy), isReversed);
},
toARGBArray: function() {
var array = [];
this.each(function(c) {
array.push(c.toARGB());
});
return array;
},
};
/**
* Factory method. Creates a new ColorList of colors randomly sampled from
* the given ARGB image array. If the number of samples equals or exceeds
* the number of pixels in the source image and no unique colors are
* required, the function will simply return the same as
* {@link #ColorList(int[])}.
* @param pixels
* int array of ARGB pixels
* @param num
* number of colors samples (clipped automatically to number of
* pixels in the image)
* @param uniqueOnly
* flag if only unique samples are to be taken (doesn't guarantee
* unique colors though)
* @param maxIterations (optional)
* max number of attempts to find a unique color. If no more
* unique colors can be found the search is terminated.
* @return new color list of samples
*/
ColorList.createFromARGBArray = function(pixels, num, uniqueOnly, maxIterations) {
maxIterations = maxIterations || 100;
num = mathUtils.min(num, pixels.length);
if (!uniqueOnly && num == pixels.length) {
return new ColorList(pixels);
}
var colors = [],
temp = TColor.BLACK.copy(),
i = 0,
isUnique = true,
numTries = 0,
idx;
for (i = 0; i < num; i++) {
if (uniqueOnly) {
isUnique = true;
numTries = 0;
do {
idx = mathUtils.random(pixels.length);
temp.setARGB(pixels[idx]);
isUnique = !(colors.indexOf(temp) >= 0);
} while (!isUnique && ++numTries < maxIterations);
if (numTries < maxIterations) {
colors.push(temp.copy());
} else {
break;
}
} else {
idx = mathUtils.random(pixels.length);
colors.push(TColor.newARGB(pixels[idx]));
}
}
return new ColorList(colors);
};
ColorList.createUsingStrategy = function() {
throw new Error("Not allowed, use toxi/color/createListUsingStrategy instead");
};
module.exports = ColorList;
},
{ "../internals/Iterator": 99, "../internals/each": 102, "../internals/is": 106, "../math/mathUtils": 125, "./HSVDistanceProxy": 12, "./ProximityComparator": 17, "./RGBDistanceProxy": 19, "./TColor": 20, "./accessCriteria": 22 },
],
9: [
function(require, module, exports) {
var TColor = require("./TColor");
var ColorList = require("./ColorList");
var FloatRange = require("../util/datatypes/FloatRange");
var is = require("../internals/is");
var each = require("../internals/each");
var MathUtils = require("../math/mathUtils");
var ColorRange,
UNTITLED_ID = 1,
addRange,
addAll,
pickRandom;
//@private
//add all elements to the given array, without creating a new array (like concat)
addAll = function(arr, elementsArr) {
arr.push.apply(arr, elementsArr);
};
//@private
//the addAlphaRange, addHueRange… methods are identical, so with js,
//we can generate them without
addRange = function(attr) {
return function(min, max) {
this[attr.toLowerCase() + "Constraint"].push(is.FloatRange(min) ? min : new FloatRange(min, max));
return this;
};
};
//@private
//pickRandom element from array
pickRandom = function(arr) {
return arr[Math.floor(Math.random() * arr.length)];
};
/**
* A ColorRange is a set of constraints to specify possible ranges for hue,
* saturation, brightness and alpha independently and use these as creation
* rules for new {@link TColor}s or {@link ColorList}s. The class comes with 11
* preset ranges reflecting common demands and color characters. You can also
* construct new ranges and manually add additional constraints. Unless the
* constraints in a range are very narrow the class will always create random
* variations within the constraints. Please see the examples for further
* details.
*
* {@link ColorRange}s are a key ingredient for defining {@link ColorTheme}s but
* can also be used individually.
*/
/**
* construct a new ColorRange,
* this constructor takes a wide variety of param signatures,
* 1.
* @param {toxi.color.ColorList} list
* 2.
* @param {toxi.util.datatypes.FloatRange} [hue]
* @param {toxi.util.datatypes.FloatRange} [sat]
* @param {toxi.util.datatypes.FloatRange} [bri]
* @param {toxi.util.datatypes.FloatRange} [alpha]
* @param {toxi.util.datatypes.FloatRange} [black]
* @param {toxi.util.datatypes.FloatRange} [white]
* @param {String} [name]
* 3.
* @param {toxi.util.datatypes.FloatRange} [hue]
* @param {toxi.util.datatypes.FloatRange} [sat]
* @param {toxi.util.datatypes.FloatRange} [bri]
* @param {toxi.util.datatypes.FloatRange} [alpha]
* @param {String} [name]
* 4.
* @param {toxi.util.datatypes.FloatRange} [hue]
* @param {toxi.util.datatypes.FloatRange} [sat]
* @param {toxi.util.datatypes.FloatRange} [bri]
* @param {String} [name]
* 5.name
* @param {toxi.color.Hue} hue
* 6.
* @param {toxi.color.TColor} c
*/
ColorRange = function(hue, sat, bri, alpha, black, white, name) {
var self = this,
list; //if ColorList is supplied
if (arguments.length === 0) {
return this;
}
//ColorRange( ColorList list)
if (is.ColorList(hue)) {
list = hue;
hue = list.get(0);
}
//ColorRange( Hue hue )
if (is.Hue(hue)) {
hue = new FloatRange(hue.getHue(), hue.getHue());
}
//ColorRange( TColor c )
if (is.TColor(hue)) {
//transform `hue` from a TColor to FloatRange for hue
hue = new FloatRange(hue.hue(), hue.hue());
}
this.hueConstraint = [is.FloatRange(hue) ? hue : new FloatRange(0, 1)];
this.saturationConstraint = [is.FloatRange(sat) ? sat : new FloatRange(0, 1)];
this.brightnessConstraint = [is.FloatRange(bri) ? bri : new FloatRange(0, 1)];
this.alphaConstraint = [is.FloatRange(alpha) ? alpha : new FloatRange(1, 1)];
//not arrays for black & white
this.black = is.FloatRange(black) ? black : new FloatRange(0, 1);
this.white = is.FloatRange(white) ? white : new FloatRange(0, 1);
//now that the constraints have all been created
if (list) {
this.hueConstraint = []; //clear the hues
list.each(function(c) {
self.add(c);
});
}
//search arguments for a string that would be the name
var i = arguments.length - 1;
for (; i >= 0; i--) {
if (typeof arguments[i] === "string") {
this.name = arguments[i];
break;
}
}
if (!this.name) {
this.name = "untitled" + UNTITLED_ID++;
}
};
ColorRange.prototype = {
constructor: ColorRange,
/**
* Adds the HSV color components as constraints
* @param {toxi.color.ColorRange | toxi.color.TColor} rc
* @return itself
*/
add: function(rc) {
if (is.ColorRange(rc)) {
addAll(this.hueConstraint, rc.hueConstraint);
addAll(this.saturationConstraint, rc.saturationConstraint);
addAll(this.brightnessConstraint, rc.brightnessConstraint);
addAll(this.alphaConstraint, rc.alphaConstraint);
this.black.min = Math.min(this.black.min, rc.black.min);
this.black.max = Math.max(this.black.max, rc.black.max);
this.white.min = Math.min(this.white.min, rc.white.min);
this.white.max = Math.max(this.white.max, rc.white.max);
} else {
this.hueConstraint.push(new FloatRange(rc.hue(), rc.hue()));
this.saturationConstraint.push(new FloatRange(rc.saturation(), rc.saturation()));
this.brightnessConstraint.push(new FloatRange(rc.brightness(), rc.brightness()));
this.alphaConstraint.push(new FloatRange(rc.alpha(), rc.alpha()));
}
return this;
},
/**
* Adds the range between min-max as possible alpha values for this range
* @param {toxi.util.datatypes.FloatRange | Number} min
* @param {Number} [max]
* @return itself
*/
addAlphaRange: addRange("alpha"),
addBrightnessRange: addRange("brightness"),
addHue: function(hue) {
this.hueConstraint.push(new FloatRange(hue.getHue(), hue.getHue()));
return this;
},
addHueRange: addRange("hue"),
addSaturationRange: addRange("saturation"),
/**
* checks if all HSVA components of the given color are within
* the constraints define for this range
* @param {toxi.color.TColor} c
* @return true if is contained
*/
contains: function(c) {
var isInRange = this.isValueInConstraint(c.hue(), this.hueConstraint);
isInRange &= this.isValueInConstraint(c.saturation(), this.saturationConstraint);
isInRange &= this.isValueInConstraint(c.brightness(), this.brightnessConstraint);
isInRange &= this.isValueInConstraint(c.alpha(), this.alphaConstraint);
return isInRange || false; //if its 0, return false
},
/**
* creates a copy of the range but overrides the hue
* and alpha constraints taken from the given color (if specified)
* @param {toxi.color.TColor} [c]
* @param {Number} [variance]
* @return copy
*/
copy: function(c, variance) {
variance = typeof variance === "number" ? variance : 0;
var range = new ColorRange();
range.name = this.name;
if (c) {
var hue = c.hue() + variance * MathUtils.normalizedRandom();
range.hueConstraint = [new FloatRange(hue, hue)];
range.alphaConstraint = [new FloatRange(c.alpha(), c.alpha())];
} else {
range.hueConstraint = [].concat(this.hueConstraint);
range.alphaConstraint = [].concat(this.alphaConstraint);
}
range.saturationConstraint = [].concat(this.saturationConstraint);
range.brightnessConstraint = [].concat(this.brightnessConstraint);
range.black = this.black.copy();
range.white = this.white.copy();
return range;
},
/**
* creates a new shade of the given parameter based on the other constraints
* of the range. This function has many param options:
* 1. no params
* 2.
* @param {toxi.color.Hue} hue
* 3.
* @param {toxi.color.TColor} c
* @param {Number} variance
*/
getColor: function(hue_c, variance) {
if (is.Hue(hue_c)) {
return TColor.newHSVA(hue_c.getHue(), pickRandom(this.saturationConstraint).pickRandom(), pickRandom(this.brightnessConstraint).pickRandom(), pickRandom(this.alphaConstraint).pickRandom());
}
//must be a TColor
var c = hue_c,
h,
s,
b,
a;
if (c) {
if (c.isBlack()) {
return TColor.newHSVA(c.hue(), 0, this.black.pickRandom(), c.alpha());
} else if (c.isWhite()) {
return TColor.newHSVA(c.hue(), 0, this.white.pickRandom(), c.alpha());
}
if (c.isGrey()) {
return TColor.newHSVA(c.hue(), 0, MathUtils.flipCoin() ? this.black.pickRandom() : this.white.pickRandom(), c.alpha());
}
h = c.hue() + variance * MathUtils.normalizedRandom();
a = c.alpha();
} else {
h = pickRandom(this.hueConstraint).pickRandom();
a = pickRandom(this.alphaConstraint).pickRandom();
}
s = pickRandom(this.saturationConstraint).pickRandom();
b = pickRandom(this.brightnessConstraint).pickRandom();
return TColor.newHSVA(h, s, b, a);
},
/**
* creates a new `toxi.color.ColorList` of colors based
* on constraints of this range
* 1.
* @param {Number} num integer of how many colors to get
* 2.
* @param {toxi.color.TColor} c
* @param {Number} num
* @param {Number} variance
* @return {toxi.color.ColorList} list
*/
getColors: function(c, num, variance) {
if (arguments.length < 3) {
variance = ColorRange.DEFAULT_VARIANCE;
}
if (arguments.length === 1) {
num = c;
c = undefined;
}
var list = new ColorList();
for (var i = 0; i < num; i++) {
list.add(this.getColor(c, variance));
}
return list;
},
/**
* creates a new shade of gray
* @param {Number} brightness
* @param {Number} variance
*/
getGrayscale: function(brightness, variance) {
return this.getColor(TColor.newGray(brightness), variance);
},
getName: function() {
return this.name;
},
/**
* creates a copy of the current range and adds the given one to it
* @param {toxi.color.ColorRange} range
* @return the summed copy
*/
getSum: function(range) {
return this.copy().add(range);
},
isValueInConstraint: function(val, rangeSet) {
var isValid = false;
each(rangeSet, function(r) {
isValid |= r.isValueInRange(val);
});
return isValid;
},
};
//default hue variance for #getColor
ColorRange.DEFAULT_VARIANCE = 0.035;
//build static pre-defined ColorRange's
(function(FR, un) {
ColorRange.PRESETS = {};
each(
{
light: [un, new FR(0.3, 0.7), new FR(0.9, 1.0), un, new FR(0.15, 0.3), un],
dark: [un, new FR(0.7, 1.0), new FR(0.15, 0.4), un, un, new FR(0.5, 0.75)],
bright: [un, new FR(0.8, 1.0), new FR(0.8, 1.0)],
weak: [un, new FR(0.15, 0.3), new FR(0.7, 1.0), un, new FR(0.2, 0.2), un],
neutral: [un, new FR(0.25, 0.35), new FR(0.3, 0.7), un, new FR(0.15, 0.15), new FR(0.9, 1.0)],
fresh: [un, new FR(0.4, 0.8), new FR(0.8, 1.0), un, new FR(0.05, 0.3), new FR(0.8, 1.0)],
soft: [un, new FR(0.2, 0.3), new FR(0.6, 0.9), un, new FR(0.05, 0.15), new FR(0.6, 0.9)],
hard: [un, new FR(0.9, 1.0), new FR(0.4, 1.0)],
warm: [un, new FR(0.6, 0.9), new FR(0.4, 0.9), un, new FR(0.2, 0.2), new FR(0.8, 1.0)],
cool: [un, new FR(0.05, 0.2), new FR(0.9, 1.0), un, un, new FR(0.95, 1.0)],
intense: [un, new FR(0.9, 1.0), new FR(0.2, 0.35)],
},
function(args, name) {
args.push(name);
var nameUC = name.toUpperCase();
//construct a new ColorRange without params (only do this internally)
ColorRange[nameUC] = new ColorRange();
//apply the arguments to the constructor
ColorRange.apply(ColorRange[nameUC], args);
//reference the same object from the PRESETS object
ColorRange.PRESETS[nameUC] = ColorRange[nameUC];
}
);
ColorRange.INTENSE.addBrightnessRange(new FR(0.8, 1.0));
})(FloatRange, undefined);
ColorRange.getPresetForName = function(name) {
return ColorRange.PRESETS[name.toUpperCase()];
};
module.exports = ColorRange;
},
{ "../internals/each": 102, "../internals/is": 106, "../math/mathUtils": 125, "../util/datatypes/FloatRange": 165, "./ColorList": 8, "./TColor": 20 },
],
10: [
function(require, module, exports) {
var each = require("../internals/each");
var MathUtils = require("../math/mathUtils");
var ColorRange = require("./ColorRange");
var NamedColor = require("./namedColor");
var ColorList = require("./ColorList");
var ColorTheme, _ThemePart;
/**
* @private
* internal object for a part of the theme
* @param {ColorRange} range
* @param {TColor} color.
* @param {Number} weight
*/
_ThemePart = function(range, color, weight) {
this.range = range;
this.color = color;
this.weight = weight;
};
_ThemePart.prototype.getColor = function() {
return this.range.getColor(this.color, ColorRange.DEFAULT_VARIANCE);
};
/**
* A ColorTheme is a weighted collection of {@link ColorRange}s used to define
* custom palettes with a certain balance between individual colors/shades. New
* theme parts can be added via textual descriptors referring to one of the
* preset {@link ColorRange}s and/or {@link NamedColor}s: e.g.
* "warm springgreen". For each theme part a weight has to be specified. The
* magnitude of the weight value is irrelevant and is only important in relation
* to the weights of other theme parts. For example: Theme part A with a weight
* of 0.5 will only have 1/20 of the weight of theme part B with a weight of 5.0...
*/
ColorTheme = function(name) {
this.name = name;
this.parts = [];
this._weightedSum = 0;
};
ColorTheme.prototype = {
constructor: ColorTheme,
/**
* Add a range to the theme, 2 paramater options:
* @param {toxi.color.ColorRange|string} range_or_descriptor either a range
* or a tokenized string
* @param {toxi.color.TColor|Number} color_or_weight a color if you provided
* a ColorRange, or a weight if specified a descriptor
* @param {Number} [weight] a weight if you specified a ColorRange and a TColor
* for former parameters
* @return itself
*/
addRange: function(range_or_descriptor, color_or_weight, weight) {
var self = this;
var _range, _col;
if (arguments.length === 3) {
this.parts.push(new _ThemePart(range_or_descriptor, color_or_weight, weight));
this._weightedSum += weight;
} else {
//tokenize
each(range_or_descriptor.split(" "), function(item) {
if (ColorRange.getPresetForName(item)) {
_range = ColorRange.getPresetForName(item);
} else if (NamedColor.getForName(item)) {
_col = NamedColor.getForName(item);
}
});
if (_range) {
self.addRange(_range, _col, color_or_weight);
}
}
return this;
},
getColor: function() {
var self = this,
rnd = Math.random(),
t,
currWeight;
for (var i = 0, l = this.parts.length; i < l; i++) {
t = this.parts[i];
currWeight = t.weight / this._weightedSum;
if (currWeight >= rnd) {
return t.getColor();
}
rnd -= currWeight;
}
return null;
},
/**
* Creates a {ColorList} of {TColor} based on the theme's
* ranges and balance defined by their weights
* @param {Number} num the number of colors to put in the list
*/
getColors: function(num) {
var list = new ColorList();
for (var i = 0; i < num; i++) {
list.add(this.getColor());
}
return list;
},
/**
* @return the theme's name
*/
getName: function() {
return this.name;
},
};
module.exports = ColorTheme;
},
{ "../internals/each": 102, "../math/mathUtils": 125, "./ColorList": 8, "./ColorRange": 9, "./namedColor": 26 },
],
11: [
function(require, module, exports) {
module.exports = require("./accessors").HSVAccessor;
},
{ "./accessors": 23 },
],
12: [
function(require, module, exports) {
module.exports = require("./distanceProxies").HSVDistanceProxy;
},
{ "./distanceProxies": 25 },
],
13: [
function(require, module, exports) {
var HistEntry = function(c) {
this.col = c;
this.freq = 1;
};
HistEntry.prototype = {
constructor: HistEntry,
compareTo: function(entry) {
return parseInt(entry.freq - this.freq, 10);
},
getColor: function() {
return this.col;
},
getFrequency: function() {
return this.freq;
},
};
module.exports = HistEntry;
},
{},
],
14: [
function(require, module, exports) {
var each = require("../internals").each,
Iterator = require("../internals").Iterator,
HistEntry = require("./HistEntry"),
ColorList = require("./ColorList");
/**
* Histogram constructor
* @param {toxi.color.ColorList} palette
*/
var Histogram = function(palette) {
this.palette = palette;
};
Histogram.prototype = {
constructor: Histogram,
/**
* @param {Number} tolerance color tolerance used to merge similar colors
* (based on RGB distance)
* @param {Boolean} blendCols switch to enable color blending of binned colors
* @type sorted histogram as List of HistEntry
*/
compute: function(tolerance, blendCols) {
var self = this;
this.entries = [];
var maxFreq = 1;
this.palette.each(function(c) {
var existing,
e,
i = 0,
l = self.entries.length;
for (i = 0; i < l; i++) {
e = self.entries[i];
if (e.col.distanceToRGB(c) < tolerance) {
if (blendCols) {
e.col.blend(c, 1 / (e.freq + 1));
}
existing = e;
break;
}
}
if (existing !== undefined) {
existing.freq++;
if (existing.freq > maxFreq) {
maxFreq = existing.freq;
}
} else {
self.entries.push(new HistEntry(c));
}
});
this.entries.sort();
maxFreq = 1 / this.palette.size();
each(this.entries, function(e) {
e.freq *= maxFreq;
});
return this.entries;
},
getEntries: function() {
return this.entries;
},
getPalette: function() {
return this.palette;
},
iterator: function() {
return new Iterator(this.entries);
},
setPalette: function(palette) {
this.palette = palette;
},
};
Histogram.newFromARGBArray = function(pixels, numSamples, tolerance, blendCols) {
var h = new Histogram(ColorList.createFromARGBArray(pixels, numSamples, false));
h.compute(tolerance, blendCols);
return h;
};
module.exports = Histogram;
},
{ "../internals": 98, "./ColorList": 8, "./HistEntry": 13 },
],
15: [
function(require, module, exports) {
var LinkedMap = require("../internals/LinkedMap");
var each = require("../internals/each");
var namedHues = new LinkedMap(),
primaryHues = [],
Hue;
/*
* This class defines color hues and allows them to be access by name. There are
* also methods to check if a hue is one of the 7 primary hues (rainbow) or to
* find the closest defined hue for a given color.
*/
/**
* construct a new Hue
* @param {String} name
* @param {Number} hue (range 0-1)
* @param {Boolean} [isPrimary] optionally flag as a primary hue
* @constructor
*/
Hue = function(name, hue, isPrimary) {
this._isPrimary = isPrimary === true;
this.name = name;
this.hue = hue;
namedHues.put(name, this);
if (this._isPrimary) {
primaryHues.push(this);
}
};
Hue.prototype = {
constructor: Hue,
getHue: function() {
return this.hue;
},
getName: function() {
return this.name;
},
isPrimary: function() {
return this._isPrimary;
},
toString: function() {
return "Hue: ID:" + this.name + " @ " + parseInt(this.hue * 360, 10) + " degrees";
},
};
//add presets object, like what `toxi.color.ColorRange` has,
//allows for easy look-up
Hue.PRESETS = {};
//add the basic hues
each([["red", true], ["orange", true], ["yellow", true], ["lime"], ["green", true], ["teal"], ["cyan"], ["azure"], ["blue", true], ["indigo"], ["purple", true], ["pink", true]], function(item, i) {
var name = item[0],
nameUC = name.toUpperCase(),
isPrimary = item[1];
Hue[nameUC] = new Hue(name, (i * 30) / 360.0, isPrimary);
Hue.PRESETS[nameUC] = Hue[nameUC];
});
// Tolerance value for checking if a given hue is primary
Hue.PRIMARY_VARIANCE = 0.01;
/**
* Finds the closest defined & named Hue for the given hue vale.
* Optionally, the serach can be limited to primary hues only.
* @param {Number} hue
* @param {Boolean} [primaryOnly]
* @returns Hue
*/
Hue.getClosest = function(hue, primaryOnly) {
hue %= 1;
primaryOnly = primaryOnly === true;
var dist = Number.MAX_VALUE,
closest,
hues = primaryOnly ? primaryHues : namedHues.getArray();
each(hues, function(h) {
var d = Math.min(Math.abs(h.getHue() - hue), Math.abs(1 + h.getHue() - hue));
if (d < dist) {
dist = d;
closest = h;
}
});
return closest;
};
Hue.getForName = function(name) {
return namedHues.get(name);
};
Hue.isPrimary = function(hue, variance) {
variance = typeof variance === "number" ? variance : Hue.PRIMARY_VARIANCE;
var isPrimary = false;
for (var i = 0, len = primaryHues.length; i < len; i++) {
var h = primaryHues[i];
if (Math.abs(hue - h.getHue()) < variance) {
isPrimary = true;
break;
}
}
return isPrimary;
};
module.exports = Hue;
},
{ "../internals/LinkedMap": 100, "../internals/each": 102 },
],
16: [
function(require, module, exports) {
module.exports = require("./accessors").LuminanceAccessor;
},
{ "./accessors": 23 },
],
17: [
function(require, module, exports) {
var ProximityComparator = function(col, proxy) {
this.col = col;
this.proxy = proxy;
};
ProximityComparator.prototype.compare = function(a, b) {
var da = this.proxy.distanceBetween(this.col, a);
var db = this.proxy.distanceBetween(this.col, b);
return da < db ? -1 : da > db ? 1 : 0;
};
module.exports = ProximityComparator;
},
{},
],
18: [
function(require, module, exports) {
module.exports = require("./accessors").RGBAccessor;
},
{ "./accessors": 23 },
],
19: [
function(require, module, exports) {
module.exports = require("./distanceProxies").RGBDistanceProxy;
},
{ "./distanceProxies": 25 },
],
20: [
function(require, module, exports) {
var numberComparator = require("../internals/numberComparator"),
is = require("../internals/is"),
mathUtils = require("../math/mathUtils"),
vectors = require("../geom/vectors"),
Vec2D = vectors.Vec2D,
Vec3D = vectors.Vec3D,
Hue = require("./Hue");
//private
var dec2hex = function decimalToHexString(number) {
if (number < 0) {
number = 0xffffffff + number + 1;
}
return number.toString(16);
};
/**
@class Creates a new TColor instance
@memberOf toxi.color
*/
var TColor = function(tcolor) {
this.rgb = [];
this.hsv = [];
this.cmyk = [];
this._alpha = 1.0;
if (tcolor !== undefined) {
var buffer = tcolor.toCMYKAArray();
this.cmyk = buffer.splice(0, 4);
this.hsv = tcolor.toHSVAArray().splice(0, 3);
this.rgb = tcolor.toRGBAArray().splice(0, 3);
this._alpha = tcolor._alpha;
}
};
TColor.prototype = {
add: function(c) {
return this.copy().addSelf(c);
},
addSelf: function(c) {
this.rgb[0] = mathUtils.min(this.rgb[0] + c.rgb[0], 1);
this.rgb[1] = mathUtils.min(this.rgb[1] + c.rgb[1], 1);
this.rgb[2] = mathUtils.min(this.rgb[2] + c.rgb[2], 1);
return this.setRGB(this.rgb);
},
/**
* Changes the brightness of the color by the given amount in the direction
* towards either the black or white point (depending on if current
* brightness >= 50%)
*
* @param {Number} amount
* @return itself
*/
adjustConstrast: function(amount) {
return this.hsv[2] < 0.5 ? this.darken(amount) : this.lighten(amount);
},
/**
* Adds the given HSV values as offsets to the current color. Hue will
* automatically wrap.
*
* @param h
* @param s
* @param v
* @return itself
*/
adjustHSV: function(h, s, v) {
return this.setHSV([this.hsv[0] + h, this.hsv[1] + s, this.hsv[2] + v]);
},
/**
* Adds the given RGB values as offsets to the current color. TColor will
* clip at black or white.
* @param r
* @param g
* @param b
* @return itself
*/
adjustRGB: function(r, g, b) {
return this.setRGB([this.rgb[0] + r, this.rgb[1] + g, this.rgb[2] + b]);
},
alpha: function() {
return this._alpha;
},
/**
* Rotates this color by a random amount (not exceeding the one specified)
* and creates variations in saturation and brightness based on the 2nd
* parameter.
* @param theta
* max. rotation angle (in radians)
* @param delta
* max. sat/bri variance
* @return itself
*/
analog: function(theta, delta) {
var angle = mathUtils.degrees(theta);
this.rotateRYB(angle * mathUtils.normalizedRandom());
this.hsv[1] += delta * mathUtils.normalizedRandom();
this.hsv[2] += delta * mathUtils.normalizedRandom();
return this.setHSV(this.hsv);
},
//shouldnt this be this.cmyk[3]?
black: function() {
return this.cmyk[3];
},
/**
* Blends the color with the given one by the stated amount
* @param c
* target color
* @param t
* interpolation factor
* @return itself
*/
blend: function(c, t) {
if (t === undefined) {
t = 0.5;
}
var crgb = c.toRGBAArray();
this.rgb[0] += (crgb[0] - this.rgb[0]) * t;
this.rgb[1] += (crgb[1] - this.rgb[1]) * t;
this.rgb[2] += (crgb[2] - this.rgb[2]) * t;
this._alpha += (c._alpha - this._alpha) * t;
return this.setRGB(this.rgb);
},
blue: function() {
return this.rgb[2];
},
brightness: function() {
return this.hsv[2];
},
complement: function() {
return this.rotateRYB(180);
},
copy: function() {
return new TColor(this);
},
cyan: function() {
return this.cmyk[0];
},
darken: function(step) {
this.hsv[2] = mathUtils.clip(this.hsv[2] - step, 0, 1);
return this.setHSV(this.hsv);
},
/**
Reduced the color's saturation by the given amount.
@param step
@return itself
*/
desaturate: function(step) {
this.hsv[1] = mathUtils.clip(this.hsv[1] - step, 0, 1);
return this.setHSV(this.hsv);
},
differenceTo: function(c) {
return TColor.newRGB(Math.abs(this.rgb[0] - c.rgb[0]), Math.abs(this.rgb[1] - c.rgb[1]), Math.abs(this.rgb[2] - c.rgb[2]));
},
distanceToCMYK: function(c) {
var ccmyk = c.toCMYKAArray();
var dc = this.cmyk[0] - ccmyk[0];
var dm = this.cmyk[1] - ccmyk[1];
var dy = this.cmyk[2] - ccmyk[2];
var dk = this.cmyk[3] - ccmyk[3];
return Math.sqrt(dc * dc + dm * dm + dy * dy + dk * dk);
},
distanceToHSV: function(c) {
var hue = this.hsv[0] * mathUtils.TWO_PI;
var hue2 = c.hue() * mathUtils.TWO_PI;
var v1 = new Vec3D(mathUtils.cos(hue) * this.hsv[1], mathUtils.sin(hue) * this.hsv[1], this.hsv[2]);
var v2 = new Vec3D(mathUtils.cos(hue2) * c.saturation(), mathUtils.sin(hue2) * c.saturation(), c.brightness());
return v1.distanceTo(v2);
},
distanceToRGB: function(c) {
var crgb = c.toRGBAArray();
var dr = this.rgb[0] - crgb[0];
var dg = this.rgb[1] - crgb[1];
var db = this.rgb[2] - crgb[2];
return Math.sqrt(dr * dr + dg * dg + db * db);
},
equals: function(o) {
if (is.TColor(o)) {
var c = o;
var dr = c.rgb[0] - this.rgb[0];
var dg = c.rgb[1] - this.rgb[1];
var db = c.rgb[2] - this.rgb[2];
var da = c.alpha() - this._alpha;
var d = Math.sqrt(dr * dr + dg * dg + db * db + da * da);
return d < TColor.EPS;
}
return false;
},
getAnalog: function(theta, delta) {
return new TColor(this).analog(theta, delta);
},
getBlended: function(c, t) {
return new TColor(this).blend(c, t);
},
getClosestHue: function(primaryOnly) {
return Hue.getClosest(this.hsv[0], primaryOnly === true);
},
getComplement: function() {
return new TColor(this).complement();
},
getComponentValue: function(criteria) {
return criteria.getComponentValueFor(this);
},
getDarkened: function(step) {
return new TColor(this).darken(step);
},
getDesaturated: function(step) {
return new TColor(this).desaturate(step);
},
getDifferenceTo: function(c) {
return this.copy().differenceTo(c);
},
getInverted: function() {
return new TColor(this).invert();
},
getLightened: function(step) {
return new TColor(this).lighten(step);
},
getRotatedRYB: function(theta) {
return new TColor(this).rotateRYB(theta);
},
getSaturated: function(step) {
return new TColor(this).saturate(step);
},
green: function() {
return this.rgb[1];
},
hue: function() {
return this.hsv[0];
},
invert: function() {
this.rgb[0] = 1 - this.rgb[0];
this.rgb[1] = 1 - this.rgb[1];
this.rgb[2] = 1 - this.rgb[2];
return this.setRGB(this.rgb);
},
isBlack: function() {
return this.rgb[0] <= TColor.BLACK_POINT && (this.rgb[0] === this.rgb[1] && this.rgb[0] === this.rgb[2]);
},
isGrey: function() {
return this.hsv[1] < TColor.GREY_THRESHOLD;
},
/*
isPrimary:function() {
return Hue.isPrimary(this.hsv[0]);
},*/
isWhite: function() {
return this.rgb[0] >= TColor.WHITE_POINT && this.rgb[0] === this.rgb[1] && this.rgb[0] === this.rgb[2];
},
lighten: function(step) {
this.hsv[2] = mathUtils.clip(this.hsv[2] + step, 0, 1);
return this.setHSV(this.hsv);
},
luminance: function() {
return this.rgb[0] * 0.299 + this.rgb[1] * 0.587 + this.rgb[2] * 0.114;
},
magenta: function() {
return this.cmyk[1];
},
red: function() {
return this.rgb[0];
},
rotateRYB: function(theta) {
var deg = parseInt(mathUtils.degrees(theta), 10),
h = this.hsv[0] * 360,
i = 0,
p,
q;
theta %= 360;
var resultHue = 0;
for (i = 0; i < TColor.RYB_WHEEL.length - 1; i++) {
p = TColor.RYB_WHEEL[i];
q = TColor.RYB_WHEEL[i + 1];
if (q.y < p.y) {
q.y += 360;
}
if (p.y <= h && h <= q.y) {
resultHue = p.x + ((q.x - p.x) * (h - p.y)) / (q.y - p.y);
break;
}
}
// And the user-given angle (e.g. complement).
resultHue = (resultHue + theta) % 360;
// For the given angle, find out what hue is
// located there on the artistic color wheel.
for (i = 0; i < TColor.RYB_WHEEL.length - 1; i++) {
p = TColor.RYB_WHEEL[i];
q = TColor.RYB_WHEEL[i + 1];
if (q.y < p.y) {
q.y += 360;
}
if (p.x <= resultHue && resultHue <= q.x) {
h = p.y + ((q.y - p.y) * (resultHue - p.x)) / (q.x - p.x);
break;
}
}
this.hsv[0] = (h % 360) / 360.0;
return this.setHSV(this.hsv);
},
saturate: function(step) {
this.hsv[1] = mathUtils.clip(this.hsv[1] + step, 0, 1);
return this.setHSV(this.hsv);
},
saturation: function() {
return this.hsv[1];
},
setAlpha: function(alpha) {
this._alpha = alpha;
return this;
},
setARGB: function(argb) {
this.setRGB(((argb >> 16) & 0xff) * TColor.INV8BIT, ((argb >> 8) & 0xff) * TColor.INV8BIT, (argb & 0xff) * TColor.INV8BIT);
this._alpha = (argb >>> 24) * TColor.INV8BIT;
return this;
},
setBlack: function(val) {
this.cmyk[3] = val;
return this.setCMYK(this.cmyk);
},
setBlue: function(blue) {
this.rgb[2] = blue;
return this.setRGB(this.rgb);
},
setBrightness: function(brightness) {
this.hsv[2] = mathUtils.clip(brightness, 0, 1);
return this.setHSV(this.hsv);
},
setCMYK: function(c, m, y, k) {
//if it was passed in as an array instead of separate values
if (is.Array(c)) {
m = c[1];
y = c[2];
k = c[3];
c = c[0];
}
this.cmyk[0] = c;
this.cmyk[1] = m;
this.cmyk[2] = y;
this.cmyk[3] = k;
this.rgb = TColor.cmykToRGB(this.cmyk[0], this.cmyk[1], this.cmyk[2], this.cmyk[3]);
this.hsv = TColor.rgbToHSV(this.rgb[0], this.rgb[1], this.rgb[2]);
return this;
},
setComponent: function(criteria, val) {
criteria.setComponentValueFor(this, val);
return this;
},
setCyan: function(val) {
this.cmyk[0] = val;
return this.setCMYK(this.cmyk);
},
setGreen: function(green) {
this.rgb[1] = green;
return this.setRGB(this.rgb);
},
setHSV: function(h, s, v) {
if (is.Array(h)) {
s = h[1];
v = h[2];
h = h[0];
}
var newHSV = [h, s, v];
this.hsv[0] = newHSV[0] % 1;
if (this.hsv[0] < 0) {
this.hsv[0]++;
}
this.hsv[1] = mathUtils.clip(newHSV[1], 0, 1);
this.hsv[2] = mathUtils.clip(newHSV[2], 0, 1);
this.rgb = TColor.hsvToRGB(this.hsv[0], this.hsv[1], this.hsv[2]);
this.cmyk = TColor.rgbToCMYK(this.rgb[0], this.rgb[1], this.rgb[2]);
return this;
},
setHue: function(hue) {
hue %= 1.0;
if (hue < 0.0) {
hue++;
}
this.hsv[0] = hue;
return this.setHSV(this.hsv);
},
setMagenta: function(val) {
this.cmyk[1] = val;
return this.setCMYK(this.cmyk);
},
setRed: function(red) {
this.rgb[0] = red;
return this.setRGB(this.rgb);
},
setRGB: function(r, g, b) {
if (is.Array(r)) {
g = r[1];
b = r[2];
r = r[0];
}
this.rgb[0] = mathUtils.clip(r, 0, 1);
this.rgb[1] = mathUtils.clip(g, 0, 1);
this.rgb[2] = mathUtils.clip(b, 0, 1);
this.cmyk = TColor.rgbToCMYK(this.rgb[0], this.rgb[1], this.rgb[2]);
this.hsv = TColor.rgbToHSV(this.rgb[0], this.rgb[1], this.rgb[2]);
return this;
},
setSaturation: function(saturation) {
this.hsv[1] = mathUtils.clip(saturation, 0, 1);
return this.setHSV(this.hsv);
},
setYellow: function(val) {
this.cmyk[2] = val;
return this.setCMYK(this.cmyk);
},
sub: function(c) {
return this.copy().subSelf(c);
},
subSelf: function(c) {
this.rgb[0] = mathUtils.max(this.rgb[0] - c.rgb[0], 0);
this.rgb[1] = mathUtils.max(this.rgb[1] - c.rgb[1], 0);
this.rgb[2] = mathUtils.max(this.rgb[2] - c.rgb[2], 0);
return this.setRGB(this.rgb);
},
toARGB: function() {
var r = parseInt(this.rgb[0] * 255, 10),
g = parseInt(this.rgb[1] * 255, 10),
b = parseInt(this.rgb[2] * 255, 10),
a = parseInt(this._alpha * 255, 10);
return (r << 16) | (g << 8) | b | (a << 24);
},
toCMYKAArray: function(cmyka) {
if (cmyka === undefined) {
cmyka = [];
}
cmyka[0] = this.cmyk[0];
cmyka[1] = this.cmyk[1];
cmyka[2] = this.cmyk[2];
cmyka[3] = this.cmyk[3];
cmyka[4] = this._alpha;
return cmyka;
},
toHex: function() {
var hex = dec2hex(this.toARGB());
if (hex.length > 6) {
hex = hex.substring(2);
}
return hex;
},
toHexCSS: function() {
return "#" + this.toHex();
},
toHSVAArray: function(hsva) {
if (hsva === undefined) {
hsva = [];
}
hsva[0] = this.hsv[0];
hsva[1] = this.hsv[1];
hsva[2] = this.hsv[2];
hsva[3] = this._alpha;
return hsva;
},
/**
* to CSS's hsl() string
*/
toHSLCSS: function() {
var hsv = this.hsv;
//hue is 0 - 360
var h = Math.floor(hsv[0] * 360);
//saturation & value/luminosity is 0-100 (%)
var s = Math.floor(hsv[1] * 100);
var v = Math.floor(hsv[2] * 100);
return "hsl(" + h + "," + s + "%," + v + "%)";
},
/**
* to CSS's hsla() string
*/
toHSLACSS: function() {
var hsv = this.hsv;
//hue is 0 - 360
var h = Math.floor(hsv[0] * 360);
//saturation & value/luminosity is 0-100 (%)
var s = Math.floor(hsv[1] * 100);
var v = Math.floor(hsv[2] * 100);
//alpha stays in range 0 - 1
return "hsla(" + h + "," + s + "%," + v + "%," + this._alpha + ")";
},
/**
* to integer for color
*/
toInt: function() {
return Number("0x" + this.toHex());
},
/**
* to an Array of RGBA values
* @param rgba
* @param offset (optional)
* @return rgba array
*/
toRGBAArray: function(rgba, offset) {
rgba = rgba || [];
offset = offset || 0;
rgba[offset++] = this.rgb[0];
rgba[offset++] = this.rgb[1];
rgba[offset++] = this.rgb[2];
rgba[offset] = this._alpha;
return rgba;
},
/**
* to an Array of RGBA decimal values, i.e. [255,255,255,255] for solid white
* @param {Array|TypedArray} [rgba] optionally pass in an array or a TypedArray such as Uint8ClampedArray
* @param {Number} [offset] index offset to put these values in the array
* @return {Array}
*/
toRGBADecimalArray: function(rgba, offset) {
rgba = rgba || [];
offset = offset || 0;
rgba[offset++] = this.rgb[0] * 255;
rgba[offset++] = this.rgb[1] * 255;
rgba[offset++] = this.rgb[2] * 255;
rgba[offset] = this._alpha * 255;
return rgba;
},
toRGBCSS: function(asPercents) {
var rgb = this.rgb,
mult = asPercents ? 100 : 255,
u = asPercents ? "%" : "",
f = Math.floor;
return "rgb(" + f(rgb[0] * mult) + u + "," + f(rgb[1] * mult) + u + "," + f(rgb[2] * mult) + u + ")";
},
/**
* to an rgba string valid for CSS Color Module's rgba()
* @param asPercents if true creates string based on percents rather than 0-255
*/
toRGBACSS: function(asPercents) {
var rgb = this.rgb,
mult = asPercents ? 100 : 255,
u = asPercents ? "%" : "",
f = Math.floor;
return "rgba(" + f(rgb[0] * mult) + u + "," + f(rgb[1] * mult) + u + "," + f(rgb[2] * mult) + u + "," + this._alpha + ")";
},
toString: function() {
return "TColor: rgb: " + this.rgb[0] + ", " + this.rgb[1] + ", " + this.rgb[2] + " hsv: " + this.hsv[0] + "," + this.hsv[1] + "," + this.hsv[2] + " cmyk: " + this.cmyk[0] + ", " + this.cmyk[1] + "," + this.cmyk[2] + "," + this.cmyk[3] + " alpha: " + this._alpha;
},
yellow: function() {
return this.cmyk[2];
},
};
TColor.INV60DEGREES = 60.0 / 360;
TColor.INV8BIT = 1.0 / 255;
TColor.EPS = 0.001;
/**
* Maximum rgb component value for a color to be classified as black.
* @see #isBlack()
*/
TColor.BLACK_POINT = 0.08;
/**
* Minimum rgb component value for a color to be classified as white.
* @see #isWhite()
*/
TColor.WHITE_POINT = 1.0;
/**
* Maximum saturations value for a color to be classified as grey
* @see #isGrey()
*/
TColor.GREY_THRESHOLD = 0.01;
/**
* Converts CMYK floats into an RGB array.
* @param c
* @param m
* @param y
* @param k
* @param rgb optional rgb array to populate
* @return rgb array
*/
TColor.cmykToRGB = function(c, m, y, k, rgb) {
if (rgb === undefined) {
rgb = [0, 0, 0];
}
rgb[0] = 1.0 - Math.min(1.0, c + k);
rgb[1] = 1.0 - Math.min(1.0, m + k);
rgb[2] = 1.0 - Math.min(1.0, y + k);
return rgb;
};
/**
* Converts hex string into a RGB array.
* @param hexRGB
* @param rgb array optional
* @return rgb array
*/
TColor.hexToRGB = function(hexRGB, rgb) {
if (rgb === undefined) {
rgb = [];
}
//var rgbInt = parseInt(hexRGB,16);
hexRGB = hexRGB.charAt(0) == "#" ? hexRGB.substring(1, 7) : hexRGB;
rgb[0] = parseInt(hexRGB.substring(0, 2), 16) * TColor.INV8BIT; //((rgbInt >> 16) & 0xff) * TColor.INV8BIT;
rgb[1] = parseInt(hexRGB.substring(2, 4), 16) * TColor.INV8BIT; //((rgbInt >> 8) & 0xff) * TColor.INV8BIT;
rgb[2] = parseInt(hexRGB.substring(4, 6), 16) * TColor.INV8BIT; //((rgbInt & 0xff) * TColor.INV8BIT);
return rgb;
};
/**
* Converts HSV values into RGB array.
* @param h
* @param s
* @param v
* @param rgb array optional
* @return rgb array
*/
TColor.hsvToRGB = function(h, s, v, rgb) {
if (rgb === undefined) {
rgb = [];
}
if (s === 0.0) {
rgb[0] = rgb[1] = rgb[2] = v;
} else {
h /= TColor.INV60DEGREES;
var i = parseInt(h, 10),
f = h - i,
p = v * (1 - s),
q = v * (1 - s * f),
t = v * (1 - s * (1 - f));
if (i === 0) {
rgb[0] = v;
rgb[1] = t;
rgb[2] = p;
} else if (i == 1) {
rgb[0] = q;
rgb[1] = v;
rgb[2] = p;
} else if (i == 2) {
rgb[0] = p;
rgb[1] = v;
rgb[2] = t;
} else if (i == 3) {
rgb[0] = p;
rgb[1] = q;
rgb[2] = v;
} else if (i == 4) {
rgb[0] = t;
rgb[1] = p;
rgb[2] = v;
} else {
rgb[0] = v;
rgb[1] = p;
rgb[2] = q;
}
}
return rgb;
};
/**
* Converts CIE Lab to RGB components.
* First we have to convert to XYZ color space. Conversion involves using a
* white point, in this case D65 which represents daylight illumination.
* Algorithm adopted from: http://www.easyrgb.com/math.php
* @param l
* @param a
* @param b
* @param rgb
* @return rgb array
*/
TColor.labToRGB = function(l, a, b, rgb) {
if (rgb === undefined) {
rgb = [];
}
var y = (l + 16) / 116.0,
x = a / 500.0 + y,
z = y - b / 200.0,
i = 0;
rgb[0] = x;
rgb[1] = y;
rgb[2] = z;
for (i = 0; i < 3; i++) {
var p = Math.pow(rgb[i], 3);
if (p > 0.008856) {
rgb[i] = p;
} else {
rgb[i] = (rgb[i] - 16 / 116.0) / 7.787;
}
}
// Observer = 2, Illuminant = D65
x = rgb[0] * 0.95047;
y = rgb[1];
z = rgb[2] * 1.08883;
rgb[0] = x * 3.2406 + y * -1.5372 + z * -0.4986;
rgb[1] = x * -0.9689 + y * 1.8758 + z * 0.0415;
rgb[2] = x * 0.0557 + y * -0.204 + z * 1.057;
var tpow = 1 / 2.4;
for (i = 0; i < 3; i++) {
if (rgb[i] > 0.0031308) {
rgb[i] = 1.055 * Math.pow(rgb[i], tpow) - 0.055;
} else {
rgb[i] = 12.92 * rgb[i];
}
}
return rgb;
};
/**
* Factory method. Creates new color from ARGB int.
* @param argb
* @return new color
*/
TColor.newARGB = function(argb) {
return TColor.newRGBA(((argb >> 16) & 0xff) * TColor.INV8BIT, ((argb >> 8) & 0xff) * TColor.INV8BIT, (argb & 0xff) * TColor.INV8BIT, (argb >>> 24) * TColor.INV8BIT);
};
/**
Factory method. Creates new color from CMYK values.
@param c
@param m
@param y
@param k
@return new color
*/
TColor.newCMYK = function(c, m, y, k) {
return TColor.newCMYKA(c, m, y, k, 1);
};
/**
Factory method. Creates new color from CMYK + alpha values.
@param c
@param m
@param y
@param k
@param a
@return new color
*/
TColor.newCMYKA = function(c, m, y, k, a) {
var col = new TColor();
col.setCMYK([c, m, y, k]);
col.setAlpha(mathUtils.clip(a, 0, 1));
return col;
};
/**
Factory method. Creats a new color from any CSS color values
@param {String} css value
@return new color
*/
TColor.newCSS = function(css) {
//remove all spaces
while (css.indexOf(" ") > -1) {
css = css.replace(" ", "");
}
css = css.toLowerCase();
function digits(colorFnStr) {
//hack off the trailing )
var str = css.substr(0, css.length - 1);
//hack off rgb(, rgba(, hsl(, hsla(
return str.substr(colorFnStr.length + 1, str.length).split(",");
}
function makeNumbers(digits) {
var i = 0,
l = digits.length;
for (i = 0; i < l; i++) {
//cast to numbers from Strings
digits[i] = Number(digits[i]);
}
return digits;
}
var conversions = {
"#": function() {
return TColor.newHex(css.substr(1, css.length));
},
rgba: function() {
var vals = makeNumbers(digits("rgba"));
return TColor.newRGBA(vals[0] / 255, vals[1] / 255, vals[2] / 255, vals[3]);
},
rgb: function() {
var vals = makeNumbers(digits("rgb"));
return TColor.newRGBA(vals[0] / 255, vals[1] / 255, vals[2] / 255, 1.0);
},
hsla: function(vals) {
vals = vals || digits("hsla");
vals[0] = Number(vals[0]) / 360;
vals[1] = Number(vals[1].substr(0, vals[1].length - 1)) / 100;
vals[2] = Number(vals[2].substr(0, vals[2].length - 1)) / 100;
vals[3] = Number(vals[3]);
return TColor.newHSVA(vals[0], vals[1], vals[2], vals[3]);
},
hsl: function() {
var vals = digits("hsl");
vals.push(1.0);
return conversions.hsla(vals);
},
};
//if it was an x11 name return a copy
if (TColor.X11[css] !== undefined) {
gitextract_t56dc836/ ├── 001_StarField/ │ ├── P5/ │ │ ├── Star.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_001_StarField/ │ │ ├── CC_001_StarField.pde │ │ └── Star.pde │ └── sketch.pdez ├── 002_MengerSponge/ │ ├── P5/ │ │ ├── box.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_002_MengerSponge/ │ │ ├── Box.pde │ │ └── CC_002_MengerSponge.pde │ └── sketch.pdez ├── 003_Snake_game/ │ ├── P5/ │ │ ├── index.html │ │ ├── sketch.js │ │ └── snake.js │ └── Processing/ │ ├── CC_003_Snake_game/ │ │ ├── CC_003_Snake_game.pde │ │ └── Snake.pde │ └── sketch.pdez ├── 004_PurpleRain/ │ ├── P5/ │ │ ├── drop.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_004_PurpleRain/ │ │ ├── CC_004_PurpleRain.pde │ │ └── Drop.pde │ └── sketch.pdez ├── 005_Space_invaders/ │ ├── P5/ │ │ ├── drop.js │ │ ├── flower.js │ │ ├── index.html │ │ ├── ship.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_005_Space_invaders/ │ │ ├── CC_005_Space_invaders.pde │ │ ├── Drop.pde │ │ ├── Flower.pde │ │ └── Ship.pde │ └── sketch.pdez ├── 006_Mitosis/ │ ├── P5/ │ │ ├── cell.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_006_Mitosis/ │ │ ├── CC_006_Mitosis.pde │ │ └── Cell.pde │ └── sketch.pdez ├── 007_SolarSystemGenerator/ │ ├── P5/ │ │ ├── index.html │ │ ├── planet.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_007_SolarSystemGenerator/ │ │ ├── CC_007_SolarSystemGenerator.pde │ │ └── Planet.pde │ └── sketch.pdez ├── 008_SolarSystemGenerator3D/ │ ├── P5/ │ │ ├── Planet.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_008_SolarSystemGenerator3D/ │ │ ├── CC_008_SolarSystemGenerator3D.pde │ │ └── Planet.pde │ └── sketch.pdez ├── 009_SolarSystemGenerator3D_texture/ │ ├── P5/ │ │ ├── Planet.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_009_SolarSystemGenerator3D_texture/ │ │ ├── CC_009_SolarSystemGenerator3D_texture.pde │ │ └── Planet.pde │ └── sketch.pdez ├── 010_Maze_DFS/ │ ├── P5/ │ │ ├── cell.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_010_Maze_DFS/ │ │ ├── CC_010_Maze_DFS.pde │ │ └── cell.pde │ └── sketch.pdez ├── 011_PerlinNoiseTerrain/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_011_PerlinNoiseTerrain/ │ │ └── CC_011_PerlinNoiseTerrain.pde │ └── sketch.pdez ├── 012_LorenzAttractor/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_012_LorenzAttractor/ │ │ └── CC_012_LorenzAttractor.pde │ └── sketch.pdez ├── 013_ReactionDiffusion/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_013_ReactionDiffusion/ │ │ └── CC_013_ReactionDiffusion.pde │ └── sketch.pdez ├── 014_FractalTree/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_014_FractalTree/ │ │ └── CC_014_FractalTree.pde │ └── sketch.pdez ├── 015_FractalTreeArray/ │ ├── P5/ │ │ ├── branch.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_015_FractalTreeArray/ │ │ ├── Branch.pde │ │ └── CC_015_FractalTreeArray.pde │ └── sketch.pdez ├── 016_LSystem/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_016_LSystem/ │ │ └── CC_016_LSystem.pde │ └── sketch.pdez ├── 017_SpaceColonizer/ │ ├── P5/ │ │ ├── branch.js │ │ ├── index.html │ │ ├── leaf.js │ │ ├── sketch.js │ │ └── tree.js │ └── Processing/ │ ├── CC_017_SpaceColonizer/ │ │ ├── Branch.pde │ │ ├── CC_017_SpaceColonizer.pde │ │ ├── Leaf.pde │ │ └── Tree.pde │ └── sketch.pdez ├── 018_SpaceColonizer3D/ │ └── Processing/ │ ├── CC_018_SpaceColonizer3D/ │ │ ├── Branch.pde │ │ ├── CC_018_SpaceColonizer3D.pde │ │ ├── Leaf.pde │ │ └── Tree.pde │ └── sketch.pdez ├── 019_Superellipse/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_019_Superellipse/ │ │ ├── CC_019_Superellipse.pde │ │ └── Slider.pde │ └── sketch.pdez ├── 020_ClothSimulation/ │ ├── P5/ │ │ ├── index.html │ │ ├── particle.js │ │ ├── sketch.js │ │ ├── spring.js │ │ ├── style.css │ │ └── toxiclibs/ │ │ ├── toxichelper.js │ │ └── toxiclibs.js │ └── Processing/ │ ├── CC_020_Cloth2D/ │ │ ├── CC_020_Cloth2D.pde │ │ ├── Particle.pde │ │ └── Spring.pde │ ├── CC_020_Cloth3D/ │ │ └── Processing/ │ │ ├── CC_020_Cloth3D/ │ │ │ ├── CC_020_Cloth3D.pde │ │ │ ├── Particle.pde │ │ │ └── Spring.pde │ │ └── sketch.pdez │ └── sketch.pdez ├── 021_Mandelbrot/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_021_Mandelbrot/ │ │ └── CC_021_Mandelbrot.pde │ └── sketch.pdez ├── 022_JuliaSet/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_022_JuliaSet/ │ │ └── CC_022_JuliaSet.pde │ └── sketch.pdez ├── 023_SuperShape2D/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_023_SuperShape2D/ │ │ └── CC_023_SuperShape2D.pde │ └── sketch.pdez ├── 024_PerlinNoiseFlowField/ │ ├── P5/ │ │ ├── index.html │ │ ├── particle.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_024_PerlinNoiseFlowField/ │ │ ├── CC_024_PerlinNoiseFlowField.pde │ │ ├── Particle.pde │ │ └── flowfield.pde │ └── sketch.pdez ├── 025_SphereGeometry/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_025_SphereGeometry/ │ │ └── CC_025_SphereGeometry.pde │ └── sketch.pdez ├── 026_SuperShape3D/ │ └── Processing/ │ ├── CC_026_SuperShape3D/ │ │ └── CC_026_SuperShape3D.pde │ └── sketch.pdez ├── 027_FireWorks/ │ ├── P5/ │ │ ├── firework.js │ │ ├── index.html │ │ ├── particle.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_027_FireWorks_2D/ │ │ ├── CC_027_FireWorks_2D.pde │ │ ├── Particle.pde │ │ └── ParticleSystem.pde │ ├── CC_027_FireWorks_3D/ │ │ ├── CC_027_FireWorks_3D.pde │ │ ├── Particle.pde │ │ └── ParticleSystem.pde │ └── sketch.pdez ├── 028_MetaBalls/ │ ├── P5/ │ │ ├── blob.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_028_MetaBalls/ │ │ ├── Blob.pde │ │ └── CC_028_MetaBalls.pde │ └── sketch.pdez ├── 029_SmartRockets/ │ ├── P5/ │ │ ├── dna.js │ │ ├── index.html │ │ ├── population.js │ │ ├── rocket.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_029_SmartRockets/ │ │ ├── CC_029_SmartRockets.pde │ │ ├── Dna.pde │ │ ├── Population.pde │ │ └── Rocket.pde │ └── sketch.pdez ├── 030_Phyllotaxis/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_030_Phyllotaxis/ │ │ └── CC_030_Phyllotaxis.pde │ └── sketch.pdez ├── 031_FlappyBird/ │ ├── P5/ │ │ ├── bird.js │ │ ├── index.html │ │ ├── pipe.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_031_FlappyBird/ │ │ ├── Bird.pde │ │ ├── CC_031_FlappyBird.pde │ │ └── Pipe.pde │ └── sketch.pdez ├── 032.1_agar.io/ │ ├── P5/ │ │ ├── blob.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_032_agar.io/ │ │ ├── Blob.pde │ │ └── CC_032_agar.io.pde │ └── sketch.pdez ├── 032.2_agar.io_sockets/ │ └── Node/ │ ├── package.json │ ├── public/ │ │ ├── blob.js │ │ ├── index.html │ │ └── sketch.js │ └── server.js ├── 033_poisson_disc/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_033_poisson_disc/ │ │ └── CC_033_poisson_disc.pde │ └── sketch.pdez ├── 034_DLA/ │ ├── P5/ │ │ ├── index.html │ │ ├── sketch.js │ │ └── walker.js │ └── Processing/ │ ├── CC_034_DLA/ │ │ ├── CC_034_DLA.pde │ │ └── Walker.pde │ └── sketch.pdez ├── 035.1_TSP/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_035_1_TSP/ │ │ └── CC_035_1_TSP.pde │ └── sketch.pdez ├── 035.2_LexicographicOrder/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_035_2_LexicographicOrder/ │ │ └── CC_035_2_LexicographicOrder.pde │ └── sketch.pdez ├── 035.3_TSP_Lexical/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_035_3_TSP_Lexical/ │ │ └── CC_035_3_TSP_Lexical.pde │ └── sketch.pdez ├── 035.4_TSP_GA/ │ ├── P5/ │ │ ├── ga.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_035_4_TSP_GA/ │ │ ├── CC_035_4_TSP_GA.pde │ │ └── ga.pde │ └── sketch.pdez ├── 036_Blobby/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_036_Blobby/ │ │ └── CC_036_Blobby.pde │ └── sketch.pdez ├── 037_diastic/ │ ├── P5/ │ │ ├── index.html │ │ ├── rainbow.txt │ │ └── sketch.js │ └── Processing/ │ ├── CC_037_diastic/ │ │ └── CC_037_diastic/ │ │ ├── CC_037_diastic.pde │ │ └── data/ │ │ └── rainbow.txt │ └── sketch.pdez ├── 038_word_interactor/ │ └── P5/ │ ├── index.html │ └── sketch.js ├── 039_madlibs/ │ └── P5/ │ ├── index.html │ ├── madlibs.txt │ └── sketch.js ├── 040.1_wordcounts/ │ ├── P5/ │ │ ├── index.html │ │ ├── rainbow.txt │ │ └── sketch.js │ └── Processing/ │ ├── CC_040_1_wordcounts/ │ │ ├── CC_040_1_wordcounts.pde │ │ └── data/ │ │ └── rainbow.txt │ └── sketch.pdez ├── 040.3_tf-idf/ │ └── P5/ │ ├── files/ │ │ ├── eclipse.txt │ │ ├── fish.txt │ │ ├── phadke.txt │ │ ├── rainbow.txt │ │ ├── sports.txt │ │ ├── test.txt │ │ └── tree.txt │ ├── index.html │ └── sketch.js ├── 041_ClappyBird/ │ ├── P5/ │ │ ├── bird.js │ │ ├── index.html │ │ ├── pipe.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_041_ClappyBird/ │ │ ├── Bird.pde │ │ ├── CC_041_ClappyBird.pde │ │ └── Pipe.pde │ └── sketch.pdez ├── 042.1_markov-chain/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_042_1_markov-chain/ │ │ └── CC_042_1_markov_chain/ │ │ └── CC_042_1_markov_chain.pde │ └── sketch.pdez ├── 042.2_markov-chain-names/ │ ├── P5/ │ │ ├── index.html │ │ ├── names.txt │ │ └── sketch.js │ └── Processing/ │ ├── CC_042_2_markov-chain-names/ │ │ └── CC_042_2_markov_chain_names/ │ │ ├── CC_042_2_markov_chain_names.pde │ │ └── data/ │ │ └── names.txt │ └── sketch.pdez ├── 043_ContextFreeGrammar/ │ └── P5/ │ ├── index.html │ ├── libraries/ │ │ └── tracery.js │ └── sketch.js ├── 044_afinn111SentimentAnalysis/ │ └── P5/ │ ├── AFINN-111.txt │ ├── afinn111-edited.json │ ├── convert.js │ ├── index.html │ └── sketch.js ├── 045_FirebaseSavingDrawing/ │ └── P5/ │ ├── index.html │ └── sketch.js ├── 046_Asteroids/ │ ├── P5/ │ │ ├── asteroid.js │ │ ├── index.html │ │ ├── laser.js │ │ ├── ship.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_046_Asteroids/ │ │ ├── Asteroid.pde │ │ ├── CC_046_Asteroids.pde │ │ ├── Laser.pde │ │ └── Ship.pde │ └── sketch.pdez ├── 047_PixelSorting/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_047_PixelSorting/ │ │ └── CC_047_PixelSorting.pde │ ├── CC_047_PixelSortingAnimation/ │ │ └── CC_047_PixelSortingAnimation.pde │ └── sketch.pdez ├── 048_TweetsByMonth/ │ ├── P5/ │ │ ├── flotus.json │ │ ├── index.html │ │ ├── potus.json │ │ └── sketch.js │ └── Processing/ │ ├── CC_048_TweetsByMonth/ │ │ ├── CC_048_TweetsByMonth.pde │ │ ├── flotus.json │ │ └── potus.json │ └── sketch.pdez ├── 049_ObamaMosaic/ │ └── Processing/ │ ├── CC_049_ObamaMosaic/ │ │ ├── CC_049_ObamaMosaic.pde │ │ └── data/ │ │ └── photos/ │ │ └── readme.txt │ └── sketch.pdez ├── 050.1_CirclePackingAnimated/ │ ├── P5/ │ │ ├── CC_050.1_A_CirclePackingAnimated/ │ │ │ ├── Circle.js │ │ │ ├── index.html │ │ │ └── sketch.js │ │ └── CC_050.1_B_CirclePackingAnimatedText/ │ │ ├── Circle.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_050_1_A_CirclePackingAnimated/ │ │ ├── CC_050_1_A_CirclePackingAnimated.pde │ │ └── Circle.pde │ ├── CC_050_1_B_CirclePackingAnimatedText/ │ │ ├── CC_050_1_B_CirclePackingAnimatedText.pde │ │ └── Circle.pde │ └── sketch.pdez ├── 050.2_CirclePackingImage/ │ ├── P5/ │ │ ├── Circle.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_050_2_CirclePackingImage/ │ │ ├── CC_050_2_CirclePackingImage.pde │ │ └── Circle.pde │ └── sketch.pdez ├── 051_astar/ │ ├── P5/ │ │ ├── index.html │ │ ├── sketch.js │ │ └── spot.js │ └── Processing/ │ ├── CC_051_astar/ │ │ ├── CC_051_astar.pde │ │ └── Spot.pde │ └── sketch.pdez ├── 052_random_walk/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_052_random_walk/ │ │ └── CC_052_random_walk.pde │ └── sketch.pdez ├── 053_random_walk_levy/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_053_random_walk_levy/ │ │ └── CC_053_random_walk_levy.pde │ └── sketch.pdez ├── 054.1_StarPatterns/ │ ├── P5/ │ │ ├── edge.js │ │ ├── hankin.js │ │ ├── index.html │ │ ├── polygon.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_054_StarPatterns/ │ │ ├── CC_054_StarPatterns.pde │ │ ├── Edge.pde │ │ ├── Hankin.pde │ │ ├── Polygon.pde │ │ └── Slider.pde │ └── sketch.pdez ├── 054.2_StarPatterns/ │ └── P5/ │ ├── edge.js │ ├── hankin.js │ ├── index.html │ ├── polygon.js │ └── sketch.js ├── 055_Roses/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_055_Roses/ │ │ └── CC_055_Roses.pde │ └── sketch.pdez ├── 056_attraction_repulsion/ │ ├── P5/ │ │ ├── index.html │ │ ├── particle.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_056_attraction_repulsion/ │ │ ├── CC_056_attraction_repulsion.pde │ │ └── Particle.pde │ └── sketch.pdez ├── 057_Earthquake_Viz/ │ ├── P5/ │ │ ├── all_month.csv │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_057_Earthquake_Viz/ │ │ └── CC_057_Earthquake_Viz.pde │ └── sketch.pdez ├── 058_EarthQuakeViz3D/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_058_EarthQuakeViz3D/ │ │ └── CC_058_EarthQuakeViz3D.pde │ └── sketch.pdez ├── 059_Steering_Text_Paths/ │ └── P5/ │ ├── AvenirNextLTPro-Demi.otf │ ├── index.html │ ├── sketch.js │ └── vehicle.js ├── 060_Butterfly_Wings/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_060_Butterfly_Wings/ │ │ └── CC_060_Butterfly_Wings.pde │ └── sketch.pdez ├── 061_fractal_spirograph/ │ ├── P5/ │ │ ├── index.html │ │ ├── orbit.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_061_fractal_spirograph/ │ │ ├── CC_061_fractal_spirograph.pde │ │ └── Orbit.pde │ └── sketch.pdez ├── 062_plinko/ │ └── P5/ │ ├── boundary.js │ ├── index.html │ ├── particle.js │ ├── plinko.js │ └── sketch.js ├── 063_unikitty_flag/ │ └── Processing/ │ ├── CC_063_unikitty_flag/ │ │ ├── CC_063_unikitty_flag.pde │ │ ├── Particle.pde │ │ └── Spring.pde │ └── sketch.pdez ├── 064.1_ForwardKinematics/ │ ├── P5/ │ │ └── CC_064.1_A_ForwardKinematics/ │ │ ├── index.html │ │ ├── segment.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_064_1_A_ForwardKinematics/ │ │ ├── CC_064_1_A_ForwardKinematics.pde │ │ └── Segment.pde │ ├── CC_064_1_B_ForwardKinematics/ │ │ ├── CC_064_1_B_ForwardKinematics.pde │ │ └── Segment.pde │ └── sketch.pdez ├── 064.2_InverseKinematics/ │ ├── P5/ │ │ ├── index.html │ │ ├── segment.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_064_2_InverseKinematics/ │ │ ├── CC_064_2_InverseKinematics.pde │ │ └── Segment.pde │ └── sketch.pdez ├── 064.3_InverseKinematics_fixed/ │ ├── P5/ │ │ ├── index.html │ │ ├── robotarm.js │ │ ├── segment.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_064_3_InverseKinematics_fixed/ │ │ ├── CC_064_3_InverseKinematics_fixed.pde │ │ └── Segment.pde │ └── sketch.pdez ├── 064.4_InverseKinematics_array/ │ ├── P5/ │ │ ├── index.html │ │ ├── segment.js │ │ ├── sketch.js │ │ └── tentacle.js │ └── Processing/ │ ├── CC_064_4_InverseKinematics_array/ │ │ ├── CC_064_4_InverseKinematics_array.pde │ │ ├── Segment.pde │ │ └── Tentacle.pde │ └── sketch.pdez ├── 065.1_binary_tree/ │ ├── P5/ │ │ ├── index.html │ │ ├── node.js │ │ ├── sketch.js │ │ └── tree.js │ └── Processing/ │ ├── CC_065_1_binary_tree/ │ │ ├── CC_065_1_binary_tree.pde │ │ ├── Node.pde │ │ └── Tree.pde │ └── sketch.pdez ├── 065.2_binary_tree_viz/ │ ├── P5/ │ │ ├── index.html │ │ ├── node.js │ │ ├── sketch.js │ │ └── tree.js │ └── Processing/ │ ├── CC_065_2_binary_tree_viz/ │ │ ├── CC_065_2_binary_tree_viz.pde │ │ ├── Node.pde │ │ └── Tree.pde │ └── sketch.pdez ├── 066_timer/ │ └── P5/ │ ├── index.html │ └── sketch.js ├── 067_Pong/ │ ├── P5/ │ │ ├── index.html │ │ ├── paddle.js │ │ ├── puck.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_067_Pong/ │ │ ├── CC_067_Pong.pde │ │ ├── Paddle.pde │ │ └── Puck.pde │ └── sketch.pdez ├── 068_BFS_kevin_bacon/ │ └── P5/ │ ├── graph.js │ ├── index.html │ ├── kevinbacon.json │ ├── node.js │ └── sketch.js ├── 069_steering_evolution/ │ ├── P5/ │ │ ├── index.html │ │ ├── sketch.js │ │ └── vehicle.js │ └── Processing/ │ ├── CC_069_steering_evolution/ │ │ ├── CC_069_steering_evolution.pde │ │ └── Vehicle.pde │ └── sketch.pdez ├── 070.1_similarity_score/ │ └── P5/ │ ├── index.html │ ├── movies.json │ └── sketch.js ├── 070.2_nearest_neighbors/ │ └── P5/ │ ├── index.html │ ├── movies.json │ └── sketch.js ├── 070.3_movie_recommender/ │ └── P5/ │ ├── index.html │ ├── movies.json │ └── sketch.js ├── 071_minesweeper/ │ ├── P5/ │ │ ├── cell.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_071_minesweeper/ │ │ ├── CC_071_minesweeper.pde │ │ └── Cell.pde │ └── sketch.pdez ├── 072_Frogger/ │ ├── P5/ │ │ ├── car.js │ │ ├── frog.js │ │ ├── index.html │ │ ├── log.js │ │ ├── rectangle.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_072_Frogger_original/ │ │ ├── CC_072_Frogger_original.pde │ │ ├── Car.pde │ │ ├── Frog.pde │ │ ├── Log.pde │ │ └── Rectangle.pde │ ├── CC_072_Frogger_refactored/ │ │ ├── CC_072_Frogger_refactored.pde │ │ ├── Frog.pde │ │ ├── Lane.pde │ │ ├── Obstacle.pde │ │ └── Rectangle.pde │ └── sketch.pdez ├── 073_Acrostic/ │ └── P5/ │ ├── index.html │ └── sketch.js ├── 074_Clock/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_074_Clock/ │ │ └── CC_074_Clock.pde │ └── sketch.pdez ├── 075_Wikipedia/ │ └── P5/ │ ├── index.html │ └── sketch.js ├── 076_10PRINT/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_076_10PRINT/ │ │ └── CC_076_10PRINT.pde │ └── sketch.pdez ├── 077_Recursion/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_077_Recursion/ │ │ └── CC_077_Recursion.pde │ └── sketch.pdez ├── 078_Simple_Particle_System/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_078_Simple_Particle_System/ │ │ ├── CC_078_Simple_Particle_System.pde │ │ └── Particle.pde │ └── sketch.pdez ├── 079_Number_Guessing_Chatbot/ │ └── P5/ │ ├── brain.rive │ ├── index.html │ └── sketch.js ├── 080_Voice_Chatbot_with_p5.Speech/ │ └── P5/ │ ├── brain.rive │ ├── index.html │ ├── libraries/ │ │ └── p5.speech.js │ └── sketch.js ├── 081.1_Circle_Morphing_Part_1/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_081_1_Circle_Morphing_Part_1/ │ │ └── CC_081_1_Circle_Morphing_Part_1.pde │ └── sketch.pdez ├── 081.2_Circle_Morphing_Part_2/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_081_2_Circle_Morphing_Part_2/ │ │ └── CC_081_2_Circle_Morphing_Part_2.pde │ └── sketch.pdez ├── 082_Image_Chrome_Extension_The_Ex-Kitten-sion/ │ └── JavaScript/ │ ├── kitten.js │ └── manifest.json ├── 083_Chrome_Extension_with_p5js_Sketch/ │ └── JavaScript/ │ ├── manifest.json │ └── sketch.js ├── 084_Word_Definition_Extension/ │ └── JavaScript/ │ ├── background.js │ ├── content.js │ ├── manifest.json │ └── sketch/ │ ├── index.html │ └── sketch.js ├── 085_The_Game_of_Life/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_085_The_Game_of_Life/ │ │ └── CC_085_The_Game_of_Life.pde │ └── sketch.pdez ├── 086_beesandbombs/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_086_beesandbombs/ │ │ └── CC_086_beesandbombs.pde │ └── sketch.pdez ├── 087_3D_Knots/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_087_3D_Knots/ │ │ └── CC_087_3D_Knots.pde │ └── sketch.pdez ├── 088_snowfall/ │ ├── P5/ │ │ ├── index.html │ │ ├── sketch.js │ │ └── snowflake.js │ └── Processing/ │ ├── CC_088_snowfall/ │ │ ├── CC_088_snowfall.pde │ │ └── snowflake.pde │ └── sketch.pdez ├── 089_langtonsant/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_089_langtonsant/ │ │ └── CC_089_langtonsant.pde │ └── sketch.pdez ├── 090_dithering/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_090_dithering/ │ │ └── CC_090_dithering.pde │ └── sketch.pdez ├── 091_snakesladders/ │ ├── P5/ │ │ ├── index.html │ │ ├── player.js │ │ ├── sketch.js │ │ └── tile.js │ └── Processing/ │ ├── CC_091_snakesladders/ │ │ ├── CC_091_snakesladders.pde │ │ ├── Label.pde │ │ ├── Player.pde │ │ └── Tile.pde │ └── sketch.pdez ├── 092_xor/ │ ├── P5/ │ │ ├── index.html │ │ ├── libraries/ │ │ │ ├── matrix.js │ │ │ └── nn.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_092_xor/ │ │ ├── CC_092_xor.pde │ │ ├── Matrix.java │ │ ├── Neural_Network.pde │ │ └── data.pde │ └── sketch.pdez ├── 093_DoublePendulum/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_093_DoublePendulum/ │ │ └── CC_093_DoublePendulum.pde │ └── sketch.pdez ├── 094_2048/ │ ├── P5/ │ │ ├── config.js │ │ ├── game.js │ │ ├── grid.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_094_2048/ │ │ └── CC_094_2048.pde │ └── sketch.pdez ├── 095_Approximating_Pi/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_095_Approximating_Pi/ │ │ └── CC_095_Approximating_Pi.pde │ └── sketch.pdez ├── 096_Visualizing_the_Digits_of_Pi/ │ ├── P5/ │ │ ├── index.html │ │ ├── pi-1million.txt │ │ └── sketch.js │ └── Processing/ │ ├── CC_096_Visualizing_the_Digits_of_Pi/ │ │ ├── CC_096_Visualizing_the_Digits_of_Pi.pde │ │ └── pi-1million.txt │ └── sketch.pdez ├── 097.1_Book_of_Pi_Part_1/ │ └── Processing/ │ ├── CC_097_1_Book_of_Pi_Part_1/ │ │ ├── CC_097_1_Book_of_Pi_Part_1.pde │ │ ├── pi-10million.txt │ │ └── pi-1million.txt │ └── sketch.pdez ├── 097.2_Book_of_Pi_Part_2/ │ └── Processing/ │ ├── CC_097_2_Book_of_Pi_Part_2/ │ │ ├── CC_097_2_Book_of_Pi_Part_2.pde │ │ ├── pi-1000.txt │ │ ├── pi-10million.txt │ │ └── pi-1million.txt │ └── sketch.pdez ├── 098.1_QuadTree/ │ ├── P5/ │ │ ├── index.html │ │ ├── quadtree.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_098.1_QuadTree/ │ │ ├── CC_098.1_QuadTree.pde │ │ ├── Point.pde │ │ ├── Rectangle.pde │ │ └── quadtree.pde │ └── sketch.pdez ├── 098.3_QuadTree_Collisions/ │ ├── P5/ │ │ ├── index.html │ │ ├── particle.js │ │ ├── quadtree.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_098.3_QuadTree_Collisions/ │ │ ├── CC_098.3_QuadTree_Collisions.pde │ │ ├── Point.pde │ │ ├── Rectangle.pde │ │ └── quadtree.pde │ └── sketch.pdez ├── 099_ColorPredictor/ │ └── P5/ │ ├── index.html │ ├── lib/ │ │ ├── matrix.js │ │ └── nn.js │ └── sketch.js ├── 100.1_NeuroEvolution_FlappyBird/ │ ├── P5/ │ │ ├── bird.js │ │ ├── ga.js │ │ ├── index.html │ │ ├── neuralnetwork/ │ │ │ ├── matrix.js │ │ │ └── nn.js │ │ ├── pipe.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_100_1_NeuroEvolution_FlappyBird/ │ │ ├── CC_100_1_NeuroEvolution_FlappyBird.pde │ │ ├── GA.pde │ │ ├── Matrix.java │ │ ├── Neural_Network.pde │ │ ├── bird.pde │ │ └── pipe.pde │ └── sketch.pdez ├── 100.5_NeuroEvolution_FlappyBird/ │ └── P5/ │ ├── bad_bird.json │ ├── best_bird.json │ ├── bird.js │ ├── index.html │ ├── neuralnetwork/ │ │ ├── matrix.js │ │ └── nn.js │ ├── pipe.js │ └── sketch.js ├── 101_MayThe4th/ │ ├── P5/ │ │ ├── AvenirNextLTPro-Demi.otf │ │ ├── index.html │ │ ├── sketch.js │ │ └── space.txt │ └── Processing/ │ ├── CC_101_MayThe4th/ │ │ ├── CC_101_MayThe4th.pde │ │ └── data/ │ │ └── space.txt │ └── sketch.pdez ├── 102_WaterRipples/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_102_WaterRipples/ │ │ └── CC_102_WaterRipples.pde │ └── sketch.pdez ├── 103_Flames/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_103_Flames/ │ │ └── CC_103_Flames.pde │ └── sketch.pdez ├── 104_tf_linear_regression/ │ └── P5/ │ ├── index.html │ └── sketch.js ├── 105_tf_polynomial_regression/ │ └── P5/ │ ├── index.html │ └── sketch.js ├── 106_xor_tfjs/ │ └── P5/ │ ├── index.html │ └── sketch.js ├── 107_sandpiles/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_107_sandpiles/ │ │ └── CC_107_sandpiles.pde │ └── sketch.pdez ├── 108_barnsley_fern/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_108_barnsley_fern/ │ │ └── CC_108_barnsley_fern.pde │ └── sketch.pdez ├── 109_subscriber_map/ │ └── P5/ │ ├── countries.json │ ├── index.html │ ├── sketch.js │ └── subscribers_geo.csv ├── 110.1_recaman/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_110_recaman/ │ │ ├── Arc.pde │ │ └── CC_110_recaman.pde │ └── sketch.pdez ├── 110.2_recaman_music/ │ └── P5/ │ ├── index.html │ └── sketch.js ├── 111_animated_sprite/ │ ├── P5/ │ │ ├── horse/ │ │ │ └── horse.json │ │ ├── index.html │ │ ├── sketch.js │ │ └── sprite.js │ └── Processing/ │ ├── CC_111_animated_sprite/ │ │ ├── CC_111_animated_sprite.pde │ │ ├── horse/ │ │ │ └── horse.json │ │ └── sprite.pde │ └── sketch.pdez ├── 112_3D_Rendering/ │ ├── P5/ │ │ ├── index.html │ │ ├── matrix.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_112_3D_Rendering/ │ │ ├── CC_112_3D_Rendering.pde │ │ └── matrix.pde │ └── sketch.pdez ├── 113_Hypercube/ │ ├── P5/ │ │ ├── P4Vector.js │ │ ├── index.html │ │ ├── matrix.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_113_Hypercube/ │ │ ├── CC_113_Hypercube.pde │ │ ├── P4Vector.pde │ │ └── matrix.pde │ └── sketch.pdez ├── 114_BubbleSortViz/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_114_BubbleSortViz/ │ │ └── CC_114_BubbleSortViz.pde │ └── sketch.pdez ├── 115_Snake_Game_Redux/ │ ├── P5/ │ │ ├── index.html │ │ ├── sketch.js │ │ └── snake.js │ └── Processing/ │ ├── Snake_Game_Redux/ │ │ ├── Snake_Game_Redux.pde │ │ └── snake.pde │ └── sketch.pdez ├── 116_Lissajous/ │ ├── P5/ │ │ ├── curve.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_116_Lissajous/ │ │ ├── CC_116_Lissajous.pde │ │ └── Curve.pde │ └── sketch.pdez ├── 117_SevenSegmentDisplay/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_117_SevenSegmentDisplay/ │ │ └── CC_117_SevenSegmentDisplay.pde │ └── sketch.pdez ├── 118_Mastodon_TreeBot/ │ └── Node/ │ ├── .env-sample │ ├── .gitignore │ ├── bot.js │ ├── package.json │ └── treegen/ │ └── treegen.pde ├── 119_Binary_to_Decimal_Conversion/ │ ├── P5/ │ │ ├── bit.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_119_Binary_to_Decimal_Conversion/ │ │ ├── CC_119_Binary_to_Decimal_Conversion.pde │ │ └── bit.pde │ └── sketch.pdez ├── 120_Bit_Shifting/ │ ├── P5/ │ │ ├── bit.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_120_Bit_Shifting/ │ │ ├── Button.pde │ │ ├── CC_120_Bit_Shifting.pde │ │ ├── Label.pde │ │ └── bit.pde │ └── sketch.pdez ├── 121_Logo_1/ │ ├── P5/ │ │ ├── index.html │ │ ├── sketch.js │ │ └── turtle.js │ └── Processing/ │ ├── CC_121_Logo_1/ │ │ ├── CC_121_Logo_1.pde │ │ ├── Turtle.pde │ │ └── code.txt │ └── sketch.pdez ├── 121_Logo_2/ │ ├── P5/ │ │ ├── command.js │ │ ├── index.html │ │ ├── parser.js │ │ ├── sketch.js │ │ └── turtle.js │ └── Processing/ │ ├── CC_121_Logo_2/ │ │ ├── CC_121_Logo_2.pde │ │ ├── Command.pde │ │ ├── Parser.pde │ │ ├── Turtle.pde │ │ └── code.txt │ └── sketch.pdez ├── 122_QuickDraw_1/ │ └── Node/ │ ├── package.json │ ├── public/ │ │ ├── index.html │ │ └── sketch.js │ └── server.js ├── 122_QuickDraw_2/ │ └── P5/ │ ├── index.html │ └── sketch.js ├── 123_ChaosGame_1/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_123_ChaosGame_1/ │ │ └── CC_123_ChaosGame_1.pde │ └── sketch.pdez ├── 123_ChaosGame_2/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_123_ChaosGame_2/ │ │ └── CC_123_ChaosGame_2.pde │ └── sketch.pdez ├── 124_Flocking_Boids/ │ ├── P5/ │ │ ├── boid.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC124_Flocking_Boids/ │ │ ├── CC124_Flocking_Boids.pde │ │ └── boid.pde │ └── sketch.pdez ├── 125_Fourier_Series/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_125_Fourier_Series/ │ │ └── CC_125_Fourier_Series.pde │ └── sketch.pdez ├── 126_Toothpicks/ │ ├── P5/ │ │ ├── index.html │ │ ├── sketch.js │ │ └── toothpick.js │ └── Processing/ │ ├── sketch.pdez │ └── toothpicks/ │ ├── Toothpick.pde │ └── toothpicks.pde ├── 127_Snowflake_Brownian/ │ ├── P5/ │ │ ├── index.html │ │ ├── particle.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_127_Snowflake_Brownian/ │ │ ├── CC_127_Snowflake_Brownian.pde │ │ └── Particle.pde │ └── sketch.pdez ├── 128_SketchRNN_Snowflakes/ │ └── P5/ │ ├── index.html │ └── sketch.js ├── 129_Koch_Snowflake/ │ ├── P5/ │ │ ├── index.html │ │ ├── segment.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_129_Koch_Snowflake/ │ │ ├── CC_129_Koch_Snowflake.pde │ │ └── Segment.pde │ └── sketch.pdez ├── 130_Fourier_Transform_1/ │ ├── P5/ │ │ ├── codingtrain.js │ │ ├── fourier.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_130_Fourier_Transform/ │ │ ├── CC_130_Fourier_Transform.pde │ │ ├── DFT.pde │ │ ├── train.json │ │ └── wave.pde │ └── sketch.pdez ├── 130_Fourier_Transform_2/ │ └── P5/ │ ├── fourier.js │ ├── index.html │ └── sketch.js ├── 130_Fourier_Transform_3/ │ ├── P5/ │ │ ├── codingtrain.js │ │ ├── fourier.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_130_Fourier_Transform/ │ │ ├── CC_130_Fourier_Transform.pde │ │ ├── Complex_Number.pde │ │ └── DFT.pde │ └── sketch.pdez ├── 131_BouncingDVDLogo/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_131_BouncingDVDLogo/ │ │ └── CC_131_BouncingDVDLogo.pde │ └── sketch.pdez ├── 132_FluidSimulation/ │ ├── P5/ │ │ ├── fluid.js │ │ ├── fluid_utils.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_132_FluidSimulation/ │ │ ├── CC_132_FluidSimulation.pde │ │ ├── Fluid.pde │ │ └── MoreFluid.pde │ └── sketch.pdez ├── 133_Times_Tables_Cardioid/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_133_TimesTablesCardioid/ │ │ └── CC_133_TimesTablesCardioid.pde │ └── sketch.pdez ├── 134_Heart_Curve_1/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_134_Heart_Curve_1/ │ │ └── CC_134_Heart_Curve_1.pde │ └── sketch.pdez ├── 134_Heart_Curve_2/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_134_Heart_Curve_2/ │ │ └── CC_134_Heart_Curve_2.pde │ └── sketch.pdez ├── 135_GIF_Loop/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_135_GIF_Loop/ │ │ └── CC_135_GIF_Loop.pde │ └── sketch.pdez ├── 136_Polar_Noise_Loop_1/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_136_Polar_Noise_Loop_1/ │ │ └── CC_136_Polar_Noise_Loop_1.pde │ └── sketch.pdez ├── 136_Polar_Noise_Loop_2/ │ ├── P5/ │ │ ├── index.html │ │ ├── noiseLoop.js │ │ ├── particle.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_136_Polar_Noise_Loop_2/ │ │ ├── CC_136_Polar_Noise_Loop_2.pde │ │ ├── NoiseLoop.pde │ │ └── Particle.pde │ └── sketch.pdez ├── 137_4D_Noise_Loop/ │ ├── P5/ │ │ ├── OpenSimplexNoise.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_137_4D_Noise_Loop/ │ │ ├── CC_137_4D_Noise_Loop.pde │ │ └── OpenSimplexNoise.java │ └── sketch.pdez ├── 138_Angry_Birds/ │ └── P5/ │ ├── bird.js │ ├── box.js │ ├── ground.js │ ├── index.html │ ├── sketch.js │ └── slingshot.js ├── 139_Pi_Collisions/ │ └── P5/ │ ├── block.js │ ├── index.html │ └── sketch.js ├── 140_Pi_Leibniz/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_140_Pi_Leibniz/ │ │ └── CC_140_Pi_Leibniz.pde │ └── sketch.pdez ├── 141_Mandelbrot_Pi/ │ └── Processing/ │ ├── CC_141_Mandelbrot_Pi/ │ │ └── CC_141_Mandelbrot_Pi.pde │ └── sketch.pdez ├── 142_Rubiks_Cube_1/ │ ├── P5/ │ │ ├── Cubie.js │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_142_Rubiks_Cube_1/ │ │ ├── CC_142_Rubiks_Cube_1.pde │ │ └── Cubie.pde │ └── sketch.pdez ├── 142_Rubiks_Cube_2/ │ └── Processing/ │ ├── CC_142_Rubiks_Cube_2/ │ │ ├── CC_142_Rubiks_Cube_2.pde │ │ ├── Cubie.pde │ │ ├── Face.pde │ │ └── controls.pde │ └── sketch.pdez ├── 142_Rubiks_Cube_3/ │ └── Processing/ │ ├── CC_142_Rubiks_Cube_3/ │ │ ├── CC_142_Rubiks_Cube_3.pde │ │ ├── Cubie.pde │ │ ├── Face.pde │ │ ├── Move.pde │ │ ├── controls.pde │ │ └── turns.pde │ └── sketch.pdez ├── 143_QuickSort/ │ └── P5/ │ ├── index.html │ └── sketch.js ├── 144_Black_Hole_Newtonian/ │ ├── P5/ │ │ ├── blackhole.js │ │ ├── index.html │ │ ├── photon.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_114_Black_Hole_Newtonian/ │ │ ├── CC_114_Black_Hole_Newtonian.pde │ │ ├── blackhole.pde │ │ └── photon.pde │ └── sketch.pdez ├── 145_Ray_Casting/ │ ├── P5/ │ │ ├── boundary.js │ │ ├── index.html │ │ ├── particle.js │ │ ├── ray.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_145_Ray_Casting/ │ │ ├── CC_145_Ray_Casting.pde │ │ ├── boundary.pde │ │ ├── particle.pde │ │ └── ray.pde │ └── sketch.pdez ├── 146_Rendering_Ray_Casting/ │ ├── P5/ │ │ ├── boundary.js │ │ ├── index.html │ │ ├── particle.js │ │ ├── ray.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_146_Rendering_Ray_Casting/ │ │ ├── Boundary.pde │ │ ├── CC_146_Rendering_Ray_Casting.pde │ │ ├── Particle.pde │ │ └── Ray.pde │ └── sketch.pdez ├── 147_Chrome_Dinosaur_Game/ │ ├── P5/ │ │ ├── index.html │ │ ├── sketch.js │ │ ├── train.js │ │ └── unicorn.js │ └── Processing/ │ ├── CC_147_Chrome_Dinosaur_Game/ │ │ ├── CC_147_Chrome_Dinosaur_Game.pde │ │ ├── train.pde │ │ └── unicorn.pde │ └── sketch.pdez ├── 148_Gift_Wrapping/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_148_Gift_Wrapping/ │ │ ├── CC_148_Gift_Wrapping.pde │ │ └── sorting.pde │ └── sketch.pdez ├── 149_Tic_Tac_Toe/ │ ├── P5/ │ │ ├── index.html │ │ ├── sketch.js │ │ └── style.css │ └── Processing/ │ ├── CC_149_Tic_Tac_Toe/ │ │ └── CC_149_Tic_Tac_Toe.pde │ └── sketch.pdez ├── 150_Ai_Rainbows_Runway/ │ └── P5/ │ ├── index.html │ ├── sketch.js │ └── style.css ├── 151_Ukulele_Tuner/ │ └── P5/ │ ├── index.html │ ├── sketch.js │ └── style.css ├── 152_RDP_Algorithm/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_152_RDP/ │ │ └── CC_152_RDP.pde │ └── sketch.pdez ├── 153_Interactive_SketchRRN/ │ └── P5/ │ ├── index.html │ ├── rdp.js │ └── sketch.js ├── 154_Tic_Tac_Toe_Minimax/ │ ├── P5/ │ │ ├── index.html │ │ ├── minimax.js │ │ └── sketch.js │ └── Processing/ │ ├── CC_154_Tic_Tac_Toe_Minimax/ │ │ ├── CC_154_Tic_Tac_Toe_Minimax.pde │ │ └── Minimax.pde │ └── sketch.pdez ├── 155_Kaleidoscope_Snowflake/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ └── Processing/ │ ├── CC_155_Kaleidoscope_Snowflake/ │ │ └── CC_155_Kaleidoscope_Snowflake.pde │ └── sketch.pdez ├── 156_Pi_Digits/ │ ├── Node/ │ │ ├── index.js │ │ ├── package.json │ │ ├── pi-million.txt │ │ └── public/ │ │ ├── index.html │ │ ├── sketch.js │ │ └── style.css │ └── P5/ │ ├── index.html │ ├── pi-million.txt │ ├── sketch.js │ └── style.css ├── 157_Zoom_Annotations/ │ ├── 1-basic/ │ │ ├── index.html │ │ └── sketch.js │ └── 2-final/ │ ├── index.html │ └── sketch.js ├── 158_Shape_Classifier/ │ ├── dataset/ │ │ └── generate_dataset_shape_classifier/ │ │ └── generate_dataset_shape_classifier.pde │ ├── dataset-p5/ │ │ ├── index.html │ │ └── sketch.js │ ├── mouse/ │ │ ├── index.html │ │ ├── model/ │ │ │ ├── model.json │ │ │ └── model_meta.json │ │ └── sketch.js │ ├── training/ │ │ ├── index.html │ │ ├── model/ │ │ │ ├── model.json │ │ │ └── model_meta.json │ │ └── sketch.js │ └── webcam/ │ ├── index.html │ ├── model/ │ │ ├── model.json │ │ └── model_meta.json │ └── sketch.js ├── 159_simple_pendulum_simulation/ │ ├── P5/ │ │ ├── index.html │ │ └── sketch.js │ ├── Processing/ │ │ ├── cc_159_simple_pendulum_simulation/ │ │ │ └── cc_159_simple_pendulum_simulation.pde │ │ └── sketch.pdez │ ├── array-of-pendulums/ │ │ ├── index.html │ │ ├── pendulum.js │ │ ├── sketch.js │ │ └── style.css │ └── pendulum-oop/ │ ├── index.html │ ├── pendulum.js │ ├── sketch.js │ └── style.css ├── 160_spring_forces/ │ ├── simple-spring/ │ │ ├── index.html │ │ └── sketch.js │ ├── simple-spring-port/ │ │ └── cc160_simple_spring_port/ │ │ └── cc160_simple_spring_port.pde │ ├── soft-spring/ │ │ ├── index.html │ │ ├── particle.js │ │ ├── sketch.js │ │ └── spring.js │ ├── soft-spring-port/ │ │ └── cc160_soft_spring_port/ │ │ ├── Particle.pde │ │ ├── Spring.pde │ │ └── cc160_soft_spring_port.pde │ ├── spring-oop/ │ │ ├── index.html │ │ ├── particle.js │ │ ├── sketch.js │ │ └── spring.js │ ├── spring-oop-port/ │ │ └── cc160_spring_oop_port/ │ │ ├── Particle.pde │ │ ├── Spring.pde │ │ └── cc160_spring_oop_port.pde │ ├── spring-vector/ │ │ ├── index.html │ │ └── sketch.js │ └── spring-vector-port/ │ └── cc160_spring_vector_port/ │ └── cc160_spring_vector_port.pde ├── 161_pi_from_random/ │ ├── from-pi/ │ │ ├── index.html │ │ ├── pi1000000.txt │ │ └── sketch.js │ └── from-random/ │ ├── index.html │ ├── milliondigits.txt │ └── sketch.js ├── 162_self_avoiding_walk/ │ ├── 3d/ │ │ ├── index.html │ │ ├── sketch.js │ │ └── spot.js │ ├── alpha-random-walk/ │ │ ├── index.html │ │ └── sketch.js │ ├── backtracking/ │ │ ├── index.html │ │ ├── sketch.js │ │ └── spot.js │ ├── basic/ │ │ ├── index.html │ │ └── sketch.js │ ├── bezier/ │ │ ├── index.html │ │ ├── sketch.js │ │ └── spot.js │ └── recursion/ │ ├── index.html │ └── sketch.js ├── 163_Bezier/ │ ├── basic-bezier/ │ │ ├── index.html │ │ └── sketch.js │ ├── bezier-editor/ │ │ ├── index.html │ │ └── sketch.js │ ├── bezier-formula/ │ │ ├── index.html │ │ ├── particle.js │ │ └── sketch.js │ ├── bezier-vertex/ │ │ ├── index.html │ │ └── sketch.js │ ├── cardioid-bezier/ │ │ ├── index.html │ │ └── sketch.js │ ├── cubic/ │ │ ├── index.html │ │ ├── particle.js │ │ └── sketch.js │ └── quadratic/ │ ├── index.html │ └── sketch.js ├── 164_Slitscan/ │ └── Processing/ │ ├── CC_164_Time_Slitscan/ │ │ └── CC_164_Time_Slitscan.pde │ ├── CC_164_Time_Slitscan_Horizontal/ │ │ └── CC_164_Time_Slitscan_Horizontal.pde │ ├── CC_164_Time_Slitscan_Radial/ │ │ └── CC_164_Time_Slitscan_Radial.pde │ ├── Continuous_Slitscan/ │ │ └── Continuous_Slitscan.pde │ ├── Image_Slices/ │ │ └── Image_Slices.pde │ ├── Image_Slices_Wave/ │ │ └── Image_Slices_Wave.pde │ ├── Radial_Slitscan/ │ │ └── Radial_Slitscan.pde │ ├── Time_Grid/ │ │ └── Time_Grid.pde │ └── sketch.pdez ├── 165_Slide_Puzzle/ │ ├── slide-puzzle-canvas/ │ │ ├── index.html │ │ ├── sketch.js │ │ └── tile.js │ ├── slide-puzzle-image/ │ │ ├── index.html │ │ ├── sketch.js │ │ └── tile.js │ └── slide-puzzle-video/ │ ├── index.html │ ├── sketch.js │ └── tile.js ├── 166_Ascii_Image/ │ ├── ascii-image-canvas/ │ │ ├── index.html │ │ ├── p5.js │ │ ├── sketch.js │ │ └── style.css │ ├── ascii-image-dom/ │ │ ├── index.html │ │ ├── p5.js │ │ ├── sketch.js │ │ └── style.css │ ├── ascii-text/ │ │ ├── gloria.txt │ │ ├── index.html │ │ ├── p5.js │ │ ├── sketch.js │ │ └── style.css │ ├── ascii-video/ │ │ ├── index.html │ │ ├── p5.js │ │ ├── sketch.js │ │ └── style.css │ └── ascii-weather-api/ │ ├── gloria.txt │ ├── index.html │ ├── p5.js │ ├── sketch.js │ └── style.css ├── 167_Prime_Spiral/ │ ├── P5/ │ │ ├── number-spiral/ │ │ │ ├── index.html │ │ │ └── sketch.js │ │ ├── prime-random/ │ │ │ ├── index.html │ │ │ └── sketch.js │ │ ├── prime-spiral/ │ │ │ ├── index.html │ │ │ └── sketch.js │ │ ├── shapes-color/ │ │ │ ├── index.html │ │ │ └── sketch.js │ │ └── spiral-3d/ │ │ ├── index.html │ │ └── sketch.js │ ├── Processing/ │ │ ├── number_spiral/ │ │ │ └── number_spiral.pde │ │ ├── prime_random/ │ │ │ ├── Spiral.pde │ │ │ └── prime_random.pde │ │ ├── prime_spiral/ │ │ │ └── prime_spiral.pde │ │ ├── shapes_color/ │ │ │ └── shapes_color.pde │ │ ├── sketch.pdez │ │ └── spiral_3d/ │ │ ├── Spot.pde │ │ └── spiral_3d.pde │ └── README.md ├── 168_Mandelbulb/ │ └── Processing/ │ ├── MandelBulb_Cloud/ │ │ ├── MandelBulb_Cloud.pde │ │ └── mandelbulb.txt │ ├── MandelBulb_Color/ │ │ ├── MandelBulb_Color.pde │ │ └── mandelbulb.txt │ ├── MandelBulb_Shape/ │ │ ├── MandelBulb_Shape.pde │ │ └── mandelbulb.txt │ ├── RayMarching_SDF/ │ │ └── RayMarching_SDF.pde │ ├── Voxels/ │ │ └── Voxels.pde │ └── sketch.pdez ├── 169_Pi_Day/ │ ├── Processing/ │ │ ├── Pie.pde │ │ ├── Pie_in_the_Sky.pde │ │ ├── Plate.pde │ │ └── one-million.txt │ └── p5/ │ ├── index.html │ ├── one-million.txt │ ├── pie.js │ ├── plate.js │ └── sketch.js ├── LICENSE ├── README.md └── zip_to_pdez.sh
Showing preview only (392K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (5556 symbols across 383 files)
FILE: 001_StarField/P5/Star.js
function Star (line 6) | function Star() {
FILE: 001_StarField/P5/sketch.js
function setup (line 10) | function setup() {
function draw (line 17) | function draw() {
FILE: 002_MengerSponge/P5/box.js
function Box (line 6) | function Box(x, y, z, r) {
FILE: 002_MengerSponge/P5/sketch.js
function setup (line 10) | function setup() {
function mousePressed (line 22) | function mousePressed() {
function draw (line 33) | function draw() {
FILE: 003_Snake_game/P5/sketch.js
function setup (line 10) | function setup() {
function pickLocation (line 17) | function pickLocation() {
function mousePressed (line 24) | function mousePressed() {
function draw (line 28) | function draw() {
function keyPressed (line 40) | function keyPressed() {
FILE: 003_Snake_game/P5/snake.js
function Snake (line 6) | function Snake() {
FILE: 004_PurpleRain/P5/drop.js
function Drop (line 6) | function Drop() {
FILE: 004_PurpleRain/P5/sketch.js
function setup (line 12) | function setup() {
function draw (line 19) | function draw() {
FILE: 005_Space_invaders/P5/drop.js
function Drop (line 6) | function Drop(x, y) {
FILE: 005_Space_invaders/P5/flower.js
function Flower (line 6) | function Flower(x, y) {
FILE: 005_Space_invaders/P5/ship.js
function Ship (line 6) | function Ship() {
FILE: 005_Space_invaders/P5/sketch.js
function setup (line 10) | function setup() {
function draw (line 19) | function draw() {
function keyReleased (line 58) | function keyReleased() {
function keyPressed (line 64) | function keyPressed() {
FILE: 006_Mitosis/P5/cell.js
function Cell (line 6) | function Cell(pos, r, c) {
FILE: 006_Mitosis/P5/sketch.js
function setup (line 8) | function setup() {
function draw (line 14) | function draw() {
function mousePressed (line 22) | function mousePressed() {
FILE: 007_SolarSystemGenerator/P5/planet.js
class Planet (line 1) | class Planet {
method constructor (line 2) | constructor(radius, distance, orbitspeed, angle) {
method orbit (line 10) | orbit() {
method spawnMoons (line 17) | spawnMoons(total, level) {
method show (line 31) | show() {
FILE: 007_SolarSystemGenerator/P5/sketch.js
function setup (line 3) | function setup() {
function draw (line 9) | function draw() {
FILE: 008_SolarSystemGenerator3D/P5/Planet.js
class Planet (line 7) | class Planet {
method constructor (line 8) | constructor(r, d, o) {
method orbit (line 20) | orbit() {
method spawnMoons (line 29) | spawnMoons(total, level) {
method show (line 43) | show() {
FILE: 008_SolarSystemGenerator3D/P5/sketch.js
function setup (line 14) | function setup() {
function draw (line 25) | function draw() {
FILE: 009_SolarSystemGenerator3D_texture/P5/Planet.js
class Planet (line 7) | class Planet {
method constructor (line 8) | constructor(r, d, o, img) {
method orbit (line 24) | orbit() {
method spawnMoons (line 33) | spawnMoons(total, level) {
method show (line 48) | show() {
FILE: 009_SolarSystemGenerator3D_texture/P5/sketch.js
function preload (line 30) | function preload() {
function setup (line 37) | function setup() {
function draw (line 48) | function draw() {
FILE: 010_Maze_DFS/P5/cell.js
function Cell (line 15) | function Cell(i, j) {
FILE: 010_Maze_DFS/P5/sketch.js
function setup (line 21) | function setup() {
function draw (line 36) | function draw() {
function index (line 62) | function index(i, j) {
function removeWalls (line 69) | function removeWalls(a, b) {
FILE: 011_PerlinNoiseTerrain/P5/sketch.js
function setup (line 17) | function setup() {
function draw (line 30) | function draw() {
FILE: 012_LorenzAttractor/P5/sketch.js
function setup (line 11) | function setup() {
function draw (line 16) | function draw() {
FILE: 013_ReactionDiffusion/P5/sketch.js
function setup (line 20) | function setup() {
function draw (line 47) | function draw() {
function laplaceA (line 81) | function laplaceA(x, y) {
function laplaceB (line 95) | function laplaceB(x, y) {
function swap (line 109) | function swap() {
FILE: 014_FractalTree/P5/sketch.js
function setup (line 11) | function setup() {
function draw (line 16) | function draw() {
function branch (line 25) | function branch(len) {
FILE: 015_FractalTreeArray/P5/branch.js
function Branch (line 1) | function Branch(begin, end) {
FILE: 015_FractalTreeArray/P5/sketch.js
function setup (line 11) | function setup() {
function mousePressed (line 20) | function mousePressed() {
function draw (line 40) | function draw() {
FILE: 016_LSystem/P5/sketch.js
function generate (line 20) | function generate() {
function turtle (line 42) | function turtle() {
function setup (line 65) | function setup() {
FILE: 017_SpaceColonizer/P5/branch.js
function Branch (line 6) | function Branch(parent, pos, dir) {
FILE: 017_SpaceColonizer/P5/leaf.js
function Leaf (line 6) | function Leaf() {
FILE: 017_SpaceColonizer/P5/sketch.js
function setup (line 10) | function setup() {
function draw (line 15) | function draw() {
FILE: 017_SpaceColonizer/P5/tree.js
function Tree (line 6) | function Tree() {
FILE: 019_Superellipse/P5/sketch.js
function setup (line 9) | function setup() {
function draw (line 14) | function draw() {
function sgn (line 39) | function sgn(val) {
FILE: 020_ClothSimulation/P5/particle.js
class Particle (line 7) | class Particle extends VerletParticle2D {
method constructor (line 8) | constructor(x, y) {
method display (line 12) | display() {
FILE: 020_ClothSimulation/P5/sketch.js
function setup (line 17) | function setup() {
function draw (line 58) | function draw() {
function make2DArray (line 73) | function make2DArray(cols, rows) {
FILE: 020_ClothSimulation/P5/spring.js
class Spring (line 7) | class Spring extends VerletSpring2D {
method constructor (line 8) | constructor(a, b) {
method display (line 12) | display() {
FILE: 020_ClothSimulation/P5/toxiclibs/toxiclibs.js
function s (line 29) | function s(o, u) {
function digits (line 2450) | function digits(colorFnStr) {
function makeNumbers (line 2456) | function makeNumbers(digits) {
function make (line 2960) | function make(type, setters) {
function makeProxy (line 3040) | function makeProxy(type) {
function err (line 4257) | function err(param) {
function process (line 4268) | function process(pos, dir, radiusNorth, radiusSouth, length) {
function vertexKeyGenerator (line 9806) | function vertexKeyGenerator(v) {
function edgeKeyGenerator (line 9811) | function edgeKeyGenerator(edge) {
function ARC4 (line 14229) | function ARC4(key) {
function flatten (line 14292) | function flatten(obj, depth, result, prop, typ) {
function mixkey (line 14315) | function mixkey(seed, key, smear, j) {
function lowbits (line 14332) | function lowbits(n) {
FILE: 021_Mandelbrot/P5/sketch.js
function setup (line 14) | function setup() {
function draw (line 24) | function draw() {
FILE: 022_JuliaSet/P5/sketch.js
function setup (line 45) | function setup() {
function draw (line 61) | function draw() {
FILE: 023_SuperShape2D/P5/sketch.js
function setup (line 17) | function setup() {
function supershape (line 22) | function supershape(theta) {
function draw (line 40) | function draw() {
FILE: 024_PerlinNoiseFlowField/P5/particle.js
function Particle (line 6) | function Particle() {
FILE: 024_PerlinNoiseFlowField/P5/sketch.js
function setup (line 18) | function setup() {
function draw (line 33) | function draw() {
FILE: 025_SphereGeometry/P5/sketch.js
function setup (line 13) | function setup() {
function draw (line 32) | function draw() {
FILE: 027_FireWorks/P5/firework.js
function Firework (line 6) | function Firework() {
FILE: 027_FireWorks/P5/particle.js
function Particle (line 6) | function Particle(x, y, hu, firework) {
FILE: 027_FireWorks/P5/sketch.js
function setup (line 9) | function setup() {
function draw (line 18) | function draw() {
FILE: 028_MetaBalls/P5/blob.js
class Blob (line 6) | class Blob {
method constructor (line 7) | constructor(x, y) {
method update (line 16) | update() {
method show (line 23) | show() {
FILE: 028_MetaBalls/P5/sketch.js
function setup (line 8) | function setup() {
function draw (line 15) | function draw() {
FILE: 029_SmartRockets/P5/dna.js
function DNA (line 6) | function DNA(genes) {
FILE: 029_SmartRockets/P5/population.js
function Population (line 6) | function Population() {
FILE: 029_SmartRockets/P5/rocket.js
function Rocket (line 7) | function Rocket(dna) {
FILE: 029_SmartRockets/P5/sketch.js
function setup (line 24) | function setup() {
function draw (line 31) | function draw() {
FILE: 030_Phyllotaxis/P5/sketch.js
function setup (line 13) | function setup() {
function draw (line 19) | function draw() {
FILE: 031_FlappyBird/P5/bird.js
function Bird (line 6) | function Bird() {
FILE: 031_FlappyBird/P5/pipe.js
function Pipe (line 6) | function Pipe() {
FILE: 031_FlappyBird/P5/sketch.js
function setup (line 9) | function setup() {
function draw (line 15) | function draw() {
function keyPressed (line 39) | function keyPressed() {
FILE: 032.1_agar.io/P5/blob.js
function Blob (line 6) | function Blob(x, y, r) {
FILE: 032.1_agar.io/P5/sketch.js
function setup (line 11) | function setup() {
function draw (line 21) | function draw() {
FILE: 032.2_agar.io_sockets/Node/public/blob.js
function Blob (line 6) | function Blob(x, y, r) {
FILE: 032.2_agar.io_sockets/Node/public/sketch.js
function setup (line 14) | function setup() {
function draw (line 35) | function draw() {
FILE: 032.2_agar.io_sockets/Node/server.js
function Blob (line 11) | function Blob(id, x, y, r) {
function listen (line 28) | function listen() {
function heartbeat (line 42) | function heartbeat() {
FILE: 033_poisson_disc/P5/sketch.js
function setup (line 14) | function setup() {
function draw (line 38) | function draw() {
FILE: 034_DLA/P5/sketch.js
function setup (line 15) | function setup() {
function draw (line 30) | function draw() {
FILE: 034_DLA/P5/walker.js
function Walker (line 6) | function Walker(x, y) {
function randomPoint (line 56) | function randomPoint() {
function distSq (line 74) | function distSq(a, b) {
FILE: 035.1_TSP/P5/sketch.js
function setup (line 12) | function setup() {
function draw (line 24) | function draw() {
function swap (line 65) | function swap(a, i, j) {
function calcDistance (line 71) | function calcDistance(points) {
FILE: 035.2_LexicographicOrder/P5/sketch.js
function setup (line 8) | function setup() {
function draw (line 12) | function draw() {
function swap (line 54) | function swap(a, i, j) {
FILE: 035.3_TSP_Lexical/P5/sketch.js
function setup (line 17) | function setup() {
function draw (line 33) | function draw() {
function swap (line 80) | function swap(a, i, j) {
function calcDistance (line 86) | function calcDistance(points, order) {
function nextOrder (line 101) | function nextOrder() {
function factorial (line 134) | function factorial(n) {
FILE: 035.4_TSP_GA/P5/ga.js
function calculateFitness (line 12) | function calculateFitness() {
function normalizeFitness (line 32) | function normalizeFitness() {
function nextGeneration (line 42) | function nextGeneration() {
function pickOne (line 54) | function pickOne(list, prob) {
function crossOver (line 66) | function crossOver(orderA, orderB) {
function mutate (line 80) | function mutate(order, mutationRate) {
FILE: 035.4_TSP_GA/P5/sketch.js
function setup (line 25) | function setup() {
function draw (line 40) | function draw() {
function swap (line 80) | function swap(a, i, j) {
function calcDistance (line 86) | function calcDistance(points, order) {
FILE: 036_Blobby/P5/sketch.js
function setup (line 8) | function setup() {
function draw (line 12) | function draw() {
FILE: 037_diastic/P5/sketch.js
function diastic (line 6) | function diastic(seed, words) {
function preload (line 29) | function preload() {
function setup (line 33) | function setup() {
FILE: 038_word_interactor/P5/sketch.js
function setup (line 10) | function setup() {
function highlight (line 19) | function highlight() {
function newText (line 30) | function newText() {
FILE: 039_madlibs/P5/sketch.js
function setup (line 12) | function setup() {
function replacer (line 41) | function replacer(match, pos) {
function generate (line 46) | function generate() {
FILE: 040.1_wordcounts/P5/sketch.js
function preload (line 10) | function preload() {
function setup (line 14) | function setup() {
FILE: 040.3_tf-idf/P5/sketch.js
function preload (line 13) | function preload() {
function setup (line 19) | function setup() {
FILE: 041_ClappyBird/P5/bird.js
function Bird (line 6) | function Bird() {
FILE: 041_ClappyBird/P5/pipe.js
function Pipe (line 6) | function Pipe() {
FILE: 041_ClappyBird/P5/sketch.js
function setup (line 13) | function setup() {
function draw (line 23) | function draw() {
function keyPressed (line 77) | function keyPressed() {
FILE: 042.1_markov-chain/P5/sketch.js
function setup (line 13) | function setup() {
function markovIt (line 29) | function markovIt() {
FILE: 042.2_markov-chain-names/P5/sketch.js
function preload (line 12) | function preload() {
function setup (line 17) | function setup() {
function markovIt (line 38) | function markovIt() {
FILE: 043_ContextFreeGrammar/P5/libraries/tracery.js
function inQuotes (line 11) | function inQuotes(s) {
function parseAction (line 15) | function parseAction(action) {
function parseTag (line 22) | function parseTag(tag) {
function parseRule (line 107) | function parseRule(rule) {
function testParse (line 181) | function testParse(rule, shouldFail) {
function testParseTag (line 193) | function testParseTag(tag, shouldFail) {
function spacer (line 210) | function spacer(size) {
function extend (line 223) | function extend(destination, source) {
function Class (line 274) | function Class() {
function endsWithConY (line 543) | function endsWithConY(s) {
function Symbol (line 819) | function Symbol(grammar, key) {
function Grammar (line 948) | function Grammar() {
FILE: 043_ContextFreeGrammar/P5/sketch.js
function expand (line 52) | function expand(start, expansion) {
function setup (line 67) | function setup() {
function cfg (line 73) | function cfg() {
FILE: 044_afinn111SentimentAnalysis/P5/convert.js
function preload (line 9) | function preload() {
function setup (line 13) | function setup() {
function draw (line 28) | function draw() {}
FILE: 044_afinn111SentimentAnalysis/P5/sketch.js
function preload (line 11) | function preload() {
function setup (line 16) | function setup() {
function draw (line 49) | function draw() {}
FILE: 045_FirebaseSavingDrawing/P5/sketch.js
function setup (line 12) | function setup() {
function startPath (line 46) | function startPath() {
function endPath (line 52) | function endPath() {
function draw (line 56) | function draw() {
function saveDrawing (line 80) | function saveDrawing() {
function gotData (line 94) | function gotData(data) {
function errData (line 120) | function errData(err) {
function showDrawing (line 124) | function showDrawing(key) {
function clearDrawing (line 140) | function clearDrawing() {
FILE: 046_Asteroids/P5/asteroid.js
function Asteroid (line 6) | function Asteroid(pos, r) {
FILE: 046_Asteroids/P5/laser.js
function Laser (line 6) | function Laser(spos, angle) {
FILE: 046_Asteroids/P5/ship.js
function Ship (line 6) | function Ship() {
FILE: 046_Asteroids/P5/sketch.js
function setup (line 10) | function setup() {
function draw (line 18) | function draw() {
function keyReleased (line 58) | function keyReleased() {
function keyPressed (line 63) | function keyPressed() {
FILE: 047_PixelSorting/P5/sketch.js
function preload (line 14) | function preload() {
function setup (line 19) | function setup() {
function draw (line 26) | function draw() {
FILE: 048_TweetsByMonth/P5/sketch.js
function preload (line 27) | function preload() {
function setup (line 31) | function setup() {
FILE: 050.1_CirclePackingAnimated/P5/CC_050.1_A_CirclePackingAnimated/Circle.js
function Circle (line 6) | function Circle(x, y) {
FILE: 050.1_CirclePackingAnimated/P5/CC_050.1_A_CirclePackingAnimated/sketch.js
function setup (line 8) | function setup() {
function draw (line 13) | function draw() {
function newCircle (line 62) | function newCircle() {
FILE: 050.1_CirclePackingAnimated/P5/CC_050.1_B_CirclePackingAnimatedText/Circle.js
function Circle (line 6) | function Circle(x, y) {
FILE: 050.1_CirclePackingAnimated/P5/CC_050.1_B_CirclePackingAnimatedText/sketch.js
function preload (line 10) | function preload() {
function setup (line 14) | function setup() {
function draw (line 39) | function draw() {
function newCircle (line 88) | function newCircle() {
FILE: 050.2_CirclePackingImage/P5/Circle.js
function Circle (line 6) | function Circle(x, y, color) {
FILE: 050.2_CirclePackingImage/P5/sketch.js
function preload (line 9) | function preload() {
function setup (line 13) | function setup() {
function draw (line 26) | function draw() {
function newCircle (line 74) | function newCircle() {
FILE: 051_astar/P5/sketch.js
function removeFromArray (line 9) | function removeFromArray(arr, elt) {
function heuristic (line 19) | function heuristic(a, b) {
function setup (line 46) | function setup() {
function draw (line 82) | function draw() {
FILE: 051_astar/P5/spot.js
function Spot (line 9) | function Spot(i, j) {
FILE: 052_random_walk/P5/sketch.js
function setup (line 9) | function setup() {
function draw (line 16) | function draw() {
FILE: 053_random_walk_levy/P5/sketch.js
function setup (line 11) | function setup() {
function draw (line 19) | function draw() {
FILE: 054.1_StarPatterns/P5/edge.js
function Edge (line 11) | function Edge(a, b) {
FILE: 054.1_StarPatterns/P5/hankin.js
function Hankin (line 11) | function Hankin(a, v) {
FILE: 054.1_StarPatterns/P5/polygon.js
function Polygon (line 11) | function Polygon() {
FILE: 054.1_StarPatterns/P5/sketch.js
function setup (line 20) | function setup() {
function draw (line 41) | function draw() {
FILE: 054.2_StarPatterns/P5/edge.js
function Edge (line 11) | function Edge(a, b) {
FILE: 054.2_StarPatterns/P5/hankin.js
function Hankin (line 11) | function Hankin(a, v) {
FILE: 054.2_StarPatterns/P5/polygon.js
function Polygon (line 11) | function Polygon(n) {
FILE: 054.2_StarPatterns/P5/sketch.js
function setup (line 19) | function setup() {
function draw (line 40) | function draw() {
FILE: 055_Roses/P5/sketch.js
function setup (line 12) | function setup() {
function draw (line 20) | function draw() {
function reduceDenominator (line 43) | function reduceDenominator(numerator, denominator) {
FILE: 056_attraction_repulsion/P5/particle.js
function Particle (line 6) | function Particle(x, y) {
FILE: 056_attraction_repulsion/P5/sketch.js
function setup (line 9) | function setup() {
function mousePressed (line 17) | function mousePressed() {
function draw (line 21) | function draw() {
FILE: 057_Earthquake_Viz/P5/sketch.js
function preload (line 17) | function preload() {
function mercX (line 38) | function mercX(lon) {
function mercY (line 45) | function mercY(lat) {
function setup (line 53) | function setup() {
FILE: 058_EarthQuakeViz3D/P5/sketch.js
function preload (line 31) | function preload() {
function setup (line 49) | function setup() {
function draw (line 53) | function draw() {
FILE: 059_Steering_Text_Paths/P5/sketch.js
function preload (line 9) | function preload() {
function setup (line 13) | function setup() {
function draw (line 36) | function draw() {
FILE: 059_Steering_Text_Paths/P5/vehicle.js
function Vehicle (line 6) | function Vehicle(x, y) {
FILE: 060_Butterfly_Wings/P5/sketch.js
function setup (line 8) | function setup() {
function draw (line 12) | function draw() {
FILE: 061_fractal_spirograph/P5/orbit.js
function Orbit (line 9) | function Orbit(x_, y_, r_, n, p) {
FILE: 061_fractal_spirograph/P5/sketch.js
function setup (line 15) | function setup() {
function draw (line 25) | function draw() {
FILE: 062_plinko/P5/boundary.js
function Boundary (line 10) | function Boundary(x, y, w, h) {
FILE: 062_plinko/P5/particle.js
function Particle (line 10) | function Particle(x, y, r) {
FILE: 062_plinko/P5/plinko.js
function Plinko (line 10) | function Plinko(x, y, r) {
FILE: 062_plinko/P5/sketch.js
function preload (line 24) | function preload() {
function setup (line 28) | function setup() {
function newParticle (line 78) | function newParticle() {
function draw (line 83) | function draw() {
FILE: 064.1_ForwardKinematics/P5/CC_064.1_A_ForwardKinematics/segment.js
class Segment (line 1) | class Segment {
method constructor (line 8) | constructor(point, len, angle) {
method wiggle (line 25) | wiggle() {
method update (line 34) | update() {
method calculateB (line 45) | calculateB() {
method show (line 51) | show() {
FILE: 064.1_ForwardKinematics/P5/CC_064.1_A_ForwardKinematics/sketch.js
function setup (line 3) | function setup() {
function draw (line 23) | function draw() {
FILE: 064.2_InverseKinematics/P5/segment.js
class Segment (line 1) | class Segment {
method constructor (line 8) | constructor(point, len, i) {
method follow (line 26) | follow(tx, ty) {
method calculateB (line 44) | calculateB() {
method update (line 50) | update() {
method show (line 54) | show() {
FILE: 064.2_InverseKinematics/P5/sketch.js
function setup (line 6) | function setup() {
function draw (line 23) | function draw() {
FILE: 064.3_InverseKinematics_fixed/P5/robotarm.js
class RobotArm (line 7) | class RobotArm {
method constructor (line 8) | constructor(x, y, numSegs, segLen, angle) {
method addSegment (line 17) | addSegment(len, angle) {
method update (line 26) | update() {
method show (line 52) | show() {
FILE: 064.3_InverseKinematics_fixed/P5/segment.js
class Segment (line 7) | class Segment {
method constructor (line 8) | constructor(x, y, len, angle, id) {
method createParent (line 17) | createParent(len, angle, id) {
method reCalculate (line 24) | reCalculate() {
method follow (line 30) | follow(tx, ty) {
method update (line 41) | update() {
method show (line 45) | show() {
FILE: 064.3_InverseKinematics_fixed/P5/sketch.js
function setup (line 11) | function setup() {
function draw (line 17) | function draw() {
FILE: 064.4_InverseKinematics_array/P5/segment.js
class Segment (line 7) | class Segment {
method constructor (line 8) | constructor(x, y, len, i) {
method followChild (line 26) | followChild(child) {
method follow (line 32) | follow(tx, ty) {
method setA (line 41) | setA(pos) {
method calculateB (line 46) | calculateB() {
method update (line 52) | update() {
method show (line 56) | show() {
FILE: 064.4_InverseKinematics_array/P5/sketch.js
function setup (line 13) | function setup() {
function draw (line 28) | function draw() {
FILE: 064.4_InverseKinematics_array/P5/tentacle.js
class Tentacle (line 7) | class Tentacle {
method constructor (line 8) | constructor(x, y) {
method update (line 18) | update() {
method show (line 36) | show() {
FILE: 065.1_binary_tree/P5/node.js
function Node (line 9) | function Node(val) {
FILE: 065.1_binary_tree/P5/sketch.js
function setup (line 11) | function setup() {
FILE: 065.1_binary_tree/P5/tree.js
function Tree (line 9) | function Tree() {
FILE: 065.2_binary_tree_viz/P5/node.js
function Node (line 9) | function Node(val, x, y) {
FILE: 065.2_binary_tree_viz/P5/sketch.js
function setup (line 11) | function setup() {
FILE: 065.2_binary_tree_viz/P5/tree.js
function Tree (line 9) | function Tree() {
FILE: 066_timer/P5/sketch.js
function convertSeconds (line 13) | function convertSeconds(s) {
function preload (line 21) | function preload() {
function setup (line 25) | function setup() {
FILE: 067_Pong/P5/paddle.js
class Paddle (line 1) | class Paddle {
method constructor (line 2) | constructor(isLeft) {
method update (line 15) | update() {
method move (line 20) | move(steps) {
method show (line 24) | show() {
FILE: 067_Pong/P5/puck.js
class Puck (line 1) | class Puck {
method constructor (line 2) | constructor() {
method checkPaddleLeft (line 12) | checkPaddleLeft(p) {
method checkPaddleRight (line 28) | checkPaddleRight(p) {
method update (line 44) | update() {
method reset (line 49) | reset() {
method edges (line 61) | edges() {
method show (line 79) | show() {
FILE: 067_Pong/P5/sketch.js
function setup (line 7) | function setup() {
function draw (line 15) | function draw() {
function keyReleased (line 36) | function keyReleased() {
function keyPressed (line 41) | function keyPressed() {
FILE: 068_BFS_kevin_bacon/P5/graph.js
function Graph (line 10) | function Graph() {
FILE: 068_BFS_kevin_bacon/P5/node.js
function Node (line 10) | function Node(value) {
FILE: 068_BFS_kevin_bacon/P5/sketch.js
function preload (line 14) | function preload() {
function setup (line 18) | function setup() {
function bfs (line 46) | function bfs() {
FILE: 069_steering_evolution/P5/sketch.js
function setup (line 18) | function setup() {
function mouseDragged (line 41) | function mouseDragged() {
function draw (line 45) | function draw() {
FILE: 069_steering_evolution/P5/vehicle.js
function Vehicle (line 14) | function Vehicle(x, y, dna) {
FILE: 070.1_similarity_score/P5/sketch.js
function preload (line 17) | function preload() {
function setup (line 21) | function setup() {
FILE: 070.2_nearest_neighbors/P5/sketch.js
function preload (line 19) | function preload() {
function setup (line 23) | function setup() {
function euclideanDistance (line 78) | function euclideanDistance(name1, name2) {
FILE: 070.3_movie_recommender/P5/sketch.js
function preload (line 19) | function preload() {
function setup (line 23) | function setup() {
function euclideanDistance (line 118) | function euclideanDistance(ratings1, ratings2) {
FILE: 071_minesweeper/P5/cell.js
function Cell (line 8) | function Cell(i, j, w) {
FILE: 071_minesweeper/P5/sketch.js
function make2DArray (line 8) | function make2DArray(cols, rows) {
function setup (line 23) | function setup() {
function gameOver (line 59) | function gameOver() {
function mousePressed (line 67) | function mousePressed() {
function draw (line 81) | function draw() {
FILE: 072_Frogger/P5/car.js
class Car (line 1) | class Car extends Rectangle {
method constructor (line 2) | constructor(x, y, width, height, speed) {
method show (line 7) | show() {
method update (line 12) | update() {
FILE: 072_Frogger/P5/frog.js
class Frog (line 1) | class Frog extends Rectangle {
method constructor (line 2) | constructor(x, y, width) {
method attach (line 7) | attach(log) {
method update (line 11) | update() {
method show (line 19) | show() {
method move (line 24) | move(xdir, ydir) {
FILE: 072_Frogger/P5/log.js
class Log (line 1) | class Log extends Car {
method constructor (line 2) | constructor(x, y, width, height, speed) {
FILE: 072_Frogger/P5/rectangle.js
class Rectangle (line 1) | class Rectangle {
method constructor (line 2) | constructor(x, y, width, height) {
method intersects (line 9) | intersects(otherRectangle) {
FILE: 072_Frogger/P5/sketch.js
function resetGame (line 6) | function resetGame() {
function setup (line 11) | function setup() {
function draw (line 61) | function draw() {
function keyPressed (line 103) | function keyPressed() {
FILE: 073_Acrostic/P5/sketch.js
function setup (line 12) | function setup() {
FILE: 074_Clock/P5/sketch.js
function setup (line 8) | function setup() {
function draw (line 13) | function draw() {
FILE: 075_Wikipedia/P5/sketch.js
function setup (line 17) | function setup() {
FILE: 076_10PRINT/P5/sketch.js
function setup (line 12) | function setup() {
function draw (line 17) | function draw() {
FILE: 077_Recursion/P5/sketch.js
function setup (line 8) | function setup() {
function draw (line 12) | function draw() {
function drawCircle (line 20) | function drawCircle(x, y, d) {
FILE: 078_Simple_Particle_System/P5/sketch.js
function setup (line 10) | function setup() {
function draw (line 14) | function draw() {
class Particle (line 30) | class Particle {
method constructor (line 31) | constructor() {
method finished (line 39) | finished() {
method update (line 43) | update() {
method show (line 49) | show() {
FILE: 079_Number_Guessing_Chatbot/P5/sketch.js
function setup (line 7) | function setup() {
FILE: 080_Voice_Chatbot_with_p5.Speech/P5/sketch.js
function setup (line 9) | function setup() {
FILE: 081.1_Circle_Morphing_Part_1/P5/sketch.js
function polarToCartesian (line 13) | function polarToCartesian(r, angle) {
function setup (line 17) | function setup() {
function draw (line 41) | function draw() {
FILE: 081.2_Circle_Morphing_Part_2/P5/sketch.js
function polarToCartesian (line 11) | function polarToCartesian(r, angle) {
function setup (line 15) | function setup() {
function draw (line 30) | function draw() {
FILE: 084_Word_Definition_Extension/JavaScript/background.js
function receiver (line 11) | function receiver(request, sender, sendResponse) {
FILE: 084_Word_Definition_Extension/JavaScript/content.js
function wordSelected (line 7) | function wordSelected() {
FILE: 084_Word_Definition_Extension/JavaScript/sketch/sketch.js
function setup (line 4) | function setup() {
FILE: 085_The_Game_of_Life/P5/sketch.js
function make2DArray (line 8) | function make2DArray(cols, rows) {
function setup (line 21) | function setup() {
function draw (line 34) | function draw() {
function countNeighbors (line 72) | function countNeighbors(grid, x, y) {
FILE: 086_beesandbombs/P5/sketch.js
function setup (line 14) | function setup() {
function draw (line 20) | function draw() {
FILE: 087_3D_Knots/P5/sketch.js
function setup (line 22) | function setup() {
function draw (line 26) | function draw() {
FILE: 088_snowfall/P5/sketch.js
function preload (line 16) | function preload() {
function setup (line 20) | function setup() {
function draw (line 39) | function draw() {
FILE: 088_snowfall/P5/snowflake.js
function getRandomSize (line 8) | function getRandomSize() {
class Snowflake (line 23) | class Snowflake {
method constructor (line 24) | constructor(sx, sy, img) {
method applyForce (line 37) | applyForce(force) {
method randomize (line 47) | randomize() {
method update (line 56) | update() {
method render (line 84) | render() {
FILE: 089_langtonsant/P5/sketch.js
constant ANTUP (line 6) | let ANTUP = 0;
constant ANTRIGHT (line 7) | let ANTRIGHT = 1;
constant ANTDOWN (line 8) | let ANTDOWN = 2;
constant ANTLEFT (line 9) | let ANTLEFT = 3;
function setup (line 11) | function setup() {
function turnRight (line 19) | function turnRight() {
function turnLeft (line 26) | function turnLeft() {
function moveForward (line 33) | function moveForward() {
function draw (line 56) | function draw() {
function make2DArray (line 77) | function make2DArray(cols, rows) {
FILE: 090_dithering/P5/sketch.js
function preload (line 3) | function preload() {
function setup (line 7) | function setup() {
function imageIndex (line 17) | function imageIndex(img, x, y) {
function getColorAtindex (line 21) | function getColorAtindex(img, x, y) {
function setColorAtIndex (line 31) | function setColorAtIndex(img, x, y, clr) {
function closestStep (line 44) | function closestStep(max, steps, value) {
function makeDithered (line 48) | function makeDithered(img, steps) {
function distributeError (line 75) | function distributeError(img, x, y, errR, errG, errB) {
function addError (line 82) | function addError(img, factor, x, y, errR, errG, errB) {
FILE: 091_snakesladders/P5/player.js
class Player (line 5) | class Player {
method constructor (line 7) | constructor() {
method reset (line 12) | reset() {
method rollDie (line 19) | rollDie() {
method move (line 25) | move() {
method showPreview (line 30) | showPreview() {
method isSnadder (line 39) | isSnadder() {
method moveSnadder (line 45) | moveSnadder() {
method show (line 51) | show() {
FILE: 091_snakesladders/P5/sketch.js
constant ROLL_STATE (line 5) | const ROLL_STATE = 0;
constant MOVE_STATE (line 6) | const MOVE_STATE = 1;
constant SNADDER_STATE (line 7) | const SNADDER_STATE = 2;
function setup (line 22) | function setup() {
function draw (line 68) | function draw() {
FILE: 091_snakesladders/P5/tile.js
class Tile (line 5) | class Tile {
method constructor (line 6) | constructor(x, y, wh, index, next) {
method getCenter (line 24) | getCenter() {
method show (line 32) | show() {
method highlight (line 39) | highlight() {
method showSnadders (line 47) | showSnadders() {
FILE: 092_xor/P5/libraries/matrix.js
class Matrix (line 3) | class Matrix {
method constructor (line 4) | constructor(rows, cols) {
method fromArray (line 12) | static fromArray(arr) {
method subtract (line 16) | static subtract(a, b) {
method toArray (line 28) | toArray() {
method randomize (line 38) | randomize() {
method add (line 42) | add(n) {
method transpose (line 54) | static transpose(matrix) {
method multiply (line 60) | static multiply(a, b) {
method multiply (line 77) | multiply(n) {
method map (line 92) | map(func) {
method map (line 103) | static map(matrix, func) {
method print (line 110) | print() {
method serialize (line 115) | serialize() {
method deserialize (line 119) | static deserialize(data) {
FILE: 092_xor/P5/libraries/nn.js
class ActivationFunction (line 3) | class ActivationFunction {
method constructor (line 4) | constructor(func, dfunc) {
class NeuralNetwork (line 20) | class NeuralNetwork {
method constructor (line 21) | constructor(input_nodes, hidden_nodes, output_nodes) {
method predict (line 40) | predict(input_array) {
method setLearningRate (line 57) | setLearningRate(learning_rate = 0.1) {
method setActivationFunction (line 61) | setActivationFunction(func = sigmoid) {
method train (line 65) | train(input_array, target_array) {
method serialize (line 122) | serialize() {
method deserialize (line 126) | static deserialize(data) {
FILE: 092_xor/P5/sketch.js
function setup (line 32) | function setup() {
function draw (line 38) | function draw() {
FILE: 092_xor/Processing/CC_092_xor/Matrix.java
class Matrix (line 10) | public class Matrix {
method Matrix (line 14) | Matrix(int rows, int cols) {
method Matrix (line 20) | Matrix() {
method copy (line 26) | Matrix copy() {
method stringify (line 32) | static String[][] stringify(Matrix a) {
method multiply (line 42) | void multiply(float n) {
method add (line 50) | void add(float n) {
method Random (line 58) | static Matrix Random(int rows, int cols) {
method randomize (line 64) | void randomize() {
method subtract (line 72) | static Matrix subtract(Matrix a, Matrix b) {
method fromArray (line 83) | static Matrix fromArray(float[] arr) {
method toArray (line 92) | float[] toArray() {
method add (line 102) | void add(Matrix other) {
method multiply (line 110) | void multiply(Matrix other) {
method transpose (line 118) | static Matrix transpose(Matrix a) {
method Product (line 128) | static Matrix Product(Matrix first, Matrix second) {
FILE: 093_DoublePendulum/P5/sketch.js
function setup (line 24) | function setup() {
function draw (line 37) | function draw() {
FILE: 094_2048/P5/game.js
function operate (line 11) | function operate(row) {
function slide (line 19) | function slide(row) {
function combine (line 28) | function combine(row) {
function isGameWon (line 41) | function isGameWon() {
function isGameOver (line 52) | function isGameOver() {
FILE: 094_2048/P5/grid.js
function blankGrid (line 11) | function blankGrid() {
function compare (line 20) | function compare(a, b) {
function copyGrid (line 31) | function copyGrid(grid) {
function flipGrid (line 41) | function flipGrid(grid) {
function transposeGrid (line 48) | function transposeGrid(grid) {
function addNumber (line 58) | function addNumber() {
FILE: 094_2048/P5/sketch.js
function setup (line 15) | function setup() {
function keyPressed (line 27) | function keyPressed() {
function updateCanvas (line 82) | function updateCanvas() {
function drawGrid (line 88) | function drawGrid() {
FILE: 095_Approximating_Pi/P5/sketch.js
function setup (line 18) | function setup() {
function draw (line 31) | function draw() {
FILE: 096_Visualizing_the_Digits_of_Pi/P5/sketch.js
function preload (line 13) | function preload() {
function setup (line 17) | function setup() {
function draw (line 34) | function draw() {
FILE: 098.1_QuadTree/P5/quadtree.js
class Point (line 12) | class Point {
method constructor (line 13) | constructor(x, y) {
class Rectangle (line 19) | class Rectangle {
method constructor (line 20) | constructor(x, y, w, h) {
method contains (line 27) | contains(point) {
method intersects (line 36) | intersects(range) {
class QuadTree (line 46) | class QuadTree {
method constructor (line 47) | constructor(boundary, n) {
method subdivide (line 54) | subdivide() {
method insert (line 70) | insert(point) {
method query (line 94) | query(range, found) {
method show (line 116) | show() {
FILE: 098.1_QuadTree/P5/sketch.js
function setup (line 14) | function setup() {
function draw (line 27) | function draw() {
FILE: 098.3_QuadTree_Collisions/P5/particle.js
class Particle (line 11) | class Particle {
method constructor (line 12) | constructor(x, y) {
method intersects (line 19) | intersects(other) {
method setHighlight (line 24) | setHighlight(value) {
method move (line 28) | move() {
method render (line 33) | render() {
FILE: 098.3_QuadTree_Collisions/P5/quadtree.js
class Point (line 11) | class Point {
method constructor (line 12) | constructor(x, y, userData) {
class Rectangle (line 19) | class Rectangle {
method constructor (line 20) | constructor(x, y, w, h) {
method contains (line 27) | contains(point) {
method intersects (line 36) | intersects(range) {
class Circle (line 47) | class Circle {
method constructor (line 48) | constructor(x, y, r) {
method contains (line 55) | contains(point) {
method intersects (line 63) | intersects(range) {
class QuadTree (line 86) | class QuadTree {
method constructor (line 87) | constructor(boundary, capacity) {
method subdivide (line 108) | subdivide() {
method insert (line 126) | insert(point) {
method query (line 150) | query(range, found) {
FILE: 098.3_QuadTree_Collisions/P5/sketch.js
function setup (line 13) | function setup() {
function draw (line 20) | function draw() {
FILE: 099_ColorPredictor/P5/lib/matrix.js
class Matrix (line 4) | class Matrix {
method constructor (line 5) | constructor(rows, cols) {
method copy (line 11) | copy() {
method fromArray (line 21) | static fromArray(arr) {
method subtract (line 25) | static subtract(a, b) {
method toArray (line 36) | toArray() {
method randomize (line 46) | randomize() {
method add (line 50) | add(n) {
method transpose (line 62) | static transpose(matrix) {
method multiply (line 67) | static multiply(a, b) {
method multiply (line 85) | multiply(n) {
method map (line 100) | map(func) {
method map (line 111) | static map(matrix, func) {
method print (line 117) | print() {
method serialize (line 122) | serialize() {
method deserialize (line 126) | static deserialize(data) {
FILE: 099_ColorPredictor/P5/lib/nn.js
class ActivationFunction (line 3) | class ActivationFunction {
method constructor (line 4) | constructor(func, dfunc) {
class NeuralNetwork (line 21) | class NeuralNetwork {
method constructor (line 23) | constructor(a, b, c) {
method predict (line 57) | predict(input_array) {
method setLearningRate (line 75) | setLearningRate(learning_rate = 0.1) {
method setActivationFunction (line 79) | setActivationFunction(func = sigmoid) {
method train (line 83) | train(input_array, target_array) {
method serialize (line 141) | serialize() {
method deserialize (line 145) | static deserialize(data) {
method copy (line 160) | copy() {
method mutate (line 164) | mutate(rate) {
FILE: 099_ColorPredictor/P5/sketch.js
function pickColor (line 20) | function pickColor() {
function setup (line 27) | function setup() {
function mousePressed (line 44) | function mousePressed() {
function colorPredictor (line 58) | function colorPredictor(r, g, b) {
function trainColor (line 77) | function trainColor(r, g, b) {
function draw (line 85) | function draw() {
FILE: 100.1_NeuroEvolution_FlappyBird/P5/bird.js
class Bird (line 7) | class Bird {
method constructor (line 8) | constructor(brain) {
method show (line 25) | show() {
method up (line 31) | up() {
method mutate (line 35) | mutate() {
method think (line 39) | think(pipes) {
method offScreen (line 64) | offScreen() {
method update (line 68) | update() {
FILE: 100.1_NeuroEvolution_FlappyBird/P5/ga.js
function nextGeneration (line 7) | function nextGeneration() {
function pickOne (line 16) | function pickOne() {
function calculateFitness (line 30) | function calculateFitness() {
FILE: 100.1_NeuroEvolution_FlappyBird/P5/neuralnetwork/matrix.js
class Matrix (line 4) | class Matrix {
method constructor (line 5) | constructor(rows, cols) {
method copy (line 11) | copy() {
method fromArray (line 21) | static fromArray(arr) {
method subtract (line 25) | static subtract(a, b) {
method toArray (line 36) | toArray() {
method randomize (line 46) | randomize() {
method add (line 50) | add(n) {
method transpose (line 62) | static transpose(matrix) {
method multiply (line 67) | static multiply(a, b) {
method multiply (line 85) | multiply(n) {
method map (line 100) | map(func) {
method map (line 111) | static map(matrix, func) {
method print (line 117) | print() {
method serialize (line 122) | serialize() {
method deserialize (line 126) | static deserialize(data) {
FILE: 100.1_NeuroEvolution_FlappyBird/P5/neuralnetwork/nn.js
class ActivationFunction (line 3) | class ActivationFunction {
method constructor (line 4) | constructor(func, dfunc) {
class NeuralNetwork (line 21) | class NeuralNetwork {
method constructor (line 23) | constructor(a, b, c) {
method predict (line 57) | predict(input_array) {
method setLearningRate (line 75) | setLearningRate(learning_rate = 0.1) {
method setActivationFunction (line 79) | setActivationFunction(func = sigmoid) {
method train (line 83) | train(input_array, target_array) {
method serialize (line 141) | serialize() {
method deserialize (line 145) | static deserialize(data) {
method copy (line 160) | copy() {
method mutate (line 164) | mutate(rate) {
FILE: 100.1_NeuroEvolution_FlappyBird/P5/pipe.js
class Pipe (line 7) | class Pipe {
method constructor (line 8) | constructor() {
method hits (line 17) | hits(bird) {
method show (line 26) | show() {
method update (line 33) | update() {
method offscreen (line 37) | offscreen() {
FILE: 100.1_NeuroEvolution_FlappyBird/P5/sketch.js
constant TOTAL (line 13) | const TOTAL = 500;
function keyPressed (line 20) | function keyPressed() {
function setup (line 27) | function setup() {
function draw (line 35) | function draw() {
FILE: 100.1_NeuroEvolution_FlappyBird/Processing/CC_100_1_NeuroEvolution_FlappyBird/Matrix.java
class Matrix (line 1) | class Matrix{
method Matrix (line 5) | Matrix(int rows, int cols){
method Matrix (line 11) | Matrix(){
method copy (line 17) | Matrix copy(){
method stringify (line 27) | static String[][] stringify(Matrix a){
method multiply (line 37) | void multiply(float n){
method add (line 45) | void add(float n){
method random (line 53) | static Matrix random(int rows, int cols){
method randomize (line 59) | void randomize(){
method subtract (line 67) | static Matrix subtract(Matrix a, Matrix b){
method FromArray (line 78) | static Matrix FromArray(float[] arr){
method toArray (line 86) | float[] toArray(){
method add (line 96) | void add(Matrix other){
method multiply (line 104) | void multiply(Matrix other){
method transpose (line 112) | static Matrix transpose(Matrix a){
method Product (line 122) | static Matrix Product(Matrix first, Matrix second){
FILE: 100.5_NeuroEvolution_FlappyBird/P5/bird.js
class Bird (line 7) | class Bird {
method constructor (line 8) | constructor(brain) {
method show (line 25) | show() {
method up (line 31) | up() {
method mutate (line 35) | mutate() {
method think (line 39) | think(pipes) {
method offScreen (line 64) | offScreen() {
method update (line 68) | update() {
FILE: 100.5_NeuroEvolution_FlappyBird/P5/neuralnetwork/matrix.js
class Matrix (line 4) | class Matrix {
method constructor (line 5) | constructor(rows, cols) {
method copy (line 11) | copy() {
method fromArray (line 21) | static fromArray(arr) {
method subtract (line 25) | static subtract(a, b) {
method toArray (line 36) | toArray() {
method randomize (line 46) | randomize() {
method add (line 50) | add(n) {
method transpose (line 62) | static transpose(matrix) {
method multiply (line 67) | static multiply(a, b) {
method multiply (line 85) | multiply(n) {
method map (line 100) | map(func) {
method map (line 111) | static map(matrix, func) {
method print (line 117) | print() {
method serialize (line 122) | serialize() {
method deserialize (line 126) | static deserialize(data) {
FILE: 100.5_NeuroEvolution_FlappyBird/P5/neuralnetwork/nn.js
class ActivationFunction (line 3) | class ActivationFunction {
method constructor (line 4) | constructor(func, dfunc) {
class NeuralNetwork (line 21) | class NeuralNetwork {
method constructor (line 23) | constructor(a, b, c) {
method predict (line 57) | predict(input_array) {
method setLearningRate (line 75) | setLearningRate(learning_rate = 0.1) {
method setActivationFunction (line 79) | setActivationFunction(func = sigmoid) {
method train (line 83) | train(input_array, target_array) {
method serialize (line 141) | serialize() {
method deserialize (line 145) | static deserialize(data) {
method copy (line 160) | copy() {
method mutate (line 164) | mutate(rate) {
FILE: 100.5_NeuroEvolution_FlappyBird/P5/pipe.js
class Pipe (line 7) | class Pipe {
method constructor (line 8) | constructor() {
method hits (line 17) | hits(bird) {
method show (line 27) | show() {
method update (line 34) | update() {
method offscreen (line 38) | offscreen() {
FILE: 100.5_NeuroEvolution_FlappyBird/P5/sketch.js
function preload (line 20) | function preload() {
function setup (line 25) | function setup() {
function draw (line 32) | function draw() {
FILE: 101_MayThe4th/P5/sketch.js
function preload (line 12) | function preload() {
function setup (line 17) | function setup() {
function draw (line 23) | function draw() {
FILE: 102_WaterRipples/P5/sketch.js
function setup (line 16) | function setup() {
function mouseDragged (line 28) | function mouseDragged() {
function draw (line 32) | function draw() {
FILE: 103_Flames/P5/sketch.js
function setup (line 24) | function setup() {
function cool (line 32) | function cool() {
function fire (line 63) | function fire(rows) {
function draw (line 78) | function draw() {
FILE: 104_tf_linear_regression/P5/sketch.js
function setup (line 16) | function setup() {
function loss (line 22) | function loss(pred, labels) {
function predict (line 29) | function predict(x) {
function mousePressed (line 36) | function mousePressed() {
function draw (line 43) | function draw() {
FILE: 105_tf_polynomial_regression/P5/sketch.js
function setup (line 17) | function setup() {
function loss (line 25) | function loss(pred, labels) {
function predict (line 32) | function predict(x) {
function mousePressed (line 44) | function mousePressed() {
function mouseReleased (line 48) | function mouseReleased() {
function draw (line 52) | function draw() {
FILE: 106_xor_tfjs/P5/sketch.js
function setup (line 24) | function setup() {
function train (line 62) | function train() {
function trainModel (line 69) | function trainModel() {
function draw (line 76) | function draw() {
FILE: 107_sandpiles/P5/sketch.js
function setup (line 19) | function setup() {
function topple (line 31) | function topple() {
function render (line 56) | function render() {
function draw (line 83) | function draw() {
FILE: 108_barnsley_fern/P5/sketch.js
function setup (line 4) | function setup() {
function draw (line 9) | function draw() {
function drawPoint (line 15) | function drawPoint() {
function nextPoint (line 23) | function nextPoint() {
FILE: 109_subscriber_map/P5/sketch.js
function preload (line 24) | function preload() {
function setup (line 30) | function setup() {
function draw (line 74) | function draw() {
FILE: 110.1_recaman/P5/sketch.js
class Arc (line 19) | class Arc {
method constructor (line 20) | constructor(start, end, dir) {
method show (line 26) | show() {
function setup (line 40) | function setup() {
function step (line 48) | function step() {
function draw (line 67) | function draw() {
FILE: 110.2_recaman_music/P5/sketch.js
class Arc (line 29) | class Arc {
method constructor (line 30) | constructor(start, end, dir) {
method show (line 36) | show() {
function setup (line 50) | function setup() {
function step (line 67) | function step() {
function draw (line 90) | function draw() {
FILE: 111_animated_sprite/P5/sketch.js
function preload (line 18) | function preload() {
function setup (line 23) | function setup() {
function draw (line 37) | function draw() {
FILE: 111_animated_sprite/P5/sprite.js
class Sprite (line 11) | class Sprite {
method constructor (line 12) | constructor(animation, x, y, speed) {
method show (line 22) | show() {
method animate (line 27) | animate() {
FILE: 112_3D_Rendering/P5/matrix.js
function vecToMatrix (line 12) | function vecToMatrix(v) {
function matrixToVec (line 23) | function matrixToVec(m) {
function logMatrix (line 27) | function logMatrix(m) {
function matmulvec (line 42) | function matmulvec(a, vec) {
function matmul (line 48) | function matmul(a, b) {
FILE: 112_3D_Rendering/P5/sketch.js
function setup (line 18) | function setup() {
function draw (line 31) | function draw() {
function connect (line 83) | function connect(i, j, points) {
FILE: 113_Hypercube/P5/P4Vector.js
class P4Vector (line 12) | class P4Vector {
method constructor (line 13) | constructor(x, y, z, w) {
method mult (line 20) | mult(f) {
FILE: 113_Hypercube/P5/matrix.js
function vecToMatrix (line 12) | function vecToMatrix(v) {
function vec4ToMatrix (line 23) | function vec4ToMatrix(v) {
function matrixToVec (line 30) | function matrixToVec(m) {
function matrixToVec4 (line 34) | function matrixToVec4(m) {
function logMatrix (line 42) | function logMatrix(m) {
function matmulvec (line 57) | function matmulvec(a, vec) {
function matmulvec4 (line 63) | function matmulvec4(a, vec) {
function matmul (line 69) | function matmul(a, b) {
FILE: 113_Hypercube/P5/sketch.js
function setup (line 16) | function setup() {
function draw (line 37) | function draw() {
function connect (line 103) | function connect(offset, i, j, points) {
FILE: 114_BubbleSortViz/P5/sketch.js
function setup (line 13) | function setup() {
function draw (line 22) | function draw() {
function swap (line 45) | function swap(arr, a, b) {
FILE: 115_Snake_Game_Redux/P5/sketch.js
function setup (line 14) | function setup() {
function foodLocation (line 23) | function foodLocation() {
function keyPressed (line 29) | function keyPressed() {
function draw (line 43) | function draw() {
FILE: 115_Snake_Game_Redux/P5/snake.js
class Snake (line 8) | class Snake {
method constructor (line 9) | constructor() {
method setDir (line 17) | setDir(x, y) {
method update (line 22) | update() {
method grow (line 30) | grow() {
method endGame (line 36) | endGame() {
method eat (line 51) | eat(pos) {
method show (line 61) | show() {
FILE: 116_Lissajous/P5/curve.js
class Curve (line 1) | class Curve {
method constructor (line 2) | constructor() {
method setX (line 7) | setX(x) {
method setY (line 11) | setY(y) {
method addPoint (line 15) | addPoint() {
method reset (line 19) | reset() {
method show (line 23) | show() {
FILE: 116_Lissajous/P5/sketch.js
function setup (line 18) | function setup() {
function draw (line 31) | function draw() {
FILE: 117_SevenSegmentDisplay/P5/sketch.js
function setup (line 14) | function setup() {
function draw (line 19) | function draw() {
function getColor (line 25) | function getColor(val, shift) {
function sevenSegment (line 33) | function sevenSegment(val) {
FILE: 118_Mastodon_TreeBot/Node/bot.js
function toot (line 51) | async function toot(acct, reply_id, angle) {
FILE: 119_Binary_to_Decimal_Conversion/P5/bit.js
class Bit (line 7) | class Bit {
method constructor (line 8) | constructor(x, y, d) {
method setState (line 15) | setState(state) {
method toggle (line 19) | toggle(x, y) {
method show (line 26) | show() {
FILE: 119_Binary_to_Decimal_Conversion/P5/sketch.js
function mousePressed (line 10) | function mousePressed() {
function setup (line 16) | function setup() {
function draw (line 27) | function draw() {
function binaryToDecimal (line 38) | function binaryToDecimal(val) {
FILE: 120_Bit_Shifting/P5/bit.js
class Bit (line 11) | class Bit {
method constructor (line 12) | constructor(x, y, d) {
method setState (line 19) | setState(state) {
method toggle (line 23) | toggle(x, y) {
method show (line 30) | show() {
FILE: 120_Bit_Shifting/P5/sketch.js
function setup (line 15) | function setup() {
function shiftBits (line 27) | function shiftBits() {
function getBinaryString (line 37) | function getBinaryString() {
function draw (line 46) | function draw() {
function mousePressed (line 52) | function mousePressed() {
function decimalToBinary (line 58) | function decimalToBinary(num) {
function binaryToDecimal (line 70) | function binaryToDecimal(val) {
FILE: 121_Logo_1/P5/sketch.js
function setup (line 12) | function setup() {
function goTurtle (line 22) | function goTurtle() {
FILE: 121_Logo_1/P5/turtle.js
class Turtle (line 30) | class Turtle {
method constructor (line 31) | constructor(x, y, angle) {
method reset (line 37) | reset() {
method forward (line 44) | forward(amt) {
method right (line 54) | right(angle) {
FILE: 121_Logo_2/P5/command.js
class Command (line 7) | class Command {
method constructor (line 8) | constructor(name, arg) {
FILE: 121_Logo_2/P5/parser.js
class Parser (line 7) | class Parser {
method constructor (line 8) | constructor(text) {
method remainingTokens (line 13) | remainingTokens() {
method getRepeat (line 17) | getRepeat() {
method nextToken (line 36) | nextToken() {
method parse (line 60) | parse() {
FILE: 121_Logo_2/P5/sketch.js
function setup (line 10) | function setup() {
function execute (line 20) | function execute(commands) {
function goTurtle (line 34) | function goTurtle() {
FILE: 121_Logo_2/P5/turtle.js
class Turtle (line 28) | class Turtle {
method constructor (line 29) | constructor(x, y, angle) {
method reset (line 35) | reset() {
method forward (line 42) | forward(amt) {
method right (line 52) | right(angle) {
FILE: 122_QuickDraw_1/Node/public/sketch.js
function setup (line 14) | function setup() {
function newCat (line 19) | function newCat() {
function draw (line 23) | function draw() {
function gotCat (line 51) | function gotCat(data) {
FILE: 122_QuickDraw_2/P5/sketch.js
function setup (line 19) | function setup() {
function newCat (line 28) | function newCat() {
function gotCat (line 33) | function gotCat(data) {
function draw (line 38) | function draw() {
FILE: 123_ChaosGame_1/P5/sketch.js
function setup (line 13) | function setup() {
function draw (line 31) | function draw() {
FILE: 123_ChaosGame_2/P5/sketch.js
function setup (line 13) | function setup() {
function reset (line 30) | function reset() {
function draw (line 40) | function draw() {
FILE: 124_Flocking_Boids/P5/boid.js
class Boid (line 7) | class Boid {
method constructor (line 8) | constructor() {
method edges (line 17) | edges() {
method align (line 30) | align(boids) {
method separation (line 55) | separation(boids) {
method cohesion (line 82) | cohesion(boids) {
method flock (line 108) | flock(boids) {
method update (line 122) | update() {
method show (line 129) | show() {
FILE: 124_Flocking_Boids/P5/sketch.js
function setup (line 13) | function setup() {
function draw (line 23) | function draw() {
FILE: 125_Fourier_Series/P5/sketch.js
function setup (line 12) | function setup() {
function draw (line 17) | function draw() {
FILE: 126_Toothpicks/P5/sketch.js
function setup (line 14) | function setup() {
function draw (line 21) | function draw() {
FILE: 126_Toothpicks/P5/toothpick.js
class Toothpick (line 7) | class Toothpick {
method constructor (line 8) | constructor(x, y, d) {
method intersects (line 25) | intersects(x, y) {
method createA (line 35) | createA(others) {
method createB (line 50) | createB(others) {
method show (line 65) | show(factor) {
FILE: 127_Snowflake_Brownian/P5/particle.js
class Particle (line 7) | class Particle {
method constructor (line 8) | constructor(radius, angle) {
method update (line 14) | update() {
method show (line 25) | show() {
method intersects (line 31) | intersects(snowflake) {
method finished (line 43) | finished() {
FILE: 127_Snowflake_Brownian/P5/sketch.js
function setup (line 10) | function setup() {
function draw (line 15) | function draw() {
FILE: 128_SketchRNN_Snowflakes/P5/sketch.js
function setup (line 13) | function setup() {
function modelReady (line 20) | function modelReady() {
function draw (line 26) | function draw() {
function gotSketch (line 55) | function gotSketch(error, s) {
function setupNewSketch (line 64) | function setupNewSketch() {
FILE: 129_Koch_Snowflake/P5/segment.js
class Segment (line 7) | class Segment {
method constructor (line 8) | constructor(a, b) {
method generate (line 13) | generate() {
method show (line 37) | show() {
FILE: 129_Koch_Snowflake/P5/sketch.js
function addAll (line 9) | function addAll(arr, list) {
function setup (line 15) | function setup() {
function mousePressed (line 34) | function mousePressed() {
function draw (line 44) | function draw() {
FILE: 130_Fourier_Transform_1/P5/fourier.js
function dft (line 7) | function dft(x) {
FILE: 130_Fourier_Transform_1/P5/sketch.js
function setup (line 14) | function setup() {
function epiCycles (line 28) | function epiCycles(x, y, rotation, fourier) {
function draw (line 47) | function draw() {
FILE: 130_Fourier_Transform_2/P5/fourier.js
function dft (line 7) | function dft(x) {
FILE: 130_Fourier_Transform_2/P5/sketch.js
constant USER (line 7) | const USER = 0;
constant FOURIER (line 8) | const FOURIER = 1;
function mousePressed (line 19) | function mousePressed() {
function mouseReleased (line 28) | function mouseReleased() {
function setup (line 42) | function setup() {
function epiCycles (line 46) | function epiCycles(x, y, rotation, fourier) {
function draw (line 65) | function draw() {
FILE: 130_Fourier_Transform_3/P5/fourier.js
class Complex (line 9) | class Complex {
method constructor (line 10) | constructor(a, b) {
method add (line 15) | add(c) {
method mult (line 20) | mult(c) {
function dft (line 27) | function dft(x) {
FILE: 130_Fourier_Transform_3/P5/sketch.js
function setup (line 14) | function setup() {
function epicycles (line 25) | function epicycles(x, y, rotation, fourier) {
function draw (line 44) | function draw() {
FILE: 131_BouncingDVDLogo/P5/sketch.js
function preload (line 17) | function preload() {
function setup (line 21) | function setup() {
function pickColor (line 30) | function pickColor() {
function draw (line 36) | function draw() {
FILE: 132_FluidSimulation/P5/fluid.js
constant SCALE (line 3) | let SCALE = 4;
function IX (line 7) | function IX(x, y) {
class Fluid (line 12) | class Fluid {
method constructor (line 13) | constructor(dt, diffusion, viscosity) {
method step (line 30) | step() {
method addDensity (line 56) | addDensity(x, y, amount) {
method addVelocity (line 62) | addVelocity(x, y, amountX, amountY) {
method renderD (line 69) | renderD() {
method renderV (line 83) | renderV() {
FILE: 132_FluidSimulation/P5/fluid_utils.js
function diffuse (line 9) | function diffuse(b, x, x0, diff, dt) {
function lin_solve (line 22) | function lin_solve(b, x, x0, a, c) {
function project (line 48) | function project(velocX, velocY, p, div) {
function advect (line 87) | function advect(b, d, d0, velocX, velocY, dt) {
function set_bnd (line 140) | function set_bnd(b, x) {
FILE: 132_FluidSimulation/P5/sketch.js
function setup (line 3) | function setup() {
function draw (line 9) | function draw() {
FILE: 133_Times_Tables_Cardioid/P5/sketch.js
function setup (line 10) | function setup() {
function getVector (line 15) | function getVector(index, total) {
function draw (line 22) | function draw() {
FILE: 134_Heart_Curve_1/P5/sketch.js
function setup (line 10) | function setup() {
function draw (line 14) | function draw() {
FILE: 134_Heart_Curve_2/P5/sketch.js
function setup (line 12) | function setup() {
function draw (line 16) | function draw() {
function render (line 22) | function render(percent) {
FILE: 135_GIF_Loop/P5/sketch.js
function setup (line 10) | function setup() {
function draw (line 14) | function draw() {
function render (line 31) | function render(percent) {
FILE: 136_Polar_Noise_Loop_1/P5/sketch.js
function setup (line 11) | function setup() {
function draw (line 16) | function draw() {
FILE: 136_Polar_Noise_Loop_2/P5/noiseLoop.js
class NoiseLoop (line 1) | class NoiseLoop {
method constructor (line 2) | constructor(diameter, min, max) {
method value (line 10) | value(a) {
FILE: 136_Polar_Noise_Loop_2/P5/particle.js
class Particle (line 1) | class Particle {
method constructor (line 2) | constructor() {
method render (line 10) | render(a) {
FILE: 136_Polar_Noise_Loop_2/P5/sketch.js
function setup (line 12) | function setup() {
function draw (line 19) | function draw() {
function render (line 25) | function render(percent) {
FILE: 137_4D_Noise_Loop/P5/OpenSimplexNoise.js
function Contribution2 (line 3342) | function Contribution2(multiplier, xsb, ysb) {
function Contribution3 (line 3351) | function Contribution3(multiplier, xsb, ysb, zsb) {
function Contribution4 (line 3362) | function Contribution4(multiplier, xsb, ysb, zsb, wsb) {
function shuffleSeed (line 3374) | function shuffleSeed(seed) {
function OpenSimplexNoise (line 3380) | function OpenSimplexNoise(clientSeed) {
FILE: 137_4D_Noise_Loop/P5/sketch.js
function setup (line 23) | function setup() {
function draw (line 30) | function draw() {
function render (line 48) | function render(percent) {
FILE: 137_4D_Noise_Loop/Processing/CC_137_4D_Noise_Loop/OpenSimplexNoise.java
class OpenSimplexNoise (line 17) | public class OpenSimplexNoise {
method OpenSimplexNoise (line 35) | public OpenSimplexNoise() {
method OpenSimplexNoise (line 39) | public OpenSimplexNoise(short[] perm) {
method OpenSimplexNoise (line 52) | public OpenSimplexNoise(long seed) {
method eval (line 73) | public double eval(double x, double y) {
method eval (line 188) | public double eval(double x, double y, double z) {
method eval (line 749) | public double eval(double x, double y, double z, double w) {
method extrapolate (line 2062) | private double extrapolate(int xsb, int ysb, double dx, double dy)
method extrapolate (line 2069) | private double extrapolate(int xsb, int ysb, int zsb, double dx, doubl...
method extrapolate (line 2077) | private double extrapolate(int xsb, int ysb, int zsb, int wsb, double ...
method fastFloor (line 2086) | private static int fastFloor(double x) {
FILE: 138_Angry_Birds/P5/bird.js
class Bird (line 7) | class Bird {
method constructor (line 8) | constructor(x, y, r) {
method show (line 18) | show() {
FILE: 138_Angry_Birds/P5/box.js
class Box (line 7) | class Box {
method constructor (line 8) | constructor(x, y, w, h) {
method show (line 18) | show() {
FILE: 138_Angry_Birds/P5/ground.js
class Ground (line 7) | class Ground extends Box {
method constructor (line 8) | constructor(x, y, w, h) {
method show (line 13) | show() {
FILE: 138_Angry_Birds/P5/sketch.js
function preload (line 19) | function preload() {
function setup (line 25) | function setup() {
function keyPressed (line 48) | function keyPressed() {
function mouseReleased (line 56) | function mouseReleased() {
function draw (line 62) | function draw() {
FILE: 138_Angry_Birds/P5/slingshot.js
class SlingShot (line 7) | class SlingShot {
method constructor (line 8) | constructor(x, y, body) {
method fly (line 22) | fly() {
method show (line 26) | show() {
method attach (line 36) | attach(body) {
FILE: 139_Pi_Collisions/P5/block.js
class Block (line 7) | class Block {
method constructor (line 8) | constructor(x, w, m, v, xc) {
method hitWall (line 17) | hitWall() {
method reverse (line 21) | reverse() {
method collide (line 25) | collide(other) {
method bounce (line 29) | bounce(other) {
method update (line 36) | update() {
method show (line 40) | show() {
FILE: 139_Pi_Collisions/P5/sketch.js
function preload (line 17) | function preload() {
function setup (line 22) | function setup() {
function draw (line 31) | function draw() {
FILE: 140_Pi_Leibniz/P5/sketch.js
function setup (line 15) | function setup() {
function draw (line 20) | function draw() {
FILE: 142_Rubiks_Cube_1/P5/Cubie.js
class Cubie (line 6) | class Cubie {
method constructor (line 7) | constructor(x, y, z, len_) {
method show (line 11) | show() {
FILE: 142_Rubiks_Cube_1/P5/sketch.js
constant UPP (line 13) | const UPP = 0;
constant DWN (line 14) | const DWN = 1;
constant RGT (line 15) | const RGT = 2;
constant LFT (line 16) | const LFT = 3;
constant FRT (line 17) | const FRT = 4;
constant BCK (line 18) | const BCK = 5;
function setup (line 32) | function setup() {
function draw (line 54) | function draw() {
FILE: 143_QuickSort/P5/sketch.js
function setup (line 12) | function setup() {
function quickSort (line 22) | async function quickSort(arr, start, end) {
function partition (line 35) | async function partition(arr, start, end) {
function draw (line 62) | function draw() {
function swap (line 78) | async function swap(arr, a, b) {
function sleep (line 85) | function sleep(ms) {
FILE: 144_Black_Hole_Newtonian/P5/blackhole.js
class Blackhole (line 14) | class Blackhole {
method constructor (line 15) | constructor(x, y, m) {
method pull (line 21) | pull(photon) {
method show (line 34) | show() {
FILE: 144_Black_Hole_Newtonian/P5/photon.js
class Photon (line 14) | class Photon {
method constructor (line 15) | constructor(x, y) {
method stop (line 23) | stop() {
method update (line 27) | update() {
method show (line 42) | show() {
FILE: 144_Black_Hole_Newtonian/P5/sketch.js
function setup (line 23) | function setup() {
function draw (line 35) | function draw() {
FILE: 145_Ray_Casting/P5/boundary.js
class Boundary (line 8) | class Boundary {
method constructor (line 9) | constructor(x1, y1, x2, y2) {
method show (line 14) | show() {
FILE: 145_Ray_Casting/P5/particle.js
class Particle (line 8) | class Particle {
method constructor (line 9) | constructor() {
method update (line 17) | update(x, y) {
method look (line 21) | look(walls) {
method show (line 45) | show() {
FILE: 145_Ray_Casting/P5/ray.js
class Ray (line 8) | class Ray {
method constructor (line 9) | constructor(pos, angle) {
method lookAt (line 14) | lookAt(x, y) {
method show (line 20) | show() {
method cast (line 28) | cast(wall) {
FILE: 145_Ray_Casting/P5/sketch.js
function setup (line 14) | function setup() {
function draw (line 30) | function draw() {
FILE: 146_Rendering_Ray_Casting/P5/boundary.js
class Boundary (line 8) | class Boundary {
method constructor (line 9) | constructor(x1, y1, x2, y2) {
method show (line 14) | show() {
FILE: 146_Rendering_Ray_Casting/P5/particle.js
class Particle (line 8) | class Particle {
method constructor (line 9) | constructor() {
method updateFOV (line 20) | updateFOV(fov) {
method rotate (line 28) | rotate(angle) {
method move (line 37) | move(amt) {
method update (line 43) | update(x, y) {
method look (line 47) | look(walls) {
method show (line 78) | show() {
FILE: 146_Rendering_Ray_Casting/P5/ray.js
class Ray (line 8) | class Ray {
method constructor (line 9) | constructor(pos, angle) {
method setAngle (line 14) | setAngle(angle) {
method lookAt (line 18) | lookAt(x, y) {
method show (line 24) | show() {
method cast (line 32) | cast(wall) {
FILE: 146_Rendering_Ray_Casting/P5/sketch.js
function setup (line 18) | function setup() {
function changeFOV (line 36) | function changeFOV() {
function draw (line 41) | function draw() {
FILE: 147_Chrome_Dinosaur_Game/P5/sketch.js
function preload (line 15) | function preload() {
function mousePressed (line 25) | function mousePressed() {
function setup (line 29) | function setup() {
function gotCommand (line 35) | function gotCommand(error, results) {
function keyPressed (line 45) | function keyPressed() {
function draw (line 51) | function draw() {
FILE: 147_Chrome_Dinosaur_Game/P5/train.js
class Train (line 8) | class Train {
method constructor (line 9) | constructor() {
method move (line 15) | move() {
method show (line 19) | show() {
FILE: 147_Chrome_Dinosaur_Game/P5/unicorn.js
class Unicorn (line 8) | class Unicorn {
method constructor (line 9) | constructor() {
method jump (line 17) | jump() {
method hits (line 23) | hits(train) {
method move (line 31) | move() {
method show (line 37) | show() {
FILE: 148_Gift_Wrapping/P5/sketch.js
function setup (line 17) | function setup() {
function draw (line 36) | function draw() {
FILE: 149_Tic_Tac_Toe/P5/sketch.js
function setup (line 17) | function setup() {
function equals3 (line 28) | function equals3(a, b, c) {
function checkWinner (line 32) | function checkWinner() {
function nextTurn (line 64) | function nextTurn() {
function draw (line 77) | function draw() {
FILE: 150_Ai_Rainbows_Runway/P5/sketch.js
function setup (line 13) | function setup() {
function generateRainbow (line 18) | function generateRainbow() {
function gotError (line 32) | function gotError(error) {
function gotImage (line 36) | function gotImage(result) {
function draw (line 41) | function draw() {
FILE: 151_Ukulele_Tuner/P5/sketch.js
function setup (line 32) | function setup() {
function listening (line 39) | function listening() {
function draw (line 44) | function draw() {
function modelLoaded (line 92) | function modelLoaded() {
function gotPitch (line 97) | function gotPitch(error, frequency) {
FILE: 152_RDP_Algorithm/P5/sketch.js
function setup (line 9) | function setup() {
function rdp (line 19) | function rdp(startIndex, endIndex, allPoints, rdpPoints) {
function findFurthest (line 32) | function findFurthest(points, a, b) {
function lineDist (line 52) | function lineDist(c, a, b) {
function scalarProjection (line 57) | function scalarProjection(p, a, b) {
function draw (line 66) | function draw() {
FILE: 153_Interactive_SketchRRN/P5/rdp.js
function rdp (line 8) | function rdp(startIndex, endIndex, allPoints, rdpPoints) {
function findFurthest (line 21) | function findFurthest(points, a, b) {
function lineDist (line 41) | function lineDist(c, a, b) {
function scalarProjection (line 46) | function scalarProjection(p, a, b) {
FILE: 153_Interactive_SketchRRN/P5/sketch.js
function preload (line 14) | function preload() {
function startDrawing (line 18) | function startDrawing() {
function sketchRNNStart (line 24) | function sketchRNNStart() {
function setup (line 64) | function setup() {
function gotStrokePath (line 73) | function gotStrokePath(error, strokePath) {
function draw (line 79) | function draw() {
FILE: 154_Tic_Tac_Toe_Minimax/P5/minimax.js
function bestMove (line 7) | function bestMove() {
function minimax (line 35) | function minimax(board, depth, isMaximizing) {
FILE: 154_Tic_Tac_Toe_Minimax/P5/sketch.js
function setup (line 20) | function setup() {
function equals3 (line 27) | function equals3(a, b, c) {
function checkWinner (line 31) | function checkWinner() {
function mousePressed (line 72) | function mousePressed() {
function draw (line 86) | function draw() {
FILE: 155_Kaleidoscope_Snowflake/P5/sketch.js
function setup (line 14) | function setup() {
function saveSnowflake (line 26) | function saveSnowflake() {
function clearCanvas (line 30) | function clearCanvas() {
function draw (line 34) | function draw() {
FILE: 156_Pi_Digits/Node/index.js
function indexOf (line 31) | function indexOf(txt, search) {
FILE: 156_Pi_Digits/Node/public/sketch.js
function searchItUp (line 10) | function searchItUp() {
function gotResults (line 18) | function gotResults(data) {
function setup (line 23) | function setup() {
FILE: 156_Pi_Digits/P5/sketch.js
function preload (line 11) | function preload() {
function indexOf (line 15) | function indexOf(txt, search) {
function searchItUp (line 34) | function searchItUp() {
function setup (line 49) | function setup() {
FILE: 157_Zoom_Annotations/1-basic/sketch.js
function preload (line 25) | function preload() {
function setup (line 30) | function setup() {
function draw (line 42) | function draw() {
function classifyVideo (line 60) | function classifyVideo() {
function gotResult (line 66) | function gotResult(error, results) {
FILE: 157_Zoom_Annotations/2-final/sketch.js
function preload (line 37) | function preload() {
function setup (line 51) | function setup() {
function draw (line 65) | function draw() {
function classifyVideo (line 123) | function classifyVideo() {
function gotResult (line 129) | function gotResult(error, results) {
FILE: 158_Shape_Classifier/dataset-p5/sketch.js
function setup (line 13) | function setup() {
function draw (line 17) | function draw() {
FILE: 158_Shape_Classifier/mouse/sketch.js
function setup (line 19) | function setup() {
function modelLoaded (line 41) | function modelLoaded() {
function classifyImage (line 46) | function classifyImage() {
function gotResults (line 57) | function gotResults(err, results) {
function draw (line 72) | function draw() {
FILE: 158_Shape_Classifier/training/sketch.js
function preload (line 17) | function preload() {
function setup (line 28) | function setup() {
function finishedTraining (line 49) | function finishedTraining() {
FILE: 158_Shape_Classifier/webcam/sketch.js
function setup (line 20) | function setup() {
function modelLoaded (line 40) | function modelLoaded() {
function classifyImage (line 45) | function classifyImage() {
function gotResults (line 54) | function gotResults(err, results) {
function draw (line 65) | function draw() {
FILE: 159_simple_pendulum_simulation/P5/sketch.js
function setup (line 18) | function setup() {
function draw (line 26) | function draw() {
FILE: 159_simple_pendulum_simulation/array-of-pendulums/pendulum.js
class Pendulum (line 6) | class Pendulum {
method constructor (line 7) | constructor(x, y, r, bobR) {
method update (line 21) | update() {
method show (line 28) | show() {
FILE: 159_simple_pendulum_simulation/array-of-pendulums/sketch.js
function setup (line 10) | function setup() {
function draw (line 24) | function draw() {
FILE: 159_simple_pendulum_simulation/pendulum-oop/pendulum.js
class Pendulum (line 6) | class Pendulum {
method constructor (line 7) | constructor(x, y, r) {
method update (line 19) | update() {
method show (line 27) | show() {
FILE: 159_simple_pendulum_simulation/pendulum-oop/sketch.js
function setup (line 8) | function setup() {
function draw (line 14) | function draw() {
FILE: 160_spring_forces/simple-spring/sketch.js
function setup (line 16) | function setup() {
function draw (line 20) | function draw() {
FILE: 160_spring_forces/soft-spring/particle.js
class Particle (line 11) | class Particle {
method constructor (line 12) | constructor(x, y) {
method applyForce (line 20) | applyForce(force) {
method update (line 27) | update() {
method show (line 37) | show() {
FILE: 160_spring_forces/soft-spring/sketch.js
function setup (line 18) | function setup() {
function draw (line 35) | function draw() {
FILE: 160_spring_forces/soft-spring/spring.js
class Spring (line 11) | class Spring {
method constructor (line 12) | constructor(k, restLength, a, b) {
method update (line 19) | update() {
method show (line 29) | show() {
FILE: 160_spring_forces/spring-oop/particle.js
class Particle (line 11) | class Particle {
method constructor (line 12) | constructor(x, y) {
method applyForce (line 19) | applyForce(force) {
method update (line 26) | update() {
method show (line 35) | show() {
FILE: 160_spring_forces/spring-oop/sketch.js
function setup (line 17) | function setup() {
function draw (line 25) | function draw() {
FILE: 160_spring_forces/spring-oop/spring.js
class Spring (line 11) | class Spring {
method constructor (line 12) | constructor(k, restLength, a, b) {
method update (line 19) | update() {
method show (line 29) | show() {
FILE: 160_spring_forces/spring-vector/sketch.js
function setup (line 18) | function setup() {
function draw (line 26) | function draw() {
FILE: 161_pi_from_random/from-pi/sketch.js
function preload (line 15) | function preload() {
function setup (line 19) | function setup() {
function draw (line 29) | function draw() {
function gcd (line 63) | function gcd(a, b) {
FILE: 161_pi_from_random/from-random/sketch.js
function preload (line 15) | function preload() {
function setup (line 19) | function setup() {
function draw (line 31) | function draw() {
function gcd (line 65) | function gcd(a, b) {
FILE: 162_self_avoiding_walk/3d/sketch.js
function make3DArray (line 19) | function make3DArray(cols, rows, depth) {
function setup (line 30) | function setup() {
function isValid (line 51) | function isValid(i, j, k) {
function draw (line 62) | function draw() {
FILE: 162_self_avoiding_walk/3d/spot.js
class Step (line 13) | class Step {
method constructor (line 14) | constructor(dx, dy, dz) {
function allOptions (line 22) | function allOptions() {
class Spot (line 33) | class Spot {
method constructor (line 34) | constructor(i, j, k) {
method clear (line 45) | clear() {
method nextSpot (line 50) | nextSpot() {
FILE: 162_self_avoiding_walk/alpha-random-walk/sketch.js
function make2DArray (line 20) | function make2DArray(cols, rows) {
function setup (line 28) | function setup() {
function draw (line 38) | function draw() {
FILE: 162_self_avoiding_walk/backtracking/sketch.js
function make2DArray (line 19) | function make2DArray(cols, rows) {
function setup (line 27) | function setup() {
function isValid (line 44) | function isValid(i, j) {
function draw (line 51) | function draw() {
FILE: 162_self_avoiding_walk/backtracking/spot.js
class Step (line 13) | class Step {
method constructor (line 14) | constructor(dx, dy) {
function allOptions (line 21) | function allOptions() {
class Spot (line 25) | class Spot {
method constructor (line 26) | constructor(i, j) {
method clear (line 35) | clear() {
method nextSpot (line 40) | nextSpot() {
FILE: 162_self_avoiding_walk/basic/sketch.js
function make2DArray (line 27) | function make2DArray(cols, rows) {
function setup (line 35) | function setup() {
function isValid (line 51) | function isValid(i, j) {
function draw (line 58) | function draw() {
FILE: 162_self_avoiding_walk/bezier/sketch.js
function make2DArray (line 19) | function make2DArray(cols, rows) {
function setup (line 27) | function setup() {
function isValid (line 44) | function isValid(i, j) {
function draw (line 51) | function draw() {
FILE: 162_self_avoiding_walk/bezier/spot.js
class Step (line 13) | class Step {
method constructor (line 14) | constructor(dx, dy) {
function allOptions (line 21) | function allOptions() {
class Spot (line 34) | class Spot {
method constructor (line 35) | constructor(i, j) {
method clear (line 44) | clear() {
method nextSpot (line 49) | nextSpot() {
FILE: 162_self_avoiding_walk/recursion/sketch.js
function selfAvoidingWalk (line 16) | function selfAvoidingWalk(desiredLength, rows, cols, start) {
function selfAvoidingWalkHelper (line 37) | function selfAvoidingWalkHelper(path, visited, desiredLength, i, j) {
function setup (line 71) | function setup() {
FILE: 163_Bezier/basic-bezier/sketch.js
function setup (line 14) | function setup() {
function draw (line 18) | function draw() {
FILE: 163_Bezier/bezier-editor/sketch.js
function setup (line 32) | function setup() {
function keyPressed (line 51) | function keyPressed() {
function keyReleased (line 55) | function keyReleased() {
function mousePressed (line 59) | function mousePressed() {
function mouseDragged (line 74) | function mouseDragged() {
function mouseReleased (line 80) | function mouseReleased() {
function draw (line 84) | function draw() {
class Path (line 95) | class Path {
method constructor (line 96) | constructor() {
method serialize (line 106) | serialize() {
method loopIndex (line 115) | loopIndex(i) {
method toggleClosed (line 119) | toggleClosed() {
method numSegments (line 136) | numSegments() {
method getSegment (line 140) | getSegment(i) {
method addSegment (line 149) | addSegment(x, y) {
method movePoint (line 160) | movePoint(point, x, y, mode) {
method autoSetControlPoint (line 193) | autoSetControlPoint(anchorI, controlSpacing) {
method autoSetEdgePoints (line 220) | autoSetEdgePoints(controlSpacing) {
method autoSetAllControlPoints (line 235) | autoSetAllControlPoints(controlSpacing) {
method render (line 242) | render() {
FILE: 163_Bezier/bezier-formula/particle.js
class Particle (line 14) | class Particle {
method constructor (line 15) | constructor(x, y) {
method update (line 22) | update() {
FILE: 163_Bezier/bezier-formula/sketch.js
function setup (line 16) | function setup() {
function draw (line 24) | function draw() {
function cubic (line 50) | function cubic(p0, p1, p2, p3, t) {
FILE: 163_Bezier/bezier-vertex/sketch.js
function setup (line 14) | function setup() {
function draw (line 18) | function draw() {
FILE: 163_Bezier/cardioid-bezier/sketch.js
function setup (line 17) | function setup() {
function getVector (line 22) | function getVector(index, total) {
function draw (line 29) | function draw() {
FILE: 163_Bezier/cubic/particle.js
class Particle (line 14) | class Particle {
method constructor (line 15) | constructor(x, y) {
method update (line 22) | update() {
FILE: 163_Bezier/cubic/sketch.js
function setup (line 16) | function setup() {
function draw (line 24) | function draw() {
function cubic (line 46) | function cubic(p0, p1, p2, p3, t) {
function quadratic (line 55) | function quadratic(p0, p1, p2, t) {
FILE: 163_Bezier/quadratic/sketch.js
function setup (line 16) | function setup() {
function draw (line 23) | function draw() {
FILE: 165_Slide_Puzzle/slide-puzzle-canvas/sketch.js
function setup (line 18) | function setup() {
function updateTiles (line 45) | function updateTiles() {
function swap (line 56) | function swap(i, j, arr) {
function randomMove (line 62) | function randomMove(arr) {
function simpleShuffle (line 67) | function simpleShuffle(arr) {
function mousePressed (line 73) | function mousePressed() {
function draw (line 79) | function draw() {
function isSolved (line 114) | function isSolved() {
function move (line 123) | function move(i, j, arr) {
function isNeighbor (line 133) | function isNeighbor(i, j, x, y) {
function findBlank (line 144) | function findBlank() {
function startViz (line 159) | function startViz() {
function drawViz (line 165) | function drawViz() {
class Bubble (line 174) | class Bubble {
method constructor (line 175) | constructor() {
method show (line 184) | show() {
method update (line 192) | update() {
FILE: 165_Slide_Puzzle/slide-puzzle-canvas/tile.js
class Tile (line 1) | class Tile {
method constructor (line 2) | constructor(i, img) {
FILE: 165_Slide_Puzzle/slide-puzzle-image/sketch.js
function preload (line 23) | function preload() {
function setup (line 27) | function setup() {
function swap (line 58) | function swap(i, j, arr) {
function randomMove (line 66) | function randomMove(arr) {
function simpleShuffle (line 73) | function simpleShuffle(arr) {
function mousePressed (line 80) | function mousePressed() {
function draw (line 86) | function draw() {
function isSolved (line 121) | function isSolved() {
function move (line 131) | function move(i, j, arr) {
function isNeighbor (line 143) | function isNeighbor(i, j, x, y) {
function findBlank (line 156) | function findBlank() {
FILE: 165_Slide_Puzzle/slide-puzzle-image/tile.js
class Tile (line 1) | class Tile {
method constructor (line 2) | constructor(i, img) {
FILE: 165_Slide_Puzzle/slide-puzzle-video/sketch.js
function setup (line 18) | function setup() {
function updateTiles (line 45) | function updateTiles() {
function swap (line 56) | function swap(i, j, arr) {
function randomMove (line 62) | function randomMove(arr) {
function simpleShuffle (line 67) | function simpleShuffle(arr) {
function mousePressed (line 73) | function mousePressed() {
function draw (line 79) | function draw() {
function isSolved (line 113) | function isSolved() {
function move (line 122) | function move(i, j, arr) {
function isNeighbor (line 132) | function isNeighbor(i, j, x, y) {
function findBlank (line 143) | function findBlank() {
FILE: 165_Slide_Puzzle/slide-puzzle-video/tile.js
class Tile (line 1) | class Tile {
method constructor (line 2) | constructor(i, img) {
FILE: 166_Ascii_Image/ascii-image-canvas/p5.js
function r (line 23) | function r(e, n, t) {
function _arrayWithHoles (line 15653) | function _arrayWithHoles(arr) {
function _arrayWithoutHoles (line 15663) | function _arrayWithoutHoles(arr) {
function _assertThisInitialized (line 15679) | function _assertThisInitialized(self) {
function _classCallCheck (line 15695) | function _classCallCheck(instance, Constructor) {
function _defineProperties (line 15707) | function _defineProperties(target, props) {
function _createClass (line 15717) | function _createClass(Constructor, protoProps, staticProps) {
function _defineProperty (line 15729) | function _defineProperty(obj, key, value) {
function _getPrototypeOf (line 15750) | function _getPrototypeOf(o) {
function _inherits (line 15767) | function _inherits(subClass, superClass) {
function _iterableToArray (line 15788) | function _iterableToArray(iter) {
function _iterableToArrayLimit (line 15802) | function _iterableToArrayLimit(arr, i) {
function _nonIterableRest (line 15838) | function _nonIterableRest() {
function _nonIterableSpread (line 15848) | function _nonIterableSpread() {
function _objectSpread (line 15860) | function _objectSpread(target) {
function _possibleConstructorReturn (line 15891) | function _possibleConstructorReturn(self, call) {
function _setPrototypeOf (line 15905) | function _setPrototypeOf(o, p) {
function _slicedToArray (line 15928) | function _slicedToArray(arr, i) {
function _toConsumableArray (line 15944) | function _toConsumableArray(arr) {
function _typeof2 (line 15954) | function _typeof2(obj) {
function _typeof (line 15972) | function _typeof(obj) {
function getLens (line 16018) | function getLens(b64) {
function byteLength (line 16036) | function byteLength(b64) {
function _byteLength (line 16043) | function _byteLength(b64, validLen, placeHoldersLen) {
function toByteArray (line 16047) | function toByteArray(b64) {
function tripletToBase64 (line 16091) | function tripletToBase64(num) {
function encodeChunk (line 16100) | function encodeChunk(uint8, start, end) {
function fromByteArray (line 16113) | function fromByteArray(uint8) {
function typedArraySupport (line 16201) | function typedArraySupport() {
function createBuffer (line 16234) | function createBuffer(length) {
function Buffer (line 16256) | function Buffer(arg, encodingOrOffset, length) {
function from (line 16285) | function from(value, encodingOrOffset, length) {
function assertSize (line 16359) | function assertSize(size) {
function alloc (line 16369) | function alloc(size, fill, encoding) {
function allocUnsafe (line 16393) | function allocUnsafe(size) {
function fromString (line 16411) | function fromString(string, encoding) {
function fromArrayLike (line 16435) | function fromArrayLike(array) {
function fromArrayBuffer (line 16444) | function fromArrayBuffer(array, byteOffset, length) {
function fromObject (line 16468) | function fromObject(obj) {
function checked (line 16493) | function checked(length) {
function SlowBuffer (line 16507) | function SlowBuffer(length) {
function byteLength (line 16598) | function byteLength(string, encoding) {
function slowToString (line 16648) | function slowToString(encoding, start, end) {
function swap (line 16726) | function swap(b, n, m) {
function bidirectionalIndexOf (line 16883) | function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
function arrayIndexOf (line 16939) | function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
function hexWrite (line 17011) | function hexWrite(buf, string, offset, length) {
function utf8Write (line 17036) | function utf8Write(buf, string, offset, length) {
function asciiWrite (line 17045) | function asciiWrite(buf, string, offset, length) {
function latin1Write (line 17049) | function latin1Write(buf, string, offset, length) {
function base64Write (line 17053) | function base64Write(buf, string, offset, length) {
function ucs2Write (line 17057) | function ucs2Write(buf, string, offset, length) {
function base64Slice (line 17147) | function base64Slice(buf, start, end) {
function utf8Slice (line 17155) | function utf8Slice(buf, start, end) {
function decodeCodePointsArray (line 17245) | function decodeCodePointsArray(codePoints) {
function asciiSlice (line 17263) | function asciiSlice(buf, start, end) {
function latin1Slice (line 17273) | function latin1Slice(buf, start, end) {
function hexSlice (line 17283) | function hexSlice(buf, start, end) {
function utf16leSlice (line 17296) | function utf16leSlice(buf, start, end) {
function checkOffset (line 17336) | function checkOffset(offset, ext, length) {
function checkInt (line 17525) | function checkInt(buf, value, offset, ext, max, min) {
function checkIEEE754 (line 17751) | function checkIEEE754(buf, value, offset, ext, max, min) {
function writeFloat (line 17756) | function writeFloat(buf, value, offset, littleEndian, noAssert) {
function writeDouble (line 17781) | function writeDouble(buf, value, offset, littleEndian, noAssert) {
function base64clean (line 17940) | function base64clean(str) {
function utf8ToBytes (line 17954) | function utf8ToBytes(string, units) {
function asciiToBytes (line 18032) | function asciiToBytes(str) {
function utf16leToBytes (line 18041) | function utf16leToBytes(str, units) {
function base64ToBytes (line 18057) | function base64ToBytes(str) {
function blitBuffer (line 18061) | function blitBuffer(src, dst, offset, length) {
function isInstance (line 18072) | function isInstance(obj, type) {
function numberIsNaN (line 18081) | function numberIsNaN(obj) {
function F (line 19843) | function F() {
function RE (line 22351) | function RE(s, f) {
function F (line 25350) | function F() {
function getSubstitution (line 25971) | function getSubstitution(
function objectOrFunction (line 29310) | function objectOrFunction(x) {
function isFunction (line 29315) | function isFunction(x) {
function setScheduler (line 29350) | function setScheduler(scheduleFn) {
function setAsap (line 29354) | function setAsap(asapFn) {
function useNextTick (line 29374) | function useNextTick() {
function useVertxTimer (line 29383) | function useVertxTimer() {
function useMutationObserver (line 29393) | function useMutationObserver() {
function useMessageChannel (line 29405) | function useMessageChannel() {
function useSetTimeout (line 29413) | function useSetTimeout() {
function flush (line 29423) | function flush() {
function attemptVertx (line 29437) | function attemptVertx() {
function then (line 29461) | function then(onFulfillment, onRejection) {
function resolve$1 (line 29515) | function resolve$1(object) {
function noop (line 29536) | function noop() {}
function selfFulfillment (line 29542) | function selfFulfillment() {
function cannotReturnOwn (line 29546) | function cannotReturnOwn() {
function tryThen (line 29552) | function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {
function handleForeignThenable (line 29560) | function handleForeignThenable(promise, thenable, then$$1) {
function handleOwnThenable (line 29595) | function handleOwnThenable(promise, thenable) {
function handleMaybeThenable (line 29614) | function handleMaybeThenable(promise, maybeThenable, then$$1) {
function resolve (line 29632) | function resolve(promise, value) {
function publishRejection (line 29649) | function publishRejection(promise) {
function fulfill (line 29657) | function fulfill(promise, value) {
function reject (line 29670) | function reject(promise, reason) {
function subscribe (line 29680) | function subscribe(parent, child, onFulfillment, onRejection) {
function publish (line 29695) | function publish(promise) {
function invokeCallback (line 29721) | function invokeCallback(settled, promise, callback, detail) {
function initializePromise (line 29756) | function initializePromise(promise, resolver) {
function nextId (line 29772) | function nextId() {
function makePromise (line 29776) | function makePromise(promise) {
function validationError (line 29783) | function validationError() {
function Enumerator (line 29788) | function Enumerator(Constructor, input) {
function all (line 29946) | function all(entries) {
function race (line 30015) | function race(entries) {
function reject$1 (line 30067) | function reject$1(reason) {
function needsResolver (line 30075) | function needsResolver() {
function needsNew (line 30081) | function needsNew() {
function Promise (line 30192) | function Promise(resolver) {
function polyfill (line 30468) | function polyfill() {
function generateCallbackFunction (line 30544) | function generateCallbackFunction() {
function clearFunction (line 30548) | function clearFunction(functionName) {
function removeScript (line 30558) | function removeScript(scriptId) {
function fetchJsonp (line 30565) | function fetchJsonp(_url) {
function _interopDefault (line 30863) | function _interopDefault(ex) {
function defaults (line 30875) | function defaults(obj) {
function getDefaults (line 31095) | function getDefaults() {
function Browser (line 31113) | function Browser(services) {
function _interopDefault (line 31249) | function _interopDefault(ex) {
function Logger (line 31301) | function Logger(concreteLogger) {
function EventEmitter (line 31423) | function EventEmitter() {
function defer (line 31493) | function defer() {
function makeString (line 31504) | function makeString(object) {
function copy (line 31510) | function copy(a, s, t) {
function getLastOfPath (line 31516) | function getLastOfPath(object, path, Empty) {
function setPath (line 31541) | function setPath(object, path, newValue) {
function pushPath (line 31548) | function pushPath(object, path, newValue, concat) {
function getPath (line 31557) | function getPath(object, path) {
function getPathWithDefaults (line 31565) | function getPathWithDefaults(data, defaultData, key) {
function deepExtend (line 31574) | function deepExtend(target, source, overwrite) {
function regexEscape (line 31596) | function regexEscape(str) {
function escape (line 31612) | function escape(data) {
function ResourceStore (line 31627) | function ResourceStore(data) {
function Translator (line 31851) | function Translator(services) {
function capitalize (line 32423) | function capitalize(string) {
function LanguageUtil (line 32430) | function LanguageUtil(options) {
function createRules (line 32907) | function createRules() {
function PluralResolver (line 32923) | function PluralResolver(languageUtils) {
function Interpolator (line 33043) | function Interpolator() {
function regexSafe (line 33146) | function regexSafe(val) {
function handleHasOptions (line 33255) | function handleHasOptions(key, inheritedOptions) {
function remove (line 33313) | function remove(arr, what) {
function Connector (line 33327) | function Connector(backend, store, services) {
function get (line 33643) | function get() {
function transformOptions (line 33733) | function transformOptions(options) {
function noop (line 33748) | function noop() {}
function I18n (line 33755) | function I18n() {
function createClassOnDemand (line 33816) | function createClassOnDemand(ClassOrObject) {
function t (line 34571) | function t(a, b) {
function u (line 34574) | function u(a, b) {
function v (line 34577) | function v(a, b, c) {
function x (line 34586) | function x(a, b, c) {
function z (line 34591) | function z(a, b) {
function aa (line 34594) | function aa(a, b, c) {
function ba (line 34603) | function ba(a, b, c) {
function ca (line 34608) | function ca(a) {
function da (line 34611) | function da(a) {
function A (line 34614) | function A(a, b, c, d) {
function ea (line 34621) | function ea(a) {
function E (line 34628) | function E(a, b) {
function I (line 34638) | function I(a) {
function K (line 34650) | function K(a) {
function L (line 34667) | function L(a, b) {
function B (line 34681) | function B(a) {
function H (line 34696) | function H(a, b) {
function C (line 34704) | function C(a, b) {
function D (line 34713) | function D(a, b) {
function fa (line 34724) | function fa(a) {
function F (line 34730) | function F(a, b) {
function G (line 34740) | function G(a, b) {
function ha (line 34750) | function ha(a) {
function P (line 34757) | function P(a, b) {
function ia (line 34761) | function ia(a, b, c) {
function Q (line 34774) | function Q(a) {
function ja (line 34781) | function ja(a, b) {
function ka (line 34787) | function ka(a) {
function la (line 34794) | function la(a, b, c) {
function oa (line 34800) | function oa(a, b) {
function pa (line 34815) | function pa(a) {
function T (line 34822) | function T(a, b, c) {
function U (line 34843) | function U(a, b, c, d, e, f) {
function sa (line 34863) | function sa(a, b, c, d, e) {
function ta (line 34869) | function ta(a, b, c) {
function ua (line 34876) | function ua(a, b, c, d, e) {
function qa (line 34886) | function qa(a, b) {
function wa (line 34921) | function wa(a, b) {
function ra (line 35021) | function ra(a, b) {
function ya (line 35068) | function ya(a, b) {
function za (line 35129) | function za(a, b) {
function Aa (line 35147) | function Aa(a) {
function na (line 35152) | function na(a, b, c) {
function Ba (line 35159) | function Ba(a, b, c) {
function X (line 35164) | function X() {
function Z (line 35484) | function Z(a, b) {
function V (line 35506) | function V(a, b) {
function ga (line 35509) | function ga(a, b) {
function M (line 35515) | function M() {
function J (line 35520) | function J(a) {
function Ca (line 35523) | function Ca() {
function N (line 35531) | function N(a, b) {
function Da (line 35538) | function Da() {
function Ea (line 35545) | function Ea(a) {
function xa (line 35558) | function xa(a, b) {
function Fa (line 35575) | function Fa(a) {
function Ha (line 35583) | function Ha() {
function Ja (line 35593) | function Ja(a, b) {
function Ia (line 35598) | function Ia(a) {
function Ga (line 35602) | function Ga(a) {
function Ka (line 35605) | function Ka(a) {
function W (line 35620) | function W(a, b) {
function va (line 35635) | function va(a, b) {
function ma (line 35649) | function ma() {
function S (line 35654) | function S(a) {
function R (line 35657) | function R(a) {
function GifWriter (line 35750) | function GifWriter(buf, width, height, gopts) {
function GifWriterOutputLZWCodeStream (line 35986) | function GifWriterOutputLZWCodeStream(buf, p, min_code_size, index_strea...
function GifReader (line 36136) | function GifReader(buf) {
function GifReaderLZWOutputIndexStream (line 36470) | function GifReaderLZWOutputIndexStream(code_stream, p, output, output_le...
function Tree (line 36701) | function Tree() {
function Data (line 36706) | function Data(source, dest) {
function tinf_build_bits_base (line 36766) | function tinf_build_bits_base(bits, base, delta, first) {
function tinf_build_fixed_trees (line 36785) | function tinf_build_fixed_trees(lt, dt) {
function tinf_build_tree (line 36825) | function tinf_build_tree(t, lengths, off, num) {
function tinf_getbit (line 36859) | function tinf_getbit(d) {
function tinf_read_bits (line 36875) | function tinf_read_bits(d, num, base) {
function tinf_decode_symbol (line 36892) | function tinf_decode_symbol(d, t) {
function tinf_decode_trees (line 36920) | function tinf_decode_trees(d, lt, dt) {
function tinf_inflate_block_data (line 36988) | function tinf_inflate_block_data(d, lt, dt) {
function tinf_inflate_uncompressed_block (line 37022) | function tinf_inflate_uncompressed_block(d) {
function tinf_uncompress (line 37059) | function tinf_uncompress(source, dest) {
function derive (line 37124) | function derive(v0, v1, v2, v3, t) {
function BoundingBox (line 37142) | function BoundingBox() {
function Path (line 37308) | function Path() {
function floatToString (line 37562) | function floatToString(v) {
function packValues (line 37570) | function packValues() {
function fail (line 37650) | function fail(message) {
function argument (line 37656) | function argument(predicate, message) {
function constant (line 37685) | function constant(v) {
function isByteEncodable (line 38257) | function isByteEncodable(value) {
function encodeVarDeltaRunAsZeroes (line 38262) | function encodeVarDeltaRunAsZeroes(deltas, pos, result) {
function encodeVarDeltaRunAsBytes (line 38274) | function encodeVarDeltaRunAsBytes(deltas, offset, result) {
function encodeVarDeltaRunAsWords (line 38306) | function encodeVarDeltaRunAsWords(deltas, offset, result) {
function Table (line 38692) | function Table(tableName, fields, options) {
function ushortList (line 38733) | function ushortList(itemName, list, count) {
function tableList (line 38748) | function tableList(itemName, records, itemCallback) {
function recordList (line 38765) | function recordList(itemName, records, itemCallback) {
function Coverage (line 38784) | function Coverage(coverageTable) {
function ScriptList (line 38800) | function ScriptList(scriptListTable) {
function FeatureList (line 38886) | function FeatureList(featureListTable) {
function LookupList (line 38923) | function LookupList(lookupListTable, subtableMakers) {
function getByte (line 38975) | function getByte(dataView, offset) {
function getUShort (line 38981) | function getUShort(dataView, offset) {
function getShort (line 38987) | function getShort(dataView, offset) {
function getULong (line 38993) | function getULong(dataView, offset) {
function getFixed (line 38999) | function getFixed(dataView, offset) {
function getTag (line 39007) | function getTag(dataView, offset) {
function getOffset (line 39018) | function getOffset(dataView, offset, offSize) {
function getBytes (line 39029) | function getBytes(dataView, startOffset, endOffset) {
function bytesToString (line 39039) | function bytesToString(bytes) {
function Parser (line 39060) | function Parser(data, offset) {
function parseCmapTableFormat12 (line 39676) | function parseCmapTableFormat12(cmap, p) {
function parseCmapTableFormat4 (line 39700) | function parseCmapTableFormat4(cmap, p, data, start, offset) {
function parseCmapTable (line 39762) | function parseCmapTable(data, start) {
function addSegment (line 39812) | function addSegment(t, code, glyphIndex) {
function addTerminatorSegment (line 39822) | function addTerminatorSegment(t) {
function makeCmapTable (line 39832) | function makeCmapTable(glyphs) {
function DefaultEncoding (line 41197) | function DefaultEncoding(font) {
function CmapEncoding (line 41223) | function CmapEncoding(cmap) {
function CffEncoding (line 41242) | function CffEncoding(encoding, charset) {
function GlyphNames (line 41263) | function GlyphNames(post) {
function addGlyphNames (line 41319) | function addGlyphNames(font) {
function line (line 41348) | function line(ctx, x1, y1, x2, y2) {
function getPathDefinition (line 41360) | function getPathDefinition(glyph, path) {
function Glyph (line 41402) | function Glyph(options) {
function drawCircles (line 41656) | function drawCircles(l, x, y, scale) {
function defineDependentProperty (line 41749) | function defineDependentProperty(glyph, externalName, internalName) {
function GlyphSet (line 41773) | function GlyphSet(font, glyphs) {
function glyphLoader (line 41814) | function glyphLoader(font, index) {
function ttfGlyphLoader (line 41831) | function ttfGlyphLoader(font, index, parseGlyph, data, position, buildPa...
function cffGlyphLoader (line 41858) | function cffGlyphLoader(font, index, parseCFFCharstring, charstring) {
function equals (line 41882) | function equals(a, b) {
function calcCFFSubroutineBias (line 41904) | function calcCFFSubroutineBias(subrs) {
function parseCFFIndex (line 41919) | function parseCFFIndex(data, start, conversionFn) {
function parseFloatOperand (line 41957) | function parseFloatOperand(parser) {
function parseOperand (line 41999) | function parseOperand(parser, b0) {
function entriesToObject (line 42041) | function entriesToObject(entries) {
function parseCFFDict (line 42065) | function parseCFFDict(data, start, size) {
function getCFFString (line 42097) | function getCFFString(strings, index) {
function interpretDict (line 42109) | function interpretDict(dict, meta, strings) {
function parseCFFHeader (line 42152) | function parseCFFHeader(data, start) {
function parseCFFTopDict (line 42214) | function parseCFFTopDict(data, strings) {
function parseCFFPrivateDict (line 42220) | function parseCFFPrivateDict(data, start, size, strings) {
function gatherCFFTopDicts (line 42240) | function gatherCFFTopDicts(data, start, cffIndex, strings) {
function parseCFFCharset (line 42274) | function parseCFFCharset(data, start, nGlyphs, strings) {
function parseCFFEncoding (line 42316) | function parseCFFEncoding(data, start, charset) {
function parseCFFCharstring (line 42348) | function parseCFFCharstring(font, glyph, code) {
function parseCFFFDSelect (line 42770) | function parseCFFFDSelect(data, start, nGlyphs, fdArrayCount) {
function parseCFFTable (line 42837) | function parseCFFTable(data, start, font) {
function encodeString (line 42961) | function encodeString(s, strings) {
function makeHeader (line 42982) | function makeHeader() {
function makeNameIndex (line 42991) | function makeNameIndex(fontNames) {
function makeDict (line 43004) | function makeDict(meta, attrs, strings) {
function makeTopDict (line 43022) | function makeTopDict(attrs, strings) {
function makeTopDictIndex (line 43030) | function makeTopDictIndex(topDict) {
function makeStringIndex (line 43038) | function makeStringIndex(strings) {
function makeGlobalSubrIndex (line 43054) | function makeGlobalSubrIndex() {
function makeCharsets (line 43061) | function makeCharsets(glyphNames, strings) {
function glyphToOps (line 43074) | function glyphToOps(glyph) {
function makeCharStringsIndex (line 43142) | function makeCharStringsIndex(glyphs) {
function makePrivateDict (line 43156) | function makePrivateDict(attrs, strings) {
function makeCFFTable (line 43164) | function makeCFFTable(glyphs, options) {
function parseHeadTable (line 43243) | function parseHeadTable(data, start) {
function makeHeadTable (line 43270) | function makeHeadTable(options) {
function parseHheaTable (line 43309) | function parseHheaTable(data, start) {
function makeHheaTable (line 43329) | function makeHheaTable(options) {
function parseHmtxTable (line 43361) | function parseHmtxTable(data, start, numMetrics, numGlyphs, glyphs) {
function makeHmtxTable (line 43378) | function makeHmtxTable(glyphs) {
function makeLtagTable (line 43403) | function makeLtagTable(tags) {
function parseLtagTable (line 43439) | function parseLtagTable(data, start) {
function parseMaxpTable (line 43467) | function parseMaxpTable(data, start) {
function makeMaxpTable (line 43491) | function makeMaxpTable(numGlyphs) {
function getLanguageCode (line 44020) | function getLanguageCode(platformID, languageID, ltag) {
function getEncoding (line 44101) | function getEncoding(platformID, encodingID, languageID) {
function parseNameTable (line 44125) | function parseNameTable(data, start, ltag) {
function reverseDict (line 44176) | function reverseDict(dict) {
function makeNameRecord (line 44185) | function makeNameRecord(
function findSubArray (line 44205) | function findSubArray(needle, haystack) {
function addStringToPool (line 44224) | function addStringToPool(s, pool) {
function makeNameTable (line 44238) | function makeNameTable(names, ltag) {
function getUnicodeRange (line 44498) | function getUnicodeRange(unicode) {
function parseOS2Table (line 44510) | function parseOS2Table(data, start) {
function makeOS2Table (line 44568) | function makeOS2Table(options) {
function parsePostTable (line 44633) | function parsePostTable(data, start) {
function makePostTable (line 44677) | function makePostTable() {
function parseGsubTable (line 44904) | function parseGsubTable(data, start) {
function makeGsubTable (line 45025) | function makeGsubTable(gsub) {
function parseMetaTable (line 45052) | function parseMetaTable(data, start) {
function makeMetaTable (line 45072) | function makeMetaTable(tags) {
function log2 (line 45114) | function log2(v) {
function computeCheckSum (line 45118) | function computeCheckSum(bytes) {
function makeTableRecord (line 45136) | function makeTableRecord(tag, checkSum, offset, length) {
function makeSfntTable (line 45157) | function makeSfntTable(tables) {
function metricsForChar (line 45232) | function metricsForChar(font, chars, notFoundMetrics) {
function average (line 45244) | function average(vs) {
function fontToSfntTable (line 45255) | function fontToSfntTable(font) {
function searchTag (line 45495) | function searchTag(arr, tag) {
function binSearch (line 45514) | function binSearch(arr, value) {
function searchRange (line 45534) | function searchRange(ranges, value) {
function Layout (line 45564) | function Layout(font, tableName) {
function Position (line 45874) | function Position(font) {
function Substitution (line 45955) | function Substitution(font) {
function arraysEqual (line 45960) | function arraysEqual(ar1, ar2) {
function getSubstFormat (line 45974) | function getSubstFormat(lookupTable, format, defaultSubtable) {
function isBrowser (line 46311) | function isBrowser() {
function nodeBufferToArrayBuffer (line 46315) | function nodeBufferToArrayBuffer(buffer) {
function arrayBufferToNodeBuffer (line 46325) | function arrayBufferToNodeBuffer(ab) {
function checkArgument (line 46335) | function checkArgument(expression, message) {
function parseGlyphCoordinate (line 46344) | function parseGlyphCoordinate(
function parseGlyph (line 46376) | function parseGlyph(glyph, data, start) {
function transformPoints (line 46520) | function transformPoints(points, transform) {
function getContours (line 46536) | function getContours(points) {
function getPath (line 46556) | function getPath(points) {
function buildPath (line 46615) | function buildPath(glyphs, glyph) {
function parseGlyfTable (line 46665) | function parseGlyfTable(data, start, loca, font) {
function Hinting (line 46733) | function Hinting(font) {
function roundOff (line 46757) | function roundOff(v) {
function roundToGrid (line 46764) | function roundToGrid(v) {
function roundToDoubleGrid (line 46772) | function roundToDoubleGrid(v) {
function roundToHalfGrid (line 46779) | function roundToHalfGrid(v) {
function roundUpToGrid (line 46786) | function roundUpToGrid(v) {
function roundDownToGrid (line 46793) | function roundDownToGrid(v) {
function UnitVector (line 47051) | function UnitVector(x, y) {
function getUnitVector (line 47144) | function getUnitVector(x, y) {
function HPoint (line 47162) | function HPoint(x, y, lastPointOfContour, onCurve) {
function State (line 47234) | function State(env, prog) {
function initTZone (line 47592) | function initTZone(state) {
function skip (line 47605) | function skip(state, handleElse) {
function SVTCA (line 47646) | function SVTCA(v, state) {
function SPVTCA (line 47656) | function SPVTCA(v, state) {
function SFVTCA (line 47666) | function SFVTCA(v, state) {
function SPVTL (line 47676) | function SPVTL(a, state) {
function SFVTL (line 47703) | function SFVTL(a, state) {
function SPVFS (line 47730) | function SPVFS(state) {
function SFVFS (line 47744) | function SFVFS(state) {
function GPV (line 47758) | function GPV(state) {
function GFV (line 47772) | function GFV(state) {
function SFVTPV (line 47786) | function SFVTPV(state) {
function ISECT (line 47796) | function ISECT(state) {
function SRP0 (line 47837) | function SRP0(state) {
function SRP1 (line 47847) | function SRP1(state) {
function SRP2 (line 47857) | function SRP2(state) {
function SZP0 (line 47867) | function SZP0(state) {
function SZP1 (line 47893) | function SZP1(state) {
function SZP2 (line 47919) | function SZP2(state) {
function SZPS (line 47945) | function SZPS(state) {
function SLOOP (line 47971) | function SLOOP(state) {
function RTG (line 47981) | function RTG(state) {
function RTHG (line 47991) | function RTHG(state) {
function SMD (line 48001) | function SMD(state) {
function ELSE (line 48013) | function ELSE(state) {
function JMPR (line 48029) | function JMPR(state) {
function SCVTCI (line 48042) | function SCVTCI(state) {
function DUP (line 48054) | function DUP(state) {
function POP (line 48066) | function POP(state) {
function CLEAR (line 48076) | function CLEAR(state) {
function SWAP (line 48086) | function SWAP(state) {
function DEPTH (line 48102) | function DEPTH(state) {
function LOOPCALL (line 48114) | function LOOPCALL(state) {
function CALL (line 48149) | function CALL(state) {
function CINDEX (line 48176) | function CINDEX(state) {
function MINDEX (line 48191) | function MINDEX(state) {
function FDEF (line 48204) | function FDEF(state) {
function MDAP (line 48227) | function MDAP(round, state) {
function IUP (line 48251) | function IUP(v, state) {
function SHP (line 48292) | function SHP(a, state) {
function SHC (line 48326) | function SHC(a, state) {
function SHZ (line 48352) | function SHZ(a, state) {
function SHPIX (line 48389) | function SHPIX(state) {
function IP (line 48419) | function IP(state) {
function MSIRP (line 48455) | function MSIRP(a, state) {
function ALIGNRP (line 48480) | function ALIGNRP(state) {
function RTDG (line 48511) | function RTDG(state) {
function MIAP (line 48521) | function MIAP(round, state) {
function NPUSHB (line 48558) | function NPUSHB(state) {
function NPUSHW (line 48578) | function NPUSHW(state) {
function WS (line 48601) | function WS(state) {
function RS (line 48621) | function RS(state) {
function WCVTP (line 48638) | function WCVTP(state) {
function RCVT (line 48653) | function RCVT(state) {
function GC (line 48666) | function GC(a, state) {
function MD (line 48680) | function MD(a, state) {
function MPPEM (line 48697) | function MPPEM(state) {
function FLIPON (line 48706) | function FLIPON(state) {
function LT (line 48715) | function LT(state) {
function LTEQ (line 48729) | function LTEQ(state) {
function GT (line 48743) | function GT(state) {
function GTEQ (line 48757) | function GTEQ(state) {
function EQ (line 48771) | function EQ(state) {
function NEQ (line 48785) | function NEQ(state) {
function ODD (line 48799) | function ODD(state) {
function EVEN (line 48812) | function EVEN(state) {
function IF (line 48825) | function IF(state) {
function EIF (line 48845) | function EIF(state) {
function AND (line 48857) | function AND(state) {
function OR (line 48871) | function OR(state) {
function NOT (line 48885) | function NOT(state) {
function DELTAP123 (line 48900) | function DELTAP123(b, state) {
function SDB (line 48937) | function SDB(state) {
function SDS (line 48950) | function SDS(state) {
function ADD (line 48963) | function ADD(state) {
function SUB (line 48977) | function SUB(state) {
function DIV (line 48991) | function DIV(state) {
function MUL (line 49005) | function MUL(state) {
function ABS (line 49019) | function ABS(state) {
function NEG (line 49032) | function NEG(state) {
function FLOOR (line 49045) | function FLOOR(state) {
function CEILING (line 49058) | function CEILING(state) {
function ROUND (line 49071) | function ROUND(dt, state) {
function WCVTF (line 49084) | function WCVTF(state) {
function DELTAC123 (line 49100) | function DELTAC123(b, state) {
function SROUND (line 49136) | function SROUND(state) {
function S45ROUND (line 49191) | function S45ROUND(state) {
function ROFF (line 49246) | function ROFF(state) {
function RUTG (line 49256) | function RUTG(state) {
function RDTG (line 49266) | function RDTG(state) {
function SCANCTRL (line 49276) | function SCANCTRL(state) {
function SDPVTL (line 49288) | function SDPVTL(a, state) {
function GETINFO (line 49315) | function GETINFO(state) {
function ROLL (line 49342) | function ROLL(state) {
function MAX (line 49359) | function MAX(state) {
function MIN (line 49373) | function MIN(state) {
function SCANTYPE (line 49387) | function SCANTYPE(state) {
function INSTCTRL (line 49397) | function INSTCTRL(state) {
function PUSHB (line 49419) | function PUSHB(n, state) {
function PUSHW (line 49437) | function PUSHW(n, state) {
function MDRP_MIRP (line 49467) | function MDRP_MIRP(indirect, setRp0, keepD, ro, dt, state) {
function Font (line 50076) | function Font(options) {
function assert (line 50538) | function assert(predicate, message) {}
function assertNamePresent (line 50540) | function assertNamePresent(name) {
function addName (line 50684) | function addName(name, names) {
function makeFvarAxis (line 50706) | function makeFvarAxis(n, axis, names) {
function parseFvarAxis (line 50722) | function parseFvarAxis(data, start, names) {
function makeFvarInstance (line 50734) | function makeFvarInstance(n, inst, axes, names) {
function parseFvarInstance (line 50753) | function parseFvarInstance(data, start, axes, names) {
function makeFvarTable (line 50767) | function makeFvarTable(fvar, names) {
function parseFvarTable (line 50794) | function parseFvarTable(data, start, names) {
function parseGposTable (line 50939) | function parseGposTable(data, start) {
function makeGposTable (line 50970) | function makeGposTable(gpos) {
function parseWindowsKernTable (line 50995) | function parseWindowsKernTable(p) {
function parseMacKernTable (line 51018) | function parseMacKernTable(p) {
function parseKernTable (line 51047) | function parseKernTable(data, start) {
function parseLocaTable (line 51069) | function parseLocaTable(data, start, numGlyphs, shortVersion) {
function loadFromFile (line 51104) | function loadFromFile(path, callback) {
function loadFromUrl (line 51120) | function loadFromUrl(url, callback) {
function parseOpenTypeTableEntries (line 51146) | function parseOpenTypeTableEntries(data, numTables) {
function parseWOFFTableEntries (line 51173) | function parseWOFFTableEntries(data, numTables) {
function uncompressTable (line 51213) | function uncompressTable(data, tableEntry) {
function parseBuffer (line 51245) | function parseBuffer(buffer) {
function load (line 51471) | function load(url, callback) {
function loadSync (line 51495) | function loadSync(url) {
function normalizeArray (line 51547) | function normalizeArray(parts, allowAboveRoot) {
function trim (line 51655) | function trim(arr) {
function basename (line 51724) | function basename(path) {
function filter (line 51812) | function filter(xs, f) {
function defaultSetTimout (line 51848) | function defaultSetTimout() {
function defaultClearTimeout (line 51851) | function defaultClearTimeout() {
function runTimeout (line 51874) | function runTimeout(fun) {
function runClearTimeout (line 51900) | function runClearTimeout(marker) {
function cleanUpNextTick (line 51932) | function cleanUpNextTick() {
function drainQueue (line 51947) | function drainQueue() {
function Item (line 51985) | function Item(fun, array) {
function noop (line 51999) | function noop() {}
function normalizeName (line 52084) | function normalizeName(name) {
function normalizeValue (line 52094) | function normalizeValue(value) {
function iteratorFor (line 52102) | function iteratorFor(items) {
function Headers (line 52119) | function Headers(headers) {
function consumed (line 52197) | function consumed(body) {
function fileReaderReady (line 52204) | function fileReaderReady(reader) {
function readBlobAsArrayBuffer (line 52215) | function readBlobAsArrayBuffer(blob) {
function readBlobAsText (line 52222) | function readBlobAsText(blob) {
function readArrayBufferAsText (line 52229) | function readArrayBufferAsText(buf) {
function bufferClone (line 52239) | function bufferClone(buf) {
function Body (line 52249) | function Body() {
function normalizeMethod (line 52357) | function normalizeMethod(method) {
function Request (line 52362) | function Request(input, options) {
function decode (line 52403) | function decode(body) {
function parseHeaders (line 52419) | function parseHeaders(rawHeaders) {
function Response (line 52437) | function Response(bodyInit, options) {
function _interopRequireDefault (line 52550) | function _interopRequireDefault(obj) {
function _calculateColor (line 53265) | function _calculateColor(hsb) {
function _interopRequireDefault (line 53380) | function _interopRequireDefault(obj) {
function _descriptionText (line 53597) | function _descriptionText(text) {
function _elementName (line 53706) | function _elementName(name) {
function _interopRequireDefault (line 53854) | function _interopRequireDefault(obj) {
function _gridMap (line 53900) | function _gridMap(idT, ingredients) {
function _gridSummary (line 53955) | function _gridSummary(numShapes, background, width, height) {
function _gridShapeDetails (line 53971) | function _gridShapeDetails(idT, ingredients) {
function _interopRequireDefault (line 54036) | function _interopRequireDefault(obj) {
function _getMiddle (line 54454) | function _getMiddle(f, args) {
function _getPos (line 54482) | function _getPos(args, canvasWidth, canvasHeight) {
function _canvasLocator (line 54511) | function _canvasLocator(args, canvasWidth, canvasHeight) {
function _getArea (line 54529) | function _getArea(objectType, shapeArgs, canvasWidth, canvasHeight) {
function _interopRequireDefault (line 54608) | function _interopRequireDefault(obj) {
function _textSummary (line 54654) | function _textSummary(numShapes, background, width, height) {
function _shapeDetails (line 54668) | function _shapeDetails(idT, ingredients) {
function _shapeList (line 54702) | function _shapeList(idT, ingredients) {
function _interopRequireDefault (line 54832) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 54935) | function _interopRequireDefault(obj) {
function _typeof (line 55204) | function _typeof(obj) {
function _getRequireWildcardCache (line 55231) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 55239) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 55271) | function _interopRequireDefault(obj) {
function _typeof (line 55840) | function _typeof(obj) {
function _getRequireWildcardCache (line 55871) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 55879) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 55911) | function _interopRequireDefault(obj) {
function _typeof (line 56941) | function _typeof(obj) {
function _getRequireWildcardCache (line 56965) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 56973) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 57005) | function _interopRequireDefault(obj) {
function _typeof (line 58614) | function _typeof(obj) {
function _getRequireWildcardCache (line 58643) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 58651) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 58683) | function _interopRequireDefault(obj) {
function getWindowWidth (line 59138) | function getWindowWidth() {
function getWindowHeight (line 59147) | function getWindowHeight() {
function launchFullscreen (line 59310) | function launchFullscreen(element) {
function exitFullscreen (line 59330) | function exitFullscreen() {
function _interopRequireDefault (line 59556) | function _interopRequireDefault(obj) {
function _slicedToArray (line 59559) | function _slicedToArray(arr, i) {
function _nonIterableRest (line 59564) | function _nonIterableRest() {
function _iterableToArrayLimit (line 59567) | function _iterableToArrayLimit(arr, i) {
function _arrayWithHoles (line 59601) | function _arrayWithHoles(arr) {
function _typeof (line 59604) | function _typeof(obj) {
function _interopRequireDefault (line 60671) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 60830) | function _interopRequireDefault(obj) {
function ErrorStackParser (line 60853) | function ErrorStackParser() {
function _getRequireWildcardCache (line 61127) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 61135) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 61167) | function _interopRequireDefault(obj) {
function _classCallCheck (line 61170) | function _classCallCheck(instance, Constructor) {
function _inherits (line 61175) | function _inherits(subClass, superClass) {
function _createSuper (line 61184) | function _createSuper(Derived) {
function _possibleConstructorReturn (line 61208) | function _possibleConstructorReturn(self, call) {
function _assertThisInitialized (line 61214) | function _assertThisInitialized(self) {
function _wrapNativeSuper (line 61222) | function _wrapNativeSuper(Class) {
function isNativeReflectConstruct (line 61248) | function isNativeReflectConstruct() {
function _construct (line 61259) | function _construct(Parent, args, Class) {
function _isNativeFunction (line 61274) | function _isNativeFunction(fn) {
function _setPrototypeOf (line 61277) | function _setPrototypeOf(o, p) {
function _getPrototypeOf (line 61286) | function _getPrototypeOf(o) {
function _typeof (line 61294) | function _typeof(obj) {
function err (line 61784) | function err(message, func, type) {
function formatType (line 61808) | function formatType() {
function _typeof (line 62064) | function _typeof(obj) {
function _getRequireWildcardCache (line 62085) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 62093) | function _interopRequireWildcard(obj) {
function modeAdjust (line 62127) | function modeAdjust(a, b, c, d, mode) {
function _interopRequireDefault (line 62153) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 62247) | function _interopRequireDefault(obj) {
function _classCallCheck (line 62250) | function _classCallCheck(instance, Constructor) {
function _defineProperties (line 62255) | function _defineProperties(target, props) {
function _createClass (line 62264) | function _createClass(Constructor, protoProps, staticProps) {
function FetchResources (line 62305) | function FetchResources(services, options) {
function _interopRequireDefault (line 62496) | function _interopRequireDefault(obj) {
function _typeof (line 62529) | function _typeof(obj) {
function _getRequireWildcardCache (line 62563) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 62571) | function _interopRequireWildcard(obj) {
function _classCallCheck (line 62603) | function _classCallCheck(instance, Constructor) {
function _defineProperties (line 62608) | function _defineProperties(target, props) {
function _createClass (line 62617) | function _createClass(Constructor, protoProps, staticProps) {
function p5 (line 62646) | function p5(sketch, node, sync) {
function _interopRequireDefault (line 63468) | function _interopRequireDefault(obj) {
function _typeof (line 64306) | function _typeof(obj) {
function _getRequireWildcardCache (line 64330) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 64338) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 64370) | function _interopRequireDefault(obj) {
function _getRequireWildcardCache (line 64585) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 64593) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 64625) | function _interopRequireDefault(obj) {
function _typeof (line 64628) | function _typeof(obj) {
function calculateOffset (line 65058) | function calculateOffset(object) {
function _typeof (line 65096) | function _typeof(obj) {
function _getRequireWildcardCache (line 65128) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 65136) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 65168) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 66495) | function _interopRequireDefault(obj) {
function _getRequireWildcardCache (line 66706) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 66714) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 66746) | function _interopRequireDefault(obj) {
function _typeof (line 66749) | function _typeof(obj) {
function _typeof (line 67131) | function _typeof(obj) {
function _getRequireWildcardCache (line 67158) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 67166) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 67198) | function _interopRequireDefault(obj) {
function _typeof (line 67977) | function _typeof(obj) {
function _getRequireWildcardCache (line 67999) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 68007) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 68039) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 68409) | function _interopRequireDefault(obj) {
function _typeof (line 68968) | function _typeof(obj) {
function _getRequireWildcardCache (line 68991) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 68999) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 69031) | function _interopRequireDefault(obj) {
function _typeof (line 70162) | function _typeof(obj) {
function _interopRequireDefault (line 70323) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 70918) | function _interopRequireDefault(obj) {
function _toConsumableArray (line 70921) | function _toConsumableArray(arr) {
function _nonIterableSpread (line 70924) | function _nonIterableSpread() {
function _iterableToArray (line 70927) | function _iterableToArray(iter) {
function _arrayWithoutHoles (line 70934) | function _arrayWithoutHoles(arr) {
function _interopRequireDefault (line 71557) | function _interopRequireDefault(obj) {
function _toConsumableArray (line 71560) | function _toConsumableArray(arr) {
function _nonIterableSpread (line 71563) | function _nonIterableSpread() {
function _iterableToArray (line 71566) | function _iterableToArray(iter) {
function _arrayWithoutHoles (line 71573) | function _arrayWithoutHoles(arr) {
function _typeof (line 71581) | function _typeof(obj) {
function _interopRequireDefault (line 71859) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 72579) | function _interopRequireDefault(obj) {
function _typeof (line 72582) | function _typeof(obj) {
function addElement (line 72895) | function addElement(elt, pInst, media) {
function createMedia (line 73913) | function createMedia(pInst, type, src, callback) {
function _typeof (line 76461) | function _typeof(obj) {
function _getRequireWildcardCache (line 76483) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 76491) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 76523) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 77288) | function _interopRequireDefault(obj) {
function _typeof (line 77693) | function _typeof(obj) {
function _getRequireWildcardCache (line 77717) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 77725) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 77757) | function _interopRequireDefault(obj) {
function getMousePos (line 78197) | function getMousePos(canvas, w, h, evt) {
function _interopRequireDefault (line 78824) | function _interopRequireDefault(obj) {
function getTouchInfo (line 78877) | function getTouchInfo(canvas, w, h, e) {
function buildBlurKernel (line 79650) | function buildBlurKernel(r) {
function blurARGB (line 79685) | function blurARGB(canvas, radius) {
function _interopRequireDefault (line 79865) | function _interopRequireDefault(obj) {
function _toConsumableArray (line 79868) | function _toConsumableArray(arr) {
function _nonIterableSpread (line 79871) | function _nonIterableSpread() {
function _iterableToArray (line 79874) | function _iterableToArray(iter) {
function _arrayWithoutHoles (line 79881) | function _arrayWithoutHoles(arr) {
function _typeof (line 80500) | function _typeof(obj) {
function _getRequireWildcardCache (line 80561) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 80569) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 80601) | function _interopRequireDefault(obj) {
function _createGif (line 80759) | function _createGif(
function _sAssign (line 80891) | function _sAssign(sVal, iVal) {
function _interopRequireDefault (line 81380) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 82605) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 83425) | function _interopRequireDefault(obj) {
function _typeof (line 83428) | function _typeof(obj) {
function makeObject (line 84007) | function makeObject(row, headers) {
function escapeHelper (line 85106) | function escapeHelper(content) {
function _checkFileExtension (line 85331) | function _checkFileExtension(filename, extension) {
function destroyClickedElement (line 85373) | function destroyClickedElement(event) {
function _interopRequireDefault (line 85452) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 86829) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 87202) | function _interopRequireDefault(obj) {
function elementsToP5XML (line 87505) | function elementsToP5XML(elements) {
function _interopRequireDefault (line 88210) | function _interopRequireDefault(obj) {
function hypot (line 89027) | function hypot(x, y, z) {
function _interopRequireDefault (line 89128) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 89183) | function _interopRequireDefault(obj) {
function _typeof (line 89492) | function _typeof(obj) {
function _getRequireWildcardCache (line 89524) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 89532) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 89564) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 91994) | function _interopRequireDefault(obj) {
function _typeof (line 92226) | function _typeof(obj) {
function _getRequireWildcardCache (line 92248) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 92256) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 92288) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 92663) | function _interopRequireDefault(obj) {
function _typeof (line 93063) | function _typeof(obj) {
function _getRequireWildcardCache (line 93095) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 93103) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 93135) | function _interopRequireDefault(obj) {
function _getRequireWildcardCache (line 93482) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 93490) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 93522) | function _interopRequireDefault(obj) {
function _typeof (line 93525) | function _typeof(obj) {
function isSpace (line 93776) | function isSpace(i) {
function pathToPoints (line 94059) | function pathToPoints(cmds, options) {
function simplify (line 94081) | function simplify(pts) {
function splitPaths (line 94095) | function splitPaths(cmds) {
function cmdToArr (line 94112) | function cmdToArr(cmd) {
function parseOpts (line 94126) | function parseOpts(options, defaults) {
function at (line 94141) | function at(v, i) {
function collinear (line 94146) | function collinear(a, b, c, thresholdAngle) {
function areaTriangle (line 94171) | function areaTriangle(a, b, c) {
function findDotsAtSegment (line 94177) | function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
function getPointAtSegmentLength (line 94210) | function getPointAtSegmentLength(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y,...
function pointAtLength (line 94226) | function pointAtLength(path, length, istotal) {
function pathToAbsolute (line 94279) | function pathToAbsolute(pathArray) {
function path2curve (line 94379) | function path2curve(path, path2) {
function a2c (line 94535) | function a2c(x1, y1, rx, ry, angle, lac, sweep_flag, x2, y2, recursive) {
function catmullRom2bezier (line 94655) | function catmullRom2bezier(crp, z) {
function l2c (line 94726) | function l2c(x1, y1, x2, y2) {
function q2c (line 94730) | function q2c(x1, y1, ax, ay, x2, y2) {
function bezlen (line 94743) | function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) {
function getTatLen (line 94791) | function getTatLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) {
function base3 (line 94809) | function base3(t, p1, p2, p3, p4) {
function cacheKey (line 94815) | function cacheKey() {
function _interopRequireDefault (line 94860) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 95236) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 95597) | function _interopRequireDefault(obj) {
function doNf (line 95796) | function doNf(num, left, right) {
function doNfc (line 95884) | function doNfc(num, right) {
function addNfp (line 95971) | function addNfp(num) {
function addNfs (line 96056) | function addNfs(num) {
function _interopRequireDefault (line 96211) | function _interopRequireDefault(obj) {
function _typeof (line 96379) | function _typeof(obj) {
function _getRequireWildcardCache (line 96404) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 96412) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 96444) | function _interopRequireDefault(obj) {
function _typeof (line 98371) | function _typeof(obj) {
function _getRequireWildcardCache (line 98396) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 98404) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 98436) | function _interopRequireDefault(obj) {
function _typeof (line 99000) | function _typeof(obj) {
function _getRequireWildcardCache (line 99022) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 99030) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 99062) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 100021) | function _interopRequireDefault(obj) {
function parseObj (line 100206) | function parseObj(model, lines) {
function parseSTL (line 100310) | function parseSTL(model, buffer) {
function isBinary (line 100345) | function isBinary(data) {
function matchDataViewAt (line 100362) | function matchDataViewAt(query, reader, offset) {
function parseBinarySTL (line 100377) | function parseBinarySTL(model, buffer) {
function parseASCIISTL (line 100469) | function parseASCIISTL(model, lines) {
function _typeof (line 100682) | function _typeof(obj) {
function _getRequireWildcardCache (line 100706) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 100714) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 100746) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 101699) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 103581) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 103912) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 104729) | function _interopRequireDefault(obj) {
function _typeof (line 104801) | function _typeof(obj) {
function _getRequireWildcardCache (line 104856) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 104864) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 104896) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 105345) | function _interopRequireDefault(obj) {
function freeBuffers (line 105387) | function freeBuffers(defs) {
function _typeof (line 105700) | function _typeof(obj) {
function _getRequireWildcardCache (line 105773) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 105781) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 105813) | function _interopRequireDefault(obj) {
function _toConsumableArray (line 105816) | function _toConsumableArray(arr) {
function _nonIterableSpread (line 105819) | function _nonIterableSpread() {
function _iterableToArray (line 105822) | function _iterableToArray(iter) {
function _arrayWithoutHoles (line 105829) | function _arrayWithoutHoles(arr) {
function vertexCallback (line 107310) | function vertexCallback(data, polyVertArray) {
function begincallback (line 107316) | function begincallback(type) {
function errorcallback (line 107322) | function errorcallback(errno) {
function combinecallback (line 107327) | function combinecallback(coords, data, weight) {
function edgeCallback (line 107331) | function edgeCallback(flag) {
function _interopRequireDefault (line 107483) | function _interopRequireDefault(obj) {
function _typeof (line 108104) | function _typeof(obj) {
function _getRequireWildcardCache (line 108152) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 108160) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 108192) | function _interopRequireDefault(obj) {
function _typeof (line 108578) | function _typeof(obj) {
function _getRequireWildcardCache (line 108609) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 108617) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 108649) | function _interopRequireDefault(obj) {
function ImageInfos (line 108694) | function ImageInfos(width, height) {
function setPixel (line 108771) | function setPixel(imageInfo, r, g, b, a) {
function push (line 108849) | function push(xs, ys, v) {
function clamp (line 108896) | function clamp(v, min, max) {
function byte (line 108908) | function byte(v) {
function Cubic (line 108922) | function Cubic(p0, c0, c1, p1) {
function cubicToQuadratics (line 109061) | function cubicToQuadratics(x0, y0, cx0, cy0, cx1, cy1, x1, y1) {
function pushLine (line 109146) | function pushLine(x0, y0, x1, y1) {
function samePoint (line 109162) | function samePoint(x0, y0, x1, y1) {
function layout (line 109271) | function layout(dim, dimImageInfos, cellImageInfos) {
function _interopRequireDefault (line 109618) | function _interopRequireDefault(obj) {
FILE: 166_Ascii_Image/ascii-image-canvas/sketch.js
function preload (line 16) | function preload() {
function setup (line 20) | function setup() {
function draw (line 24) | function draw() {
FILE: 166_Ascii_Image/ascii-image-dom/p5.js
function r (line 23) | function r(e, n, t) {
function _arrayWithHoles (line 15653) | function _arrayWithHoles(arr) {
function _arrayWithoutHoles (line 15663) | function _arrayWithoutHoles(arr) {
function _assertThisInitialized (line 15679) | function _assertThisInitialized(self) {
function _classCallCheck (line 15695) | function _classCallCheck(instance, Constructor) {
function _defineProperties (line 15707) | function _defineProperties(target, props) {
function _createClass (line 15717) | function _createClass(Constructor, protoProps, staticProps) {
function _defineProperty (line 15729) | function _defineProperty(obj, key, value) {
function _getPrototypeOf (line 15750) | function _getPrototypeOf(o) {
function _inherits (line 15767) | function _inherits(subClass, superClass) {
function _iterableToArray (line 15788) | function _iterableToArray(iter) {
function _iterableToArrayLimit (line 15802) | function _iterableToArrayLimit(arr, i) {
function _nonIterableRest (line 15838) | function _nonIterableRest() {
function _nonIterableSpread (line 15848) | function _nonIterableSpread() {
function _objectSpread (line 15860) | function _objectSpread(target) {
function _possibleConstructorReturn (line 15891) | function _possibleConstructorReturn(self, call) {
function _setPrototypeOf (line 15905) | function _setPrototypeOf(o, p) {
function _slicedToArray (line 15928) | function _slicedToArray(arr, i) {
function _toConsumableArray (line 15944) | function _toConsumableArray(arr) {
function _typeof2 (line 15954) | function _typeof2(obj) {
function _typeof (line 15972) | function _typeof(obj) {
function getLens (line 16018) | function getLens(b64) {
function byteLength (line 16036) | function byteLength(b64) {
function _byteLength (line 16043) | function _byteLength(b64, validLen, placeHoldersLen) {
function toByteArray (line 16047) | function toByteArray(b64) {
function tripletToBase64 (line 16091) | function tripletToBase64(num) {
function encodeChunk (line 16100) | function encodeChunk(uint8, start, end) {
function fromByteArray (line 16113) | function fromByteArray(uint8) {
function typedArraySupport (line 16201) | function typedArraySupport() {
function createBuffer (line 16234) | function createBuffer(length) {
function Buffer (line 16256) | function Buffer(arg, encodingOrOffset, length) {
function from (line 16285) | function from(value, encodingOrOffset, length) {
function assertSize (line 16359) | function assertSize(size) {
function alloc (line 16369) | function alloc(size, fill, encoding) {
function allocUnsafe (line 16393) | function allocUnsafe(size) {
function fromString (line 16411) | function fromString(string, encoding) {
function fromArrayLike (line 16435) | function fromArrayLike(array) {
function fromArrayBuffer (line 16444) | function fromArrayBuffer(array, byteOffset, length) {
function fromObject (line 16468) | function fromObject(obj) {
function checked (line 16493) | function checked(length) {
function SlowBuffer (line 16507) | function SlowBuffer(length) {
function byteLength (line 16598) | function byteLength(string, encoding) {
function slowToString (line 16648) | function slowToString(encoding, start, end) {
function swap (line 16726) | function swap(b, n, m) {
function bidirectionalIndexOf (line 16883) | function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
function arrayIndexOf (line 16939) | function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
function hexWrite (line 17011) | function hexWrite(buf, string, offset, length) {
function utf8Write (line 17036) | function utf8Write(buf, string, offset, length) {
function asciiWrite (line 17045) | function asciiWrite(buf, string, offset, length) {
function latin1Write (line 17049) | function latin1Write(buf, string, offset, length) {
function base64Write (line 17053) | function base64Write(buf, string, offset, length) {
function ucs2Write (line 17057) | function ucs2Write(buf, string, offset, length) {
function base64Slice (line 17147) | function base64Slice(buf, start, end) {
function utf8Slice (line 17155) | function utf8Slice(buf, start, end) {
function decodeCodePointsArray (line 17245) | function decodeCodePointsArray(codePoints) {
function asciiSlice (line 17263) | function asciiSlice(buf, start, end) {
function latin1Slice (line 17273) | function latin1Slice(buf, start, end) {
function hexSlice (line 17283) | function hexSlice(buf, start, end) {
function utf16leSlice (line 17296) | function utf16leSlice(buf, start, end) {
function checkOffset (line 17336) | function checkOffset(offset, ext, length) {
function checkInt (line 17525) | function checkInt(buf, value, offset, ext, max, min) {
function checkIEEE754 (line 17751) | function checkIEEE754(buf, value, offset, ext, max, min) {
function writeFloat (line 17756) | function writeFloat(buf, value, offset, littleEndian, noAssert) {
function writeDouble (line 17781) | function writeDouble(buf, value, offset, littleEndian, noAssert) {
function base64clean (line 17940) | function base64clean(str) {
function utf8ToBytes (line 17954) | function utf8ToBytes(string, units) {
function asciiToBytes (line 18032) | function asciiToBytes(str) {
function utf16leToBytes (line 18041) | function utf16leToBytes(str, units) {
function base64ToBytes (line 18057) | function base64ToBytes(str) {
function blitBuffer (line 18061) | function blitBuffer(src, dst, offset, length) {
function isInstance (line 18072) | function isInstance(obj, type) {
function numberIsNaN (line 18081) | function numberIsNaN(obj) {
function F (line 19843) | function F() {
function RE (line 22351) | function RE(s, f) {
function F (line 25350) | function F() {
function getSubstitution (line 25971) | function getSubstitution(
function objectOrFunction (line 29310) | function objectOrFunction(x) {
function isFunction (line 29315) | function isFunction(x) {
function setScheduler (line 29350) | function setScheduler(scheduleFn) {
function setAsap (line 29354) | function setAsap(asapFn) {
function useNextTick (line 29374) | function useNextTick() {
function useVertxTimer (line 29383) | function useVertxTimer() {
function useMutationObserver (line 29393) | function useMutationObserver() {
function useMessageChannel (line 29405) | function useMessageChannel() {
function useSetTimeout (line 29413) | function useSetTimeout() {
function flush (line 29423) | function flush() {
function attemptVertx (line 29437) | function attemptVertx() {
function then (line 29461) | function then(onFulfillment, onRejection) {
function resolve$1 (line 29515) | function resolve$1(object) {
function noop (line 29536) | function noop() {}
function selfFulfillment (line 29542) | function selfFulfillment() {
function cannotReturnOwn (line 29546) | function cannotReturnOwn() {
function tryThen (line 29552) | function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {
function handleForeignThenable (line 29560) | function handleForeignThenable(promise, thenable, then$$1) {
function handleOwnThenable (line 29595) | function handleOwnThenable(promise, thenable) {
function handleMaybeThenable (line 29614) | function handleMaybeThenable(promise, maybeThenable, then$$1) {
function resolve (line 29632) | function resolve(promise, value) {
function publishRejection (line 29649) | function publishRejection(promise) {
function fulfill (line 29657) | function fulfill(promise, value) {
function reject (line 29670) | function reject(promise, reason) {
function subscribe (line 29680) | function subscribe(parent, child, onFulfillment, onRejection) {
function publish (line 29695) | function publish(promise) {
function invokeCallback (line 29721) | function invokeCallback(settled, promise, callback, detail) {
function initializePromise (line 29756) | function initializePromise(promise, resolver) {
function nextId (line 29772) | function nextId() {
function makePromise (line 29776) | function makePromise(promise) {
function validationError (line 29783) | function validationError() {
function Enumerator (line 29788) | function Enumerator(Constructor, input) {
function all (line 29946) | function all(entries) {
function race (line 30015) | function race(entries) {
function reject$1 (line 30067) | function reject$1(reason) {
function needsResolver (line 30075) | function needsResolver() {
function needsNew (line 30081) | function needsNew() {
function Promise (line 30192) | function Promise(resolver) {
function polyfill (line 30468) | function polyfill() {
function generateCallbackFunction (line 30544) | function generateCallbackFunction() {
function clearFunction (line 30548) | function clearFunction(functionName) {
function removeScript (line 30558) | function removeScript(scriptId) {
function fetchJsonp (line 30565) | function fetchJsonp(_url) {
function _interopDefault (line 30863) | function _interopDefault(ex) {
function defaults (line 30875) | function defaults(obj) {
function getDefaults (line 31095) | function getDefaults() {
function Browser (line 31113) | function Browser(services) {
function _interopDefault (line 31249) | function _interopDefault(ex) {
function Logger (line 31301) | function Logger(concreteLogger) {
function EventEmitter (line 31423) | function EventEmitter() {
function defer (line 31493) | function defer() {
function makeString (line 31504) | function makeString(object) {
function copy (line 31510) | function copy(a, s, t) {
function getLastOfPath (line 31516) | function getLastOfPath(object, path, Empty) {
function setPath (line 31541) | function setPath(object, path, newValue) {
function pushPath (line 31548) | function pushPath(object, path, newValue, concat) {
function getPath (line 31557) | function getPath(object, path) {
function getPathWithDefaults (line 31565) | function getPathWithDefaults(data, defaultData, key) {
function deepExtend (line 31574) | function deepExtend(target, source, overwrite) {
function regexEscape (line 31596) | function regexEscape(str) {
function escape (line 31612) | function escape(data) {
function ResourceStore (line 31627) | function ResourceStore(data) {
function Translator (line 31851) | function Translator(services) {
function capitalize (line 32423) | function capitalize(string) {
function LanguageUtil (line 32430) | function LanguageUtil(options) {
function createRules (line 32907) | function createRules() {
function PluralResolver (line 32923) | function PluralResolver(languageUtils) {
function Interpolator (line 33043) | function Interpolator() {
function regexSafe (line 33146) | function regexSafe(val) {
function handleHasOptions (line 33255) | function handleHasOptions(key, inheritedOptions) {
function remove (line 33313) | function remove(arr, what) {
function Connector (line 33327) | function Connector(backend, store, services) {
function get (line 33643) | function get() {
function transformOptions (line 33733) | function transformOptions(options) {
function noop (line 33748) | function noop() {}
function I18n (line 33755) | function I18n() {
function createClassOnDemand (line 33816) | function createClassOnDemand(ClassOrObject) {
function t (line 34571) | function t(a, b) {
function u (line 34574) | function u(a, b) {
function v (line 34577) | function v(a, b, c) {
function x (line 34586) | function x(a, b, c) {
function z (line 34591) | function z(a, b) {
function aa (line 34594) | function aa(a, b, c) {
function ba (line 34603) | function ba(a, b, c) {
function ca (line 34608) | function ca(a) {
function da (line 34611) | function da(a) {
function A (line 34614) | function A(a, b, c, d) {
function ea (line 34621) | function ea(a) {
function E (line 34628) | function E(a, b) {
function I (line 34638) | function I(a) {
function K (line 34650) | function K(a) {
function L (line 34667) | function L(a, b) {
function B (line 34681) | function B(a) {
function H (line 34696) | function H(a, b) {
function C (line 34704) | function C(a, b) {
function D (line 34713) | function D(a, b) {
function fa (line 34724) | function fa(a) {
function F (line 34730) | function F(a, b) {
function G (line 34740) | function G(a, b) {
function ha (line 34750) | function ha(a) {
function P (line 34757) | function P(a, b) {
function ia (line 34761) | function ia(a, b, c) {
function Q (line 34774) | function Q(a) {
function ja (line 34781) | function ja(a, b) {
function ka (line 34787) | function ka(a) {
function la (line 34794) | function la(a, b, c) {
function oa (line 34800) | function oa(a, b) {
function pa (line 34815) | function pa(a) {
function T (line 34822) | function T(a, b, c) {
function U (line 34843) | function U(a, b, c, d, e, f) {
function sa (line 34863) | function sa(a, b, c, d, e) {
function ta (line 34869) | function ta(a, b, c) {
function ua (line 34876) | function ua(a, b, c, d, e) {
function qa (line 34886) | function qa(a, b) {
function wa (line 34921) | function wa(a, b) {
function ra (line 35021) | function ra(a, b) {
function ya (line 35068) | function ya(a, b) {
function za (line 35129) | function za(a, b) {
function Aa (line 35147) | function Aa(a) {
function na (line 35152) | function na(a, b, c) {
function Ba (line 35159) | function Ba(a, b, c) {
function X (line 35164) | function X() {
function Z (line 35484) | function Z(a, b) {
function V (line 35506) | function V(a, b) {
function ga (line 35509) | function ga(a, b) {
function M (line 35515) | function M() {
function J (line 35520) | function J(a) {
function Ca (line 35523) | function Ca() {
function N (line 35531) | function N(a, b) {
function Da (line 35538) | function Da() {
function Ea (line 35545) | function Ea(a) {
function xa (line 35558) | function xa(a, b) {
function Fa (line 35575) | function Fa(a) {
function Ha (line 35583) | function Ha() {
function Ja (line 35593) | function Ja(a, b) {
function Ia (line 35598) | function Ia(a) {
function Ga (line 35602) | function Ga(a) {
function Ka (line 35605) | function Ka(a) {
function W (line 35620) | function W(a, b) {
function va (line 35635) | function va(a, b) {
function ma (line 35649) | function ma() {
function S (line 35654) | function S(a) {
function R (line 35657) | function R(a) {
function GifWriter (line 35750) | function GifWriter(buf, width, height, gopts) {
function GifWriterOutputLZWCodeStream (line 35986) | function GifWriterOutputLZWCodeStream(buf, p, min_code_size, index_strea...
function GifReader (line 36136) | function GifReader(buf) {
function GifReaderLZWOutputIndexStream (line 36470) | function GifReaderLZWOutputIndexStream(code_stream, p, output, output_le...
function Tree (line 36701) | function Tree() {
function Data (line 36706) | function Data(source, dest) {
function tinf_build_bits_base (line 36766) | function tinf_build_bits_base(bits, base, delta, first) {
function tinf_build_fixed_trees (line 36785) | function tinf_build_fixed_trees(lt, dt) {
function tinf_build_tree (line 36825) | function tinf_build_tree(t, lengths, off, num) {
function tinf_getbit (line 36859) | function tinf_getbit(d) {
function tinf_read_bits (line 36875) | function tinf_read_bits(d, num, base) {
function tinf_decode_symbol (line 36892) | function tinf_decode_symbol(d, t) {
function tinf_decode_trees (line 36920) | function tinf_decode_trees(d, lt, dt) {
function tinf_inflate_block_data (line 36988) | function tinf_inflate_block_data(d, lt, dt) {
function tinf_inflate_uncompressed_block (line 37022) | function tinf_inflate_uncompressed_block(d) {
function tinf_uncompress (line 37059) | function tinf_uncompress(source, dest) {
function derive (line 37124) | function derive(v0, v1, v2, v3, t) {
function BoundingBox (line 37142) | function BoundingBox() {
function Path (line 37308) | function Path() {
function floatToString (line 37562) | function floatToString(v) {
function packValues (line 37570) | function packValues() {
function fail (line 37650) | function fail(message) {
function argument (line 37656) | function argument(predicate, message) {
function constant (line 37685) | function constant(v) {
function isByteEncodable (line 38257) | function isByteEncodable(value) {
function encodeVarDeltaRunAsZeroes (line 38262) | function encodeVarDeltaRunAsZeroes(deltas, pos, result) {
function encodeVarDeltaRunAsBytes (line 38274) | function encodeVarDeltaRunAsBytes(deltas, offset, result) {
function encodeVarDeltaRunAsWords (line 38306) | function encodeVarDeltaRunAsWords(deltas, offset, result) {
function Table (line 38692) | function Table(tableName, fields, options) {
function ushortList (line 38733) | function ushortList(itemName, list, count) {
function tableList (line 38748) | function tableList(itemName, records, itemCallback) {
function recordList (line 38765) | function recordList(itemName, records, itemCallback) {
function Coverage (line 38784) | function Coverage(coverageTable) {
function ScriptList (line 38800) | function ScriptList(scriptListTable) {
function FeatureList (line 38886) | function FeatureList(featureListTable) {
function LookupList (line 38923) | function LookupList(lookupListTable, subtableMakers) {
function getByte (line 38975) | function getByte(dataView, offset) {
function getUShort (line 38981) | function getUShort(dataView, offset) {
function getShort (line 38987) | function getShort(dataView, offset) {
function getULong (line 38993) | function getULong(dataView, offset) {
function getFixed (line 38999) | function getFixed(dataView, offset) {
function getTag (line 39007) | function getTag(dataView, offset) {
function getOffset (line 39018) | function getOffset(dataView, offset, offSize) {
function getBytes (line 39029) | function getBytes(dataView, startOffset, endOffset) {
function bytesToString (line 39039) | function bytesToString(bytes) {
function Parser (line 39060) | function Parser(data, offset) {
function parseCmapTableFormat12 (line 39676) | function parseCmapTableFormat12(cmap, p) {
function parseCmapTableFormat4 (line 39700) | function parseCmapTableFormat4(cmap, p, data, start, offset) {
function parseCmapTable (line 39762) | function parseCmapTable(data, start) {
function addSegment (line 39812) | function addSegment(t, code, glyphIndex) {
function addTerminatorSegment (line 39822) | function addTerminatorSegment(t) {
function makeCmapTable (line 39832) | function makeCmapTable(glyphs) {
function DefaultEncoding (line 41197) | function DefaultEncoding(font) {
function CmapEncoding (line 41223) | function CmapEncoding(cmap) {
function CffEncoding (line 41242) | function CffEncoding(encoding, charset) {
function GlyphNames (line 41263) | function GlyphNames(post) {
function addGlyphNames (line 41319) | function addGlyphNames(font) {
function line (line 41348) | function line(ctx, x1, y1, x2, y2) {
function getPathDefinition (line 41360) | function getPathDefinition(glyph, path) {
function Glyph (line 41402) | function Glyph(options) {
function drawCircles (line 41656) | function drawCircles(l, x, y, scale) {
function defineDependentProperty (line 41749) | function defineDependentProperty(glyph, externalName, internalName) {
function GlyphSet (line 41773) | function GlyphSet(font, glyphs) {
function glyphLoader (line 41814) | function glyphLoader(font, index) {
function ttfGlyphLoader (line 41831) | function ttfGlyphLoader(font, index, parseGlyph, data, position, buildPa...
function cffGlyphLoader (line 41858) | function cffGlyphLoader(font, index, parseCFFCharstring, charstring) {
function equals (line 41882) | function equals(a, b) {
function calcCFFSubroutineBias (line 41904) | function calcCFFSubroutineBias(subrs) {
function parseCFFIndex (line 41919) | function parseCFFIndex(data, start, conversionFn) {
function parseFloatOperand (line 41957) | function parseFloatOperand(parser) {
function parseOperand (line 41999) | function parseOperand(parser, b0) {
function entriesToObject (line 42041) | function entriesToObject(entries) {
function parseCFFDict (line 42065) | function parseCFFDict(data, start, size) {
function getCFFString (line 42097) | function getCFFString(strings, index) {
function interpretDict (line 42109) | function interpretDict(dict, meta, strings) {
function parseCFFHeader (line 42152) | function parseCFFHeader(data, start) {
function parseCFFTopDict (line 42214) | function parseCFFTopDict(data, strings) {
function parseCFFPrivateDict (line 42220) | function parseCFFPrivateDict(data, start, size, strings) {
function gatherCFFTopDicts (line 42240) | function gatherCFFTopDicts(data, start, cffIndex, strings) {
function parseCFFCharset (line 42274) | function parseCFFCharset(data, start, nGlyphs, strings) {
function parseCFFEncoding (line 42316) | function parseCFFEncoding(data, start, charset) {
function parseCFFCharstring (line 42348) | function parseCFFCharstring(font, glyph, code) {
function parseCFFFDSelect (line 42770) | function parseCFFFDSelect(data, start, nGlyphs, fdArrayCount) {
function parseCFFTable (line 42837) | function parseCFFTable(data, start, font) {
function encodeString (line 42961) | function encodeString(s, strings) {
function makeHeader (line 42982) | function makeHeader() {
function makeNameIndex (line 42991) | function makeNameIndex(fontNames) {
function makeDict (line 43004) | function makeDict(meta, attrs, strings) {
function makeTopDict (line 43022) | function makeTopDict(attrs, strings) {
function makeTopDictIndex (line 43030) | function makeTopDictIndex(topDict) {
function makeStringIndex (line 43038) | function makeStringIndex(strings) {
function makeGlobalSubrIndex (line 43054) | function makeGlobalSubrIndex() {
function makeCharsets (line 43061) | function makeCharsets(glyphNames, strings) {
function glyphToOps (line 43074) | function glyphToOps(glyph) {
function makeCharStringsIndex (line 43142) | function makeCharStringsIndex(glyphs) {
function makePrivateDict (line 43156) | function makePrivateDict(attrs, strings) {
function makeCFFTable (line 43164) | function makeCFFTable(glyphs, options) {
function parseHeadTable (line 43243) | function parseHeadTable(data, start) {
function makeHeadTable (line 43270) | function makeHeadTable(options) {
function parseHheaTable (line 43309) | function parseHheaTable(data, start) {
function makeHheaTable (line 43329) | function makeHheaTable(options) {
function parseHmtxTable (line 43361) | function parseHmtxTable(data, start, numMetrics, numGlyphs, glyphs) {
function makeHmtxTable (line 43378) | function makeHmtxTable(glyphs) {
function makeLtagTable (line 43403) | function makeLtagTable(tags) {
function parseLtagTable (line 43439) | function parseLtagTable(data, start) {
function parseMaxpTable (line 43467) | function parseMaxpTable(data, start) {
function makeMaxpTable (line 43491) | function makeMaxpTable(numGlyphs) {
function getLanguageCode (line 44020) | function getLanguageCode(platformID, languageID, ltag) {
function getEncoding (line 44101) | function getEncoding(platformID, encodingID, languageID) {
function parseNameTable (line 44125) | function parseNameTable(data, start, ltag) {
function reverseDict (line 44176) | function reverseDict(dict) {
function makeNameRecord (line 44185) | function makeNameRecord(
function findSubArray (line 44205) | function findSubArray(needle, haystack) {
function addStringToPool (line 44224) | function addStringToPool(s, pool) {
function makeNameTable (line 44238) | function makeNameTable(names, ltag) {
function getUnicodeRange (line 44498) | function getUnicodeRange(unicode) {
function parseOS2Table (line 44510) | function parseOS2Table(data, start) {
function makeOS2Table (line 44568) | function makeOS2Table(options) {
function parsePostTable (line 44633) | function parsePostTable(data, start) {
function makePostTable (line 44677) | function makePostTable() {
function parseGsubTable (line 44904) | function parseGsubTable(data, start) {
function makeGsubTable (line 45025) | function makeGsubTable(gsub) {
function parseMetaTable (line 45052) | function parseMetaTable(data, start) {
function makeMetaTable (line 45072) | function makeMetaTable(tags) {
function log2 (line 45114) | function log2(v) {
function computeCheckSum (line 45118) | function computeCheckSum(bytes) {
function makeTableRecord (line 45136) | function makeTableRecord(tag, checkSum, offset, length) {
function makeSfntTable (line 45157) | function makeSfntTable(tables) {
function metricsForChar (line 45232) | function metricsForChar(font, chars, notFoundMetrics) {
function average (line 45244) | function average(vs) {
function fontToSfntTable (line 45255) | function fontToSfntTable(font) {
function searchTag (line 45495) | function searchTag(arr, tag) {
function binSearch (line 45514) | function binSearch(arr, value) {
function searchRange (line 45534) | function searchRange(ranges, value) {
function Layout (line 45564) | function Layout(font, tableName) {
function Position (line 45874) | function Position(font) {
function Substitution (line 45955) | function Substitution(font) {
function arraysEqual (line 45960) | function arraysEqual(ar1, ar2) {
function getSubstFormat (line 45974) | function getSubstFormat(lookupTable, format, defaultSubtable) {
function isBrowser (line 46311) | function isBrowser() {
function nodeBufferToArrayBuffer (line 46315) | function nodeBufferToArrayBuffer(buffer) {
function arrayBufferToNodeBuffer (line 46325) | function arrayBufferToNodeBuffer(ab) {
function checkArgument (line 46335) | function checkArgument(expression, message) {
function parseGlyphCoordinate (line 46344) | function parseGlyphCoordinate(
function parseGlyph (line 46376) | function parseGlyph(glyph, data, start) {
function transformPoints (line 46520) | function transformPoints(points, transform) {
function getContours (line 46536) | function getContours(points) {
function getPath (line 46556) | function getPath(points) {
function buildPath (line 46615) | function buildPath(glyphs, glyph) {
function parseGlyfTable (line 46665) | function parseGlyfTable(data, start, loca, font) {
function Hinting (line 46733) | function Hinting(font) {
function roundOff (line 46757) | function roundOff(v) {
function roundToGrid (line 46764) | function roundToGrid(v) {
function roundToDoubleGrid (line 46772) | function roundToDoubleGrid(v) {
function roundToHalfGrid (line 46779) | function roundToHalfGrid(v) {
function roundUpToGrid (line 46786) | function roundUpToGrid(v) {
function roundDownToGrid (line 46793) | function roundDownToGrid(v) {
function UnitVector (line 47051) | function UnitVector(x, y) {
function getUnitVector (line 47144) | function getUnitVector(x, y) {
function HPoint (line 47162) | function HPoint(x, y, lastPointOfContour, onCurve) {
function State (line 47234) | function State(env, prog) {
function initTZone (line 47592) | function initTZone(state) {
function skip (line 47605) | function skip(state, handleElse) {
function SVTCA (line 47646) | function SVTCA(v, state) {
function SPVTCA (line 47656) | function SPVTCA(v, state) {
function SFVTCA (line 47666) | function SFVTCA(v, state) {
function SPVTL (line 47676) | function SPVTL(a, state) {
function SFVTL (line 47703) | function SFVTL(a, state) {
function SPVFS (line 47730) | function SPVFS(state) {
function SFVFS (line 47744) | function SFVFS(state) {
function GPV (line 47758) | function GPV(state) {
function GFV (line 47772) | function GFV(state) {
function SFVTPV (line 47786) | function SFVTPV(state) {
function ISECT (line 47796) | function ISECT(state) {
function SRP0 (line 47837) | function SRP0(state) {
function SRP1 (line 47847) | function SRP1(state) {
function SRP2 (line 47857) | function SRP2(state) {
function SZP0 (line 47867) | function SZP0(state) {
function SZP1 (line 47893) | function SZP1(state) {
function SZP2 (line 47919) | function SZP2(state) {
function SZPS (line 47945) | function SZPS(state) {
function SLOOP (line 47971) | function SLOOP(state) {
function RTG (line 47981) | function RTG(state) {
function RTHG (line 47991) | function RTHG(state) {
function SMD (line 48001) | function SMD(state) {
function ELSE (line 48013) | function ELSE(state) {
function JMPR (line 48029) | function JMPR(state) {
function SCVTCI (line 48042) | function SCVTCI(state) {
function DUP (line 48054) | function DUP(state) {
function POP (line 48066) | function POP(state) {
function CLEAR (line 48076) | function CLEAR(state) {
function SWAP (line 48086) | function SWAP(state) {
function DEPTH (line 48102) | function DEPTH(state) {
function LOOPCALL (line 48114) | function LOOPCALL(state) {
function CALL (line 48149) | function CALL(state) {
function CINDEX (line 48176) | function CINDEX(state) {
function MINDEX (line 48191) | function MINDEX(state) {
function FDEF (line 48204) | function FDEF(state) {
function MDAP (line 48227) | function MDAP(round, state) {
function IUP (line 48251) | function IUP(v, state) {
function SHP (line 48292) | function SHP(a, state) {
function SHC (line 48326) | function SHC(a, state) {
function SHZ (line 48352) | function SHZ(a, state) {
function SHPIX (line 48389) | function SHPIX(state) {
function IP (line 48419) | function IP(state) {
function MSIRP (line 48455) | function MSIRP(a, state) {
function ALIGNRP (line 48480) | function ALIGNRP(state) {
function RTDG (line 48511) | function RTDG(state) {
function MIAP (line 48521) | function MIAP(round, state) {
function NPUSHB (line 48558) | function NPUSHB(state) {
function NPUSHW (line 48578) | function NPUSHW(state) {
function WS (line 48601) | function WS(state) {
function RS (line 48621) | function RS(state) {
function WCVTP (line 48638) | function WCVTP(state) {
function RCVT (line 48653) | function RCVT(state) {
function GC (line 48666) | function GC(a, state) {
function MD (line 48680) | function MD(a, state) {
function MPPEM (line 48697) | function MPPEM(state) {
function FLIPON (line 48706) | function FLIPON(state) {
function LT (line 48715) | function LT(state) {
function LTEQ (line 48729) | function LTEQ(state) {
function GT (line 48743) | function GT(state) {
function GTEQ (line 48757) | function GTEQ(state) {
function EQ (line 48771) | function EQ(state) {
function NEQ (line 48785) | function NEQ(state) {
function ODD (line 48799) | function ODD(state) {
function EVEN (line 48812) | function EVEN(state) {
function IF (line 48825) | function IF(state) {
function EIF (line 48845) | function EIF(state) {
function AND (line 48857) | function AND(state) {
function OR (line 48871) | function OR(state) {
function NOT (line 48885) | function NOT(state) {
function DELTAP123 (line 48900) | function DELTAP123(b, state) {
function SDB (line 48937) | function SDB(state) {
function SDS (line 48950) | function SDS(state) {
function ADD (line 48963) | function ADD(state) {
function SUB (line 48977) | function SUB(state) {
function DIV (line 48991) | function DIV(state) {
function MUL (line 49005) | function MUL(state) {
function ABS (line 49019) | function ABS(state) {
function NEG (line 49032) | function NEG(state) {
function FLOOR (line 49045) | function FLOOR(state) {
function CEILING (line 49058) | function CEILING(state) {
function ROUND (line 49071) | function ROUND(dt, state) {
function WCVTF (line 49084) | function WCVTF(state) {
function DELTAC123 (line 49100) | function DELTAC123(b, state) {
function SROUND (line 49136) | function SROUND(state) {
function S45ROUND (line 49191) | function S45ROUND(state) {
function ROFF (line 49246) | function ROFF(state) {
function RUTG (line 49256) | function RUTG(state) {
function RDTG (line 49266) | function RDTG(state) {
function SCANCTRL (line 49276) | function SCANCTRL(state) {
function SDPVTL (line 49288) | function SDPVTL(a, state) {
function GETINFO (line 49315) | function GETINFO(state) {
function ROLL (line 49342) | function ROLL(state) {
function MAX (line 49359) | function MAX(state) {
function MIN (line 49373) | function MIN(state) {
function SCANTYPE (line 49387) | function SCANTYPE(state) {
function INSTCTRL (line 49397) | function INSTCTRL(state) {
function PUSHB (line 49419) | function PUSHB(n, state) {
function PUSHW (line 49437) | function PUSHW(n, state) {
function MDRP_MIRP (line 49467) | function MDRP_MIRP(indirect, setRp0, keepD, ro, dt, state) {
function Font (line 50076) | function Font(options) {
function assert (line 50538) | function assert(predicate, message) {}
function assertNamePresent (line 50540) | function assertNamePresent(name) {
function addName (line 50684) | function addName(name, names) {
function makeFvarAxis (line 50706) | function makeFvarAxis(n, axis, names) {
function parseFvarAxis (line 50722) | function parseFvarAxis(data, start, names) {
function makeFvarInstance (line 50734) | function makeFvarInstance(n, inst, axes, names) {
function parseFvarInstance (line 50753) | function parseFvarInstance(data, start, axes, names) {
function makeFvarTable (line 50767) | function makeFvarTable(fvar, names) {
function parseFvarTable (line 50794) | function parseFvarTable(data, start, names) {
function parseGposTable (line 50939) | function parseGposTable(data, start) {
function makeGposTable (line 50970) | function makeGposTable(gpos) {
function parseWindowsKernTable (line 50995) | function parseWindowsKernTable(p) {
function parseMacKernTable (line 51018) | function parseMacKernTable(p) {
function parseKernTable (line 51047) | function parseKernTable(data, start) {
function parseLocaTable (line 51069) | function parseLocaTable(data, start, numGlyphs, shortVersion) {
function loadFromFile (line 51104) | function loadFromFile(path, callback) {
function loadFromUrl (line 51120) | function loadFromUrl(url, callback) {
function parseOpenTypeTableEntries (line 51146) | function parseOpenTypeTableEntries(data, numTables) {
function parseWOFFTableEntries (line 51173) | function parseWOFFTableEntries(data, numTables) {
function uncompressTable (line 51213) | function uncompressTable(data, tableEntry) {
function parseBuffer (line 51245) | function parseBuffer(buffer) {
function load (line 51471) | function load(url, callback) {
function loadSync (line 51495) | function loadSync(url) {
function normalizeArray (line 51547) | function normalizeArray(parts, allowAboveRoot) {
function trim (line 51655) | function trim(arr) {
function basename (line 51724) | function basename(path) {
function filter (line 51812) | function filter(xs, f) {
function defaultSetTimout (line 51848) | function defaultSetTimout() {
function defaultClearTimeout (line 51851) | function defaultClearTimeout() {
function runTimeout (line 51874) | function runTimeout(fun) {
function runClearTimeout (line 51900) | function runClearTimeout(marker) {
function cleanUpNextTick (line 51932) | function cleanUpNextTick() {
function drainQueue (line 51947) | function drainQueue() {
function Item (line 51985) | function Item(fun, array) {
function noop (line 51999) | function noop() {}
function normalizeName (line 52084) | function normalizeName(name) {
function normalizeValue (line 52094) | function normalizeValue(value) {
function iteratorFor (line 52102) | function iteratorFor(items) {
function Headers (line 52119) | function Headers(headers) {
function consumed (line 52197) | function consumed(body) {
function fileReaderReady (line 52204) | function fileReaderReady(reader) {
function readBlobAsArrayBuffer (line 52215) | function readBlobAsArrayBuffer(blob) {
function readBlobAsText (line 52222) | function readBlobAsText(blob) {
function readArrayBufferAsText (line 52229) | function readArrayBufferAsText(buf) {
function bufferClone (line 52239) | function bufferClone(buf) {
function Body (line 52249) | function Body() {
function normalizeMethod (line 52357) | function normalizeMethod(method) {
function Request (line 52362) | function Request(input, options) {
function decode (line 52403) | function decode(body) {
function parseHeaders (line 52419) | function parseHeaders(rawHeaders) {
function Response (line 52437) | function Response(bodyInit, options) {
function _interopRequireDefault (line 52550) | function _interopRequireDefault(obj) {
function _calculateColor (line 53265) | function _calculateColor(hsb) {
function _interopRequireDefault (line 53380) | function _interopRequireDefault(obj) {
function _descriptionText (line 53597) | function _descriptionText(text) {
function _elementName (line 53706) | function _elementName(name) {
function _interopRequireDefault (line 53854) | function _interopRequireDefault(obj) {
function _gridMap (line 53900) | function _gridMap(idT, ingredients) {
function _gridSummary (line 53955) | function _gridSummary(numShapes, background, width, height) {
function _gridShapeDetails (line 53971) | function _gridShapeDetails(idT, ingredients) {
function _interopRequireDefault (line 54036) | function _interopRequireDefault(obj) {
function _getMiddle (line 54454) | function _getMiddle(f, args) {
function _getPos (line 54482) | function _getPos(args, canvasWidth, canvasHeight) {
function _canvasLocator (line 54511) | function _canvasLocator(args, canvasWidth, canvasHeight) {
function _getArea (line 54529) | function _getArea(objectType, shapeArgs, canvasWidth, canvasHeight) {
function _interopRequireDefault (line 54608) | function _interopRequireDefault(obj) {
function _textSummary (line 54654) | function _textSummary(numShapes, background, width, height) {
function _shapeDetails (line 54668) | function _shapeDetails(idT, ingredients) {
function _shapeList (line 54702) | function _shapeList(idT, ingredients) {
function _interopRequireDefault (line 54832) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 54935) | function _interopRequireDefault(obj) {
function _typeof (line 55204) | function _typeof(obj) {
function _getRequireWildcardCache (line 55231) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 55239) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 55271) | function _interopRequireDefault(obj) {
function _typeof (line 55840) | function _typeof(obj) {
function _getRequireWildcardCache (line 55871) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 55879) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 55911) | function _interopRequireDefault(obj) {
function _typeof (line 56941) | function _typeof(obj) {
function _getRequireWildcardCache (line 56965) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 56973) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 57005) | function _interopRequireDefault(obj) {
function _typeof (line 58614) | function _typeof(obj) {
function _getRequireWildcardCache (line 58643) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 58651) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 58683) | function _interopRequireDefault(obj) {
function getWindowWidth (line 59138) | function getWindowWidth() {
function getWindowHeight (line 59147) | function getWindowHeight() {
function launchFullscreen (line 59310) | function launchFullscreen(element) {
function exitFullscreen (line 59330) | function exitFullscreen() {
function _interopRequireDefault (line 59556) | function _interopRequireDefault(obj) {
function _slicedToArray (line 59559) | function _slicedToArray(arr, i) {
function _nonIterableRest (line 59564) | function _nonIterableRest() {
function _iterableToArrayLimit (line 59567) | function _iterableToArrayLimit(arr, i) {
function _arrayWithHoles (line 59601) | function _arrayWithHoles(arr) {
function _typeof (line 59604) | function _typeof(obj) {
function _interopRequireDefault (line 60671) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 60830) | function _interopRequireDefault(obj) {
function ErrorStackParser (line 60853) | function ErrorStackParser() {
function _getRequireWildcardCache (line 61127) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 61135) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 61167) | function _interopRequireDefault(obj) {
function _classCallCheck (line 61170) | function _classCallCheck(instance, Constructor) {
function _inherits (line 61175) | function _inherits(subClass, superClass) {
function _createSuper (line 61184) | function _createSuper(Derived) {
function _possibleConstructorReturn (line 61208) | function _possibleConstructorReturn(self, call) {
function _assertThisInitialized (line 61214) | function _assertThisInitialized(self) {
function _wrapNativeSuper (line 61222) | function _wrapNativeSuper(Class) {
function isNativeReflectConstruct (line 61248) | function isNativeReflectConstruct() {
function _construct (line 61259) | function _construct(Parent, args, Class) {
function _isNativeFunction (line 61274) | function _isNativeFunction(fn) {
function _setPrototypeOf (line 61277) | function _setPrototypeOf(o, p) {
function _getPrototypeOf (line 61286) | function _getPrototypeOf(o) {
function _typeof (line 61294) | function _typeof(obj) {
function err (line 61784) | function err(message, func, type) {
function formatType (line 61808) | function formatType() {
function _typeof (line 62064) | function _typeof(obj) {
function _getRequireWildcardCache (line 62085) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 62093) | function _interopRequireWildcard(obj) {
function modeAdjust (line 62127) | function modeAdjust(a, b, c, d, mode) {
function _interopRequireDefault (line 62153) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 62247) | function _interopRequireDefault(obj) {
function _classCallCheck (line 62250) | function _classCallCheck(instance, Constructor) {
function _defineProperties (line 62255) | function _defineProperties(target, props) {
function _createClass (line 62264) | function _createClass(Constructor, protoProps, staticProps) {
function FetchResources (line 62305) | function FetchResources(services, options) {
function _interopRequireDefault (line 62496) | function _interopRequireDefault(obj) {
function _typeof (line 62529) | function _typeof(obj) {
function _getRequireWildcardCache (line 62563) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 62571) | function _interopRequireWildcard(obj) {
function _classCallCheck (line 62603) | function _classCallCheck(instance, Constructor) {
function _defineProperties (line 62608) | function _defineProperties(target, props) {
function _createClass (line 62617) | function _createClass(Constructor, protoProps, staticProps) {
function p5 (line 62646) | function p5(sketch, node, sync) {
function _interopRequireDefault (line 63468) | function _interopRequireDefault(obj) {
function _typeof (line 64306) | function _typeof(obj) {
function _getRequireWildcardCache (line 64330) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 64338) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 64370) | function _interopRequireDefault(obj) {
function _getRequireWildcardCache (line 64585) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 64593) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 64625) | function _interopRequireDefault(obj) {
function _typeof (line 64628) | function _typeof(obj) {
function calculateOffset (line 65058) | function calculateOffset(object) {
function _typeof (line 65096) | function _typeof(obj) {
function _getRequireWildcardCache (line 65128) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 65136) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 65168) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 66495) | function _interopRequireDefault(obj) {
function _getRequireWildcardCache (line 66706) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 66714) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 66746) | function _interopRequireDefault(obj) {
function _typeof (line 66749) | function _typeof(obj) {
function _typeof (line 67131) | function _typeof(obj) {
function _getRequireWildcardCache (line 67158) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 67166) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 67198) | function _interopRequireDefault(obj) {
function _typeof (line 67977) | function _typeof(obj) {
function _getRequireWildcardCache (line 67999) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 68007) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 68039) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 68409) | function _interopRequireDefault(obj) {
function _typeof (line 68968) | function _typeof(obj) {
function _getRequireWildcardCache (line 68991) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 68999) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 69031) | function _interopRequireDefault(obj) {
function _typeof (line 70162) | function _typeof(obj) {
function _interopRequireDefault (line 70323) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 70918) | function _interopRequireDefault(obj) {
function _toConsumableArray (line 70921) | function _toConsumableArray(arr) {
function _nonIterableSpread (line 70924) | function _nonIterableSpread() {
function _iterableToArray (line 70927) | function _iterableToArray(iter) {
function _arrayWithoutHoles (line 70934) | function _arrayWithoutHoles(arr) {
function _interopRequireDefault (line 71557) | function _interopRequireDefault(obj) {
function _toConsumableArray (line 71560) | function _toConsumableArray(arr) {
function _nonIterableSpread (line 71563) | function _nonIterableSpread() {
function _iterableToArray (line 71566) | function _iterableToArray(iter) {
function _arrayWithoutHoles (line 71573) | function _arrayWithoutHoles(arr) {
function _typeof (line 71581) | function _typeof(obj) {
function _interopRequireDefault (line 71859) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 72579) | function _interopRequireDefault(obj) {
function _typeof (line 72582) | function _typeof(obj) {
function addElement (line 72895) | function addElement(elt, pInst, media) {
function createMedia (line 73913) | function createMedia(pInst, type, src, callback) {
function _typeof (line 76461) | function _typeof(obj) {
function _getRequireWildcardCache (line 76483) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 76491) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 76523) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 77288) | function _interopRequireDefault(obj) {
function _typeof (line 77693) | function _typeof(obj) {
function _getRequireWildcardCache (line 77717) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 77725) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 77757) | function _interopRequireDefault(obj) {
function getMousePos (line 78197) | function getMousePos(canvas, w, h, evt) {
function _interopRequireDefault (line 78824) | function _interopRequireDefault(obj) {
function getTouchInfo (line 78877) | function getTouchInfo(canvas, w, h, e) {
function buildBlurKernel (line 79650) | function buildBlurKernel(r) {
function blurARGB (line 79685) | function blurARGB(canvas, radius) {
function _interopRequireDefault (line 79865) | function _interopRequireDefault(obj) {
function _toConsumableArray (line 79868) | function _toConsumableArray(arr) {
function _nonIterableSpread (line 79871) | function _nonIterableSpread() {
function _iterableToArray (line 79874) | function _iterableToArray(iter) {
function _arrayWithoutHoles (line 79881) | function _arrayWithoutHoles(arr) {
function _typeof (line 80500) | function _typeof(obj) {
function _getRequireWildcardCache (line 80561) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 80569) | function _interopRequireWildcard(obj) {
function _interopRequireDefault (line 80601) | function _interopRequireDefault(obj) {
function _createGif (line 80759) | function _createGif(
function _sAssign (line 80891) | function _sAssign(sVal, iVal) {
function _interopRequireDefault (line 81380) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 82605) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 83425) | function _interopRequireDefault(obj) {
function _typeof (line 83428) | function _typeof(obj) {
function makeObject (line 84007) | function makeObject(row, headers) {
function escapeHelper (line 85106) | function escapeHelper(content) {
function _checkFileExtension (line 85331) | function _checkFileExtension(filename, extension) {
function destroyClickedElement (line 85373) | function destroyClickedElement(event) {
function _interopRequireDefault (line 85452) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 86829) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 87202) | function _interopRequireDefault(obj) {
function elementsToP5XML (line 87505) | function elementsToP5XML(elements) {
function _interopRequireDefault (line 88210) | function _interopRequireDefault(obj) {
function hypot (line 89027) | function hypot(x, y, z) {
function _interopRequireDefault (line 89128) | function _interopRequireDefault(obj) {
function _interopRequireDefault (line 89183) | function _interopRequireDefault(obj) {
function _typeof (line 89492) | function _typeof(obj) {
function _getRequireWildcardCache (line 89524) | function _getRequireWildcardCache() {
function _interopRequireWildcard (line 89532)
Copy disabled (too large)
Download .json
Condensed preview — 1172 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (64,562K chars).
[
{
"path": "001_StarField/P5/Star.js",
"chars": 882,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/17WoOqgXsRM\n\nf"
},
{
"path": "001_StarField/P5/index.html",
"chars": 559,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>StarField_p5.js</title>\n <script type=\"text/jav"
},
{
"path": "001_StarField/P5/sketch.js",
"chars": 465,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/17WoOqgXsRM\n\nl"
},
{
"path": "001_StarField/Processing/CC_001_StarField/CC_001_StarField.pde",
"chars": 1070,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/17WoOqgXsRM\n\n/"
},
{
"path": "001_StarField/Processing/CC_001_StarField/Star.pde",
"chars": 3276,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/17WoOqgXsRM\n\n/"
},
{
"path": "002_MengerSponge/P5/box.js",
"chars": 860,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for this video: https://youtu.be/LG8"
},
{
"path": "002_MengerSponge/P5/index.html",
"chars": 560,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>MengerSponge_p5.js</title>\n <script type=\"text/"
},
{
"path": "002_MengerSponge/P5/sketch.js",
"chars": 879,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for this video: https://youtu.be/LG8"
},
{
"path": "002_MengerSponge/Processing/CC_002_MengerSponge/Box.pde",
"chars": 851,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for this video: https://youtu.be/LG8"
},
{
"path": "002_MengerSponge/Processing/CC_002_MengerSponge/CC_002_MengerSponge.pde",
"chars": 802,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for this video: https://youtu.be/LG8"
},
{
"path": "003_Snake_game/P5/index.html",
"chars": 471,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>Snake Game</title>\n <script type=\"text/javascri"
},
{
"path": "003_Snake_game/P5/sketch.js",
"chars": 900,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/AaGK-fj-BAM\n\nl"
},
{
"path": "003_Snake_game/P5/snake.js",
"chars": 1384,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/AaGK-fj-BAM\n\nf"
},
{
"path": "003_Snake_game/Processing/CC_003_Snake_game/CC_003_Snake_game.pde",
"chars": 839,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/AaGK-fj-BAM\n\nS"
},
{
"path": "003_Snake_game/Processing/CC_003_Snake_game/Snake.pde",
"chars": 1238,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/AaGK-fj-BAM\n\nc"
},
{
"path": "004_PurpleRain/P5/drop.js",
"chars": 749,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/KkyIDI6rQJI\n\nf"
},
{
"path": "004_PurpleRain/P5/index.html",
"chars": 471,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>Purple Rain</title>\n <script type=\"text/javascr"
},
{
"path": "004_PurpleRain/P5/sketch.js",
"chars": 454,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/KkyIDI6rQJI\n\n/"
},
{
"path": "004_PurpleRain/Processing/CC_004_PurpleRain/CC_004_PurpleRain.pde",
"chars": 627,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/KkyIDI6rQJI\n\n/"
},
{
"path": "004_PurpleRain/Processing/CC_004_PurpleRain/Drop.pde",
"chars": 1847,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/KkyIDI6rQJI\n//"
},
{
"path": "005_Space_invaders/P5/drop.js",
"chars": 641,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/biN3v3ef-Y0\n\nf"
},
{
"path": "005_Space_invaders/P5/flower.js",
"chars": 541,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/biN3v3ef-Y0\n\nf"
},
{
"path": "005_Space_invaders/P5/index.html",
"chars": 594,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>Space Invaders</title>\n <script type=\"text/java"
},
{
"path": "005_Space_invaders/P5/ship.js",
"chars": 411,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/biN3v3ef-Y0\n\nf"
},
{
"path": "005_Space_invaders/P5/sketch.js",
"chars": 1386,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/biN3v3ef-Y0\n\nv"
},
{
"path": "005_Space_invaders/Processing/CC_005_Space_invaders/CC_005_Space_invaders.pde",
"chars": 1378,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/biN3v3ef-Y0\n\nS"
},
{
"path": "005_Space_invaders/Processing/CC_005_Space_invaders/Drop.pde",
"chars": 669,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/biN3v3ef-Y0\n\nc"
},
{
"path": "005_Space_invaders/Processing/CC_005_Space_invaders/Flower.pde",
"chars": 545,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/biN3v3ef-Y0\n\nc"
},
{
"path": "005_Space_invaders/Processing/CC_005_Space_invaders/Ship.pde",
"chars": 404,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/biN3v3ef-Y0\n\nc"
},
{
"path": "006_Mitosis/P5/cell.js",
"chars": 886,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/jxGS3fKPKJA\n\nf"
},
{
"path": "006_Mitosis/P5/index.html",
"chars": 467,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>Mitosis</title>\n <script type=\"text/javascript\""
},
{
"path": "006_Mitosis/P5/sketch.js",
"chars": 597,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/jxGS3fKPKJA\n\nv"
},
{
"path": "006_Mitosis/Processing/CC_006_Mitosis/CC_006_Mitosis.pde",
"chars": 568,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/jxGS3fKPKJA\n\nA"
},
{
"path": "006_Mitosis/Processing/CC_006_Mitosis/Cell.pde",
"chars": 890,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/jxGS3fKPKJA\n\nc"
},
{
"path": "007_SolarSystemGenerator/P5/index.html",
"chars": 484,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>Solar System Generator</title>\n <script type=\"t"
},
{
"path": "007_SolarSystemGenerator/P5/planet.js",
"chars": 953,
"preview": "class Planet {\n constructor(radius, distance, orbitspeed, angle) {\n this.radius = radius;\n this.distance = distan"
},
{
"path": "007_SolarSystemGenerator/P5/sketch.js",
"chars": 287,
"preview": "// port of Daniel Shiffman's pde SolarSystemGenerator by madacoo\n\nfunction setup() {\n createCanvas(600, 600);\n sun = n"
},
{
"path": "007_SolarSystemGenerator/Processing/CC_007_SolarSystemGenerator/CC_007_SolarSystemGenerator.pde",
"chars": 316,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/l8SiJ-RmeHU\n\nP"
},
{
"path": "007_SolarSystemGenerator/Processing/CC_007_SolarSystemGenerator/Planet.pde",
"chars": 1216,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/l8SiJ-RmeHU\n\nc"
},
{
"path": "008_SolarSystemGenerator3D/P5/Planet.js",
"chars": 1765,
"preview": "// Solar System in Processing - Part 2 (3D)\n// The Coding Train / Daniel Shiffman\n// https://thecodingtrain.com/CodingCh"
},
{
"path": "008_SolarSystemGenerator3D/P5/index.html",
"chars": 419,
"preview": "<!DOCTYPE html>\n<html>\n\n<head>\n <meta charset=\"utf-8\" />\n\n <title>Solar System Generator - Part 2 (3D) - Coding Challe"
},
{
"path": "008_SolarSystemGenerator3D/P5/sketch.js",
"chars": 830,
"preview": "// Solar System in Processing - Part 2 (3D)\n// The Coding Train / Daniel Shiffman\n// https://thecodingtrain.com/CodingCh"
},
{
"path": "008_SolarSystemGenerator3D/Processing/CC_008_SolarSystemGenerator3D/CC_008_SolarSystemGenerator3D.pde",
"chars": 365,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/dncudkelNxw\n\ni"
},
{
"path": "008_SolarSystemGenerator3D/Processing/CC_008_SolarSystemGenerator3D/Planet.pde",
"chars": 1572,
"preview": "// Solar System in Processing - Part 2 (3D)\n// The Coding Train / Daniel Shiffman\n// https://thecodingtrain.com/CodingCh"
},
{
"path": "009_SolarSystemGenerator3D_texture/P5/Planet.js",
"chars": 2120,
"preview": "// Solar System in Processing - Part 3 (3D textures)\n// The Coding Train / Daniel Shiffman\n// https://thecodingtrain.com"
},
{
"path": "009_SolarSystemGenerator3D_texture/P5/index.html",
"chars": 428,
"preview": "<!DOCTYPE html>\n<html>\n\n<head>\n <meta charset=\"utf-8\" />\n\n <title>Solar System Generator - Part 3 (3D textures) - Codi"
},
{
"path": "009_SolarSystemGenerator3D_texture/P5/sketch.js",
"chars": 1910,
"preview": "// Solar System in Processing - Part 3 (3D textures)\n// The Coding Train / Daniel Shiffman\n// https://thecodingtrain.com"
},
{
"path": "009_SolarSystemGenerator3D_texture/Processing/CC_009_SolarSystemGenerator3D_texture/CC_009_SolarSystemGenerator3D_texture.pde",
"chars": 645,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/FGAwi7wpU8c\n\ni"
},
{
"path": "009_SolarSystemGenerator3D_texture/Processing/CC_009_SolarSystemGenerator3D_texture/Planet.pde",
"chars": 1711,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/FGAwi7wpU8c\n\nc"
},
{
"path": "010_Maze_DFS/P5/cell.js",
"chars": 1692,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n\n// Videos\n// https://youtu.be/HyK_Q5rrcr4\n/"
},
{
"path": "010_Maze_DFS/P5/index.html",
"chars": 561,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>maze_challenge</title>\n <script type=\"text/java"
},
{
"path": "010_Maze_DFS/P5/sketch.js",
"chars": 1572,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n\n// Videos\n// https://youtu.be/HyK_Q5rrcr4\n/"
},
{
"path": "010_Maze_DFS/Processing/CC_010_Maze_DFS/CC_010_Maze_DFS.pde",
"chars": 1673,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n\n// Videos\n// https://youtu.be/HyK_Q5rrcr4\n/"
},
{
"path": "010_Maze_DFS/Processing/CC_010_Maze_DFS/cell.pde",
"chars": 1790,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n\n// Videos\n// https://youtu.be/HyK_Q5rrcr4\n/"
},
{
"path": "011_PerlinNoiseTerrain/P5/index.html",
"chars": 412,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>Purple Rain</title>\n <script type=\"text/javascr"
},
{
"path": "011_PerlinNoiseTerrain/P5/sketch.js",
"chars": 1111,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/IKB1hWWedMk\n\n/"
},
{
"path": "011_PerlinNoiseTerrain/Processing/CC_011_PerlinNoiseTerrain/CC_011_PerlinNoiseTerrain.pde",
"chars": 975,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/IKB1hWWedMk\n\ni"
},
{
"path": "012_LorenzAttractor/P5/index.html",
"chars": 654,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n\t<meta charset=\"UTF-8\">\n\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n\t<meta name"
},
{
"path": "012_LorenzAttractor/P5/sketch.js",
"chars": 979,
"preview": "let x = 0.01;\nlet y = 0;\nlet z = 0;\n\nlet a = 10;\nlet b = 28;\nlet c = 8.0 / 3.0;\n\nlet points = new Array();\n\nfunction set"
},
{
"path": "012_LorenzAttractor/Processing/CC_012_LorenzAttractor/CC_012_LorenzAttractor.pde",
"chars": 1026,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for this video: https://youtu.be/f0l"
},
{
"path": "013_ReactionDiffusion/P5/index.html",
"chars": 621,
"preview": "<html>\n<head>\n <meta charset=\"UTF-8\">\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsdelivr."
},
{
"path": "013_ReactionDiffusion/P5/sketch.js",
"chars": 2555,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for this video: https://youtu.be/BV9"
},
{
"path": "013_ReactionDiffusion/Processing/CC_013_ReactionDiffusion/CC_013_ReactionDiffusion.pde",
"chars": 2826,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for this video: https://youtu.be/BV9"
},
{
"path": "014_FractalTree/P5/index.html",
"chars": 615,
"preview": "<html>\n<head>\n <meta charset=\"UTF-8\">\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsdelivr."
},
{
"path": "014_FractalTree/P5/sketch.js",
"chars": 711,
"preview": "// Fractal Tree\n// The Coding Train / Daniel Shiffman\n// https://thecodingtrain.com/challenges/14-fractal-trees-recursiv"
},
{
"path": "014_FractalTree/Processing/CC_014_FractalTree/CC_014_FractalTree.pde",
"chars": 708,
"preview": "// Coding Train\n// Ported to processing by Max (https://github.com/TheLastDestroyer)\n// Origional JS by Daniel Shiffman\n"
},
{
"path": "015_FractalTreeArray/P5/branch.js",
"chars": 778,
"preview": "function Branch(begin, end) {\n this.begin = begin;\n this.end = end;\n this.finished = false;\n\n this.jitter = function"
},
{
"path": "015_FractalTreeArray/P5/index.html",
"chars": 696,
"preview": "<html>\n<head>\n <meta charset=\"UTF-8\">\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsdelivr."
},
{
"path": "015_FractalTreeArray/P5/sketch.js",
"chars": 1061,
"preview": "// Coding Rainbow\n// Daniel Shiffman\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/fcdNSZ9IzJM\n\nvar tr"
},
{
"path": "015_FractalTreeArray/Processing/CC_015_FractalTreeArray/Branch.pde",
"chars": 1236,
"preview": "/**\n* representing a Branch of the FractalTree\n* @author Lukas Klassen\n*/\nclass Branch{\n \n /**\n * Start and end Point"
},
{
"path": "015_FractalTreeArray/Processing/CC_015_FractalTreeArray/CC_015_FractalTreeArray.pde",
"chars": 1775,
"preview": "/**\n* makes a FractalTree using Array(Lists)\n* adds one Level per MouseClick\n* at Level 6 Leaves will fall down\n* @autho"
},
{
"path": "016_LSystem/P5/index.html",
"chars": 566,
"preview": "<html>\n<head>\n <meta charset=\"UTF-8\">\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsdelivr."
},
{
"path": "016_LSystem/P5/sketch.js",
"chars": 1444,
"preview": "// Coding Rainbow\n// Daniel Shiffman\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/E1B4UoSQMFw\n\n// var"
},
{
"path": "016_LSystem/Processing/CC_016_LSystem/CC_016_LSystem.pde",
"chars": 1658,
"preview": "// Coding Train\n// Ported to processing by Max (https://github.com/TheLastDestroyer)\n// Origional JS by Daniel Shiffman\n"
},
{
"path": "017_SpaceColonizer/P5/branch.js",
"chars": 755,
"preview": "// Coding Rainbow\n// Daniel Shiffman\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/kKT0v3qhIQY\n\nfuncti"
},
{
"path": "017_SpaceColonizer/P5/index.html",
"chars": 517,
"preview": "<html>\n<head>\n <meta charset=\"UTF-8\">\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsdelivr."
},
{
"path": "017_SpaceColonizer/P5/leaf.js",
"chars": 329,
"preview": "// Coding Rainbow\n// Daniel Shiffman\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/kKT0v3qhIQY\n\nfuncti"
},
{
"path": "017_SpaceColonizer/P5/sketch.js",
"chars": 301,
"preview": "// Coding Rainbow\n// Daniel Shiffman\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/kKT0v3qhIQY\n\nvar tr"
},
{
"path": "017_SpaceColonizer/P5/tree.js",
"chars": 2111,
"preview": "// Coding Rainbow\n// Daniel Shiffman\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/kKT0v3qhIQY\n\nfuncti"
},
{
"path": "017_SpaceColonizer/Processing/CC_017_SpaceColonizer/Branch.pde",
"chars": 660,
"preview": "// Coding Rainbow\n// Daniel Shiffman\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/kKT0v3qhIQY\n\nclass "
},
{
"path": "017_SpaceColonizer/Processing/CC_017_SpaceColonizer/CC_017_SpaceColonizer.pde",
"chars": 290,
"preview": "// Coding Rainbow\n// Daniel Shiffman\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/kKT0v3qhIQY\n\nTree t"
},
{
"path": "017_SpaceColonizer/Processing/CC_017_SpaceColonizer/Leaf.pde",
"chars": 493,
"preview": "// Coding Rainbow\n// Daniel Shiffman\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/kKT0v3qhIQY\n\nclass "
},
{
"path": "017_SpaceColonizer/Processing/CC_017_SpaceColonizer/Tree.pde",
"chars": 2073,
"preview": "// Coding Rainbow\n// Daniel Shiffman\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/kKT0v3qhIQY\n\nclass "
},
{
"path": "018_SpaceColonizer3D/Processing/CC_018_SpaceColonizer3D/Branch.pde",
"chars": 661,
"preview": "// Coding Rainbow\n// Daniel Shiffman\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/JcopTKXt8L8\n\nclass "
},
{
"path": "018_SpaceColonizer3D/Processing/CC_018_SpaceColonizer3D/CC_018_SpaceColonizer3D.pde",
"chars": 359,
"preview": "// Coding Rainbow\n// Daniel Shiffman\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/JcopTKXt8L8\n\nimport"
},
{
"path": "018_SpaceColonizer3D/Processing/CC_018_SpaceColonizer3D/Leaf.pde",
"chars": 479,
"preview": "// Coding Rainbow\n// Daniel Shiffman\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/JcopTKXt8L8\n\n\nclass"
},
{
"path": "018_SpaceColonizer3D/Processing/CC_018_SpaceColonizer3D/Tree.pde",
"chars": 2356,
"preview": "// Coding Rainbow\n// Daniel Shiffman\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/JcopTKXt8L8\n\nclass "
},
{
"path": "019_Superellipse/P5/index.html",
"chars": 367,
"preview": "<!DOCTYPE html>\n<html>\n\n<head>\n <meta charset=\"UTF-8\" />\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n <m"
},
{
"path": "019_Superellipse/P5/sketch.js",
"chars": 896,
"preview": "// Superellipse\n// Daniel Shiffman\n// https://thecodingtrain.com/CodingChallenges/019-superellipse.html\n// https://youtu"
},
{
"path": "019_Superellipse/Processing/CC_019_Superellipse/CC_019_Superellipse.pde",
"chars": 1007,
"preview": "// Superellipse\n// Daniel Shiffman\n// https://thecodingtrain.com/CodingChallenges/019-superellipse.html\n// https://youtu"
},
{
"path": "019_Superellipse/Processing/CC_019_Superellipse/Slider.pde",
"chars": 1676,
"preview": "// Chuck England\n// Written for Processing:\n// Daniel Shiffman\n// http://youtube.com/thecodingtrain\n// http://codi"
},
{
"path": "020_ClothSimulation/P5/index.html",
"chars": 571,
"preview": "<!DOCTYPE html>\n<html>\n\n<head>\n <script src=\"https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.min.js\"></script>\n \n <meta "
},
{
"path": "020_ClothSimulation/P5/particle.js",
"chars": 378,
"preview": "// 2D Cloth with toxiclibs\n// The Coding Train / Daniel Shiffman\n// https://thecodingtrain.com/CodingChallenges/020-clot"
},
{
"path": "020_ClothSimulation/P5/sketch.js",
"chars": 1645,
"preview": "// 2D Cloth with toxiclibs\n// The Coding Train / Daniel Shiffman\n// https://thecodingtrain.com/CodingChallenges/020-clot"
},
{
"path": "020_ClothSimulation/P5/spring.js",
"chars": 416,
"preview": "// 2D Cloth with toxiclibs\n// The Coding Train / Daniel Shiffman\n// https://thecodingtrain.com/CodingChallenges/020-clot"
},
{
"path": "020_ClothSimulation/P5/style.css",
"chars": 147,
"preview": "html, body {\n margin: 0;\n padding: 0;\n}\n\ninput {\n font-size: 32pt;\n}\n\np {\n font-size: 32pt;\n color: #E51310;\n}\n\n\nca"
},
{
"path": "020_ClothSimulation/P5/toxiclibs/toxichelper.js",
"chars": 586,
"preview": "// The Nature of Code\n// Daniel Shiffman\n// http://natureofcode.com\n\n// Making it easier to use all these classes\n// May"
},
{
"path": "020_ClothSimulation/P5/toxiclibs/toxiclibs.js",
"chars": 633987,
"preview": "/*!\n * toxiclibsjs - v0.3.3\n * http://haptic-data.com/toxiclibsjs\n * Created by [Kyle Phillips](http://haptic-data.com),"
},
{
"path": "020_ClothSimulation/Processing/CC_020_Cloth2D/CC_020_Cloth2D.pde",
"chars": 1602,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/jrk_lOg_pVA\n\ni"
},
{
"path": "020_ClothSimulation/Processing/CC_020_Cloth2D/Particle.pde",
"chars": 281,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/jrk_lOg_pVA\n\nc"
},
{
"path": "020_ClothSimulation/Processing/CC_020_Cloth2D/Spring.pde",
"chars": 316,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/jrk_lOg_pVA\n\nc"
},
{
"path": "020_ClothSimulation/Processing/CC_020_Cloth3D/Processing/CC_020_Cloth3D/CC_020_Cloth3D.pde",
"chars": 1694,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/jrk_lOg_pVA\n\ni"
},
{
"path": "020_ClothSimulation/Processing/CC_020_Cloth3D/Processing/CC_020_Cloth3D/Particle.pde",
"chars": 354,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/jrk_lOg_pVA\n\nc"
},
{
"path": "020_ClothSimulation/Processing/CC_020_Cloth3D/Processing/CC_020_Cloth3D/Spring.pde",
"chars": 328,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/jrk_lOg_pVA\n\nc"
},
{
"path": "021_Mandelbrot/P5/index.html",
"chars": 566,
"preview": "<html>\n<head>\n <meta charset=\"UTF-8\">\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsdelivr."
},
{
"path": "021_Mandelbrot/P5/sketch.js",
"chars": 1331,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/6z7GQewK-Ks\n\nv"
},
{
"path": "021_Mandelbrot/Processing/CC_021_Mandelbrot/CC_021_Mandelbrot.pde",
"chars": 2064,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/6z7GQewK-Ks\n\nv"
},
{
"path": "022_JuliaSet/P5/index.html",
"chars": 257,
"preview": "<!DOCTYPE html>\n<html>\n\n<head>\n <meta charset=\"utf-8\" />\n\n <title>Julia Set - Coding Challenge #22</title>\n\n <script "
},
{
"path": "022_JuliaSet/P5/sketch.js",
"chars": 4418,
"preview": "// Julia Set\n// The Coding Train / Daniel Shiffman\n// https://thecodingtrain.com/CodingChallenges/022-juliaset.html\n// h"
},
{
"path": "022_JuliaSet/Processing/CC_022_JuliaSet/CC_022_JuliaSet.pde",
"chars": 2439,
"preview": "// Julia Set\n// The Coding Train / Daniel Shiffman\n// https://thecodingtrain.com/CodingChallenges/022-juliaset.html\n// h"
},
{
"path": "023_SuperShape2D/P5/index.html",
"chars": 415,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>Superellipse</title>\n <script type=\"text/javasc"
},
{
"path": "023_SuperShape2D/P5/sketch.js",
"chars": 1103,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/ksRoh-10lak\n\nv"
},
{
"path": "023_SuperShape2D/Processing/CC_023_SuperShape2D/CC_023_SuperShape2D.pde",
"chars": 1196,
"preview": "// Coding Train\n// http://thecodingtrain.com\n// http://patreon.com/codingtrain\n\n// Code for: https://youtu.be/ksRoh-10la"
},
{
"path": "024_PerlinNoiseFlowField/P5/index.html",
"chars": 474,
"preview": "<html>\n<head>\n <meta charset=\"UTF-8\">\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsdelivr."
},
{
"path": "024_PerlinNoiseFlowField/P5/particle.js",
"chars": 1483,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/BjoM9oKOAKY\n\nf"
},
{
"path": "024_PerlinNoiseFlowField/P5/sketch.js",
"chars": 1252,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/BjoM9oKOAKY\n\nv"
},
{
"path": "024_PerlinNoiseFlowField/Processing/CC_024_PerlinNoiseFlowField/CC_024_PerlinNoiseFlowField.pde",
"chars": 708,
"preview": "// Daniel Shiffman\n// http://youtube.com/thecodingtrain\n// http://codingtra.in\n//\n// Coding Challenge #24: Perlin Noise "
},
{
"path": "024_PerlinNoiseFlowField/Processing/CC_024_PerlinNoiseFlowField/Particle.pde",
"chars": 1504,
"preview": "// Daniel Shiffman\n// http://youtube.com/thecodingtrain\n// http://codingtra.in\n//\n// Coding Challenge #24: Perlin Noise "
},
{
"path": "024_PerlinNoiseFlowField/Processing/CC_024_PerlinNoiseFlowField/flowfield.pde",
"chars": 1236,
"preview": "// Daniel Shiffman\n// http://youtube.com/thecodingtrain\n// http://codingtra.in\n//\n// Coding Challenge #24: Perlin Noise "
},
{
"path": "025_SphereGeometry/P5/index.html",
"chars": 397,
"preview": "<!DOCTYPE html>\n<html lang=\"\">\n\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, ini"
},
{
"path": "025_SphereGeometry/P5/sketch.js",
"chars": 1140,
"preview": "// Spherical Geometry\n// The Coding Train / Daniel Shiffman\n// https://thecodingtrain.com/CodingChallenges/025-spheregeo"
},
{
"path": "025_SphereGeometry/Processing/CC_025_SphereGeometry/CC_025_SphereGeometry.pde",
"chars": 1166,
"preview": "// Spherical Geometry\n// The Coding Train / Daniel Shiffman\n// https://thecodingtrain.com/CodingChallenges/025-spheregeo"
},
{
"path": "026_SuperShape3D/Processing/CC_026_SuperShape3D/CC_026_SuperShape3D.pde",
"chars": 1782,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/akM4wMZIBWg\n\ni"
},
{
"path": "027_FireWorks/P5/firework.js",
"chars": 1321,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/CKeyIbT3vXI\n\nf"
},
{
"path": "027_FireWorks/P5/index.html",
"chars": 556,
"preview": "<html>\n<head>\n <meta charset=\"UTF-8\">\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsdelivr."
},
{
"path": "027_FireWorks/P5/particle.js",
"chars": 1092,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/CKeyIbT3vXI\n\nf"
},
{
"path": "027_FireWorks/P5/sketch.js",
"chars": 613,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/CKeyIbT3vXI\n\nv"
},
{
"path": "027_FireWorks/Processing/CC_027_FireWorks_2D/CC_027_FireWorks_2D.pde",
"chars": 610,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: \n\nArrayList<Firework> fireworks"
},
{
"path": "027_FireWorks/Processing/CC_027_FireWorks_2D/Particle.pde",
"chars": 1497,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for:\n\nclass Particle {\n PVector loc"
},
{
"path": "027_FireWorks/Processing/CC_027_FireWorks_2D/ParticleSystem.pde",
"chars": 1401,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: \n\n// A class to describe a grou"
},
{
"path": "027_FireWorks/Processing/CC_027_FireWorks_3D/CC_027_FireWorks_3D.pde",
"chars": 945,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/CKeyIbT3vXI\n\ni"
},
{
"path": "027_FireWorks/Processing/CC_027_FireWorks_3D/Particle.pde",
"chars": 1579,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: \n\nclass Particle {\n PVector lo"
},
{
"path": "027_FireWorks/Processing/CC_027_FireWorks_3D/ParticleSystem.pde",
"chars": 1434,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: \n\n// A class to describe a grou"
},
{
"path": "028_MetaBalls/P5/blob.js",
"chars": 626,
"preview": "// Basile Pesin\n// http://vertmo.github.io\n\n// MetaBalls : p5.js implementation\n\nclass Blob {\n constructor(x, y) {\n "
},
{
"path": "028_MetaBalls/P5/index.html",
"chars": 474,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"UTF-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <"
},
{
"path": "028_MetaBalls/P5/sketch.js",
"chars": 737,
"preview": "// Basile Pesin\n// http://vertmo.github.io\n\n// MetaBalls : p5.js implementation\n\nvar blobs = [];\n\nfunction setup() {\n c"
},
{
"path": "028_MetaBalls/Processing/CC_028_MetaBalls/Blob.pde",
"chars": 596,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/ccYLb7cLB1I\n\nc"
},
{
"path": "028_MetaBalls/Processing/CC_028_MetaBalls/CC_028_MetaBalls.pde",
"chars": 734,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/ccYLb7cLB1I\n\nB"
},
{
"path": "029_SmartRockets/P5/dna.js",
"chars": 1469,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/bGz7mv2vD6g\n\nf"
},
{
"path": "029_SmartRockets/P5/index.html",
"chars": 741,
"preview": "<html>\n<head>\n <title>Nature of Code Example 9.3: Smart Rockets </title>\n <script language=\"javascript\" type=\"text/jav"
},
{
"path": "029_SmartRockets/P5/population.js",
"chars": 2096,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/bGz7mv2vD6g\n\nf"
},
{
"path": "029_SmartRockets/P5/rocket.js",
"chars": 2772,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/bGz7mv2vD6g\n\n/"
},
{
"path": "029_SmartRockets/P5/sketch.js",
"chars": 990,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/bGz7mv2vD6g\n\nv"
},
{
"path": "029_SmartRockets/Processing/CC_029_SmartRockets/CC_029_SmartRockets.pde",
"chars": 1461,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/bGz7mv2vD6g\n//"
},
{
"path": "029_SmartRockets/Processing/CC_029_SmartRockets/Dna.pde",
"chars": 1065,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/bGz7mv2vD6g\n//"
},
{
"path": "029_SmartRockets/Processing/CC_029_SmartRockets/Population.pde",
"chars": 1592,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/bGz7mv2vD6g\n//"
},
{
"path": "029_SmartRockets/Processing/CC_029_SmartRockets/Rocket.pde",
"chars": 2114,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/bGz7mv2vD6g\n//"
},
{
"path": "030_Phyllotaxis/P5/index.html",
"chars": 278,
"preview": "<html>\n<head>\n <meta charset=\"UTF-8\">\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsdelivr."
},
{
"path": "030_Phyllotaxis/P5/sketch.js",
"chars": 645,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/KWoJgHFYWxY\n\nv"
},
{
"path": "030_Phyllotaxis/Processing/CC_030_Phyllotaxis/CC_030_Phyllotaxis.pde",
"chars": 682,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/KWoJgHFYWxY\n\nf"
},
{
"path": "031_FlappyBird/P5/bird.js",
"chars": 671,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/cXgA1d_E-jY&\n\n"
},
{
"path": "031_FlappyBird/P5/index.html",
"chars": 437,
"preview": "<html>\n<head>\n <meta charset=\"UTF-8\">\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsdelivr."
},
{
"path": "031_FlappyBird/P5/pipe.js",
"chars": 999,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/cXgA1d_E-jY&\n\n"
},
{
"path": "031_FlappyBird/P5/sketch.js",
"chars": 695,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/cXgA1d_E-jY&\n\n"
},
{
"path": "031_FlappyBird/Processing/CC_031_FlappyBird/Bird.pde",
"chars": 645,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/cXgA1d_E-jY\n\nc"
},
{
"path": "031_FlappyBird/Processing/CC_031_FlappyBird/CC_031_FlappyBird.pde",
"chars": 1014,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/cXgA1d_E-jY\n\nB"
},
{
"path": "031_FlappyBird/Processing/CC_031_FlappyBird/Pipe.pde",
"chars": 739,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/cXgA1d_E-jY\n\nc"
},
{
"path": "032.1_agar.io/P5/blob.js",
"chars": 822,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/JXuxYMGe4KI\n\nf"
},
{
"path": "032.1_agar.io/P5/index.html",
"chars": 358,
"preview": "<html>\n<head>\n <meta charset=\"UTF-8\">\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsdelivr."
},
{
"path": "032.1_agar.io/P5/sketch.js",
"chars": 745,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/JXuxYMGe4KI\n\nv"
},
{
"path": "032.1_agar.io/Processing/CC_032_agar.io/Blob.pde",
"chars": 842,
"preview": "// Coding Train\n// http://thecodingtrain.com\n// http://patreon.com/codingtrain\n\n// Code for: https://youtu.be/JXuxYMGe4K"
},
{
"path": "032.1_agar.io/Processing/CC_032_agar.io/CC_032_agar.io.pde",
"chars": 844,
"preview": "// Coding Train\n// http://thecodingtrain.com\n// http://patreon.com/codingtrain\n\n// Code for: https://youtu.be/JXuxYMGe4K"
},
{
"path": "032.2_agar.io_sockets/Node/package.json",
"chars": 352,
"preview": "{\n \"name\": \"sockets_p5\",\n \"version\": \"1.0.0\",\n \"description\": \"This is an example for how to use sockets with p5.js.\""
},
{
"path": "032.2_agar.io_sockets/Node/public/blob.js",
"chars": 1031,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/ZjVyKXp9hec\n\nf"
},
{
"path": "032.2_agar.io_sockets/Node/public/index.html",
"chars": 448,
"preview": "<html>\n<head>\n <meta charset=\"UTF-8\">\n <script type=\"text/javascript\" src=\"https://cdn.socket.io/socket.io-1.4.5.js\"><"
},
{
"path": "032.2_agar.io_sockets/Node/public/sketch.js",
"chars": 1575,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/ZjVyKXp9hec\n\n/"
},
{
"path": "032.2_agar.io_sockets/Node/server.js",
"chars": 1985,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/ZjVyKXp9hec\n\n/"
},
{
"path": "033_poisson_disc/P5/index.html",
"chars": 278,
"preview": "<html>\n<head>\n <meta charset=\"UTF-8\">\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsdelivr."
},
{
"path": "033_poisson_disc/P5/sketch.js",
"chars": 2411,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for this video: https://youtu.be/flQ"
},
{
"path": "033_poisson_disc/Processing/CC_033_poisson_disc/CC_033_poisson_disc.pde",
"chars": 2622,
"preview": "// Coding Train\n// http://thecodingtrain.com\n\n// Poisson Disc Sampling: https://youtu.be/flQgnCUxHl\n// Processing port b"
},
{
"path": "034_DLA/P5/index.html",
"chars": 359,
"preview": "<html>\n<head>\n <meta charset=\"UTF-8\">\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsdelivr."
},
{
"path": "034_DLA/P5/sketch.js",
"chars": 1219,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for this video: https://youtu.be/Cl_"
},
{
"path": "034_DLA/P5/walker.js",
"chars": 1762,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for this video: https://youtu.be/Cl_"
},
{
"path": "034_DLA/Processing/CC_034_DLA/CC_034_DLA.pde",
"chars": 1386,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for this video: https://youtu.be/Cl_"
},
{
"path": "034_DLA/Processing/CC_034_DLA/Walker.pde",
"chars": 1740,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for this video: https://youtu.be/Cl_"
},
{
"path": "035.1_TSP/P5/index.html",
"chars": 278,
"preview": "<html>\n<head>\n <meta charset=\"UTF-8\">\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsdelivr."
},
{
"path": "035.1_TSP/P5/sketch.js",
"chars": 1540,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for this video: https://youtu.be/BAe"
},
{
"path": "035.1_TSP/Processing/CC_035_1_TSP/CC_035_1_TSP.pde",
"chars": 1638,
"preview": "// Coding Train\n// Ported to processing by Max (https://github.com/TheLastDestroyer)\n// Origional JS by Daniel Shiffman\n"
},
{
"path": "035.2_LexicographicOrder/P5/index.html",
"chars": 278,
"preview": "<html>\n<head>\n <meta charset=\"UTF-8\">\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsdelivr."
},
{
"path": "035.2_LexicographicOrder/P5/sketch.js",
"chars": 1180,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for this video: https://youtu.be/goU"
},
{
"path": "035.2_LexicographicOrder/Processing/CC_035_2_LexicographicOrder/CC_035_2_LexicographicOrder.pde",
"chars": 1359,
"preview": "// Coding Train\n// Ported to processing by Max (https://github.com/TheLastDestroyer)\n// Origional JS by Daniel Shiffman\n"
},
{
"path": "035.3_TSP_Lexical/P5/index.html",
"chars": 278,
"preview": "<html>\n<head>\n <meta charset=\"UTF-8\">\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsdelivr."
},
{
"path": "035.3_TSP_Lexical/P5/sketch.js",
"chars": 2855,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for this video: https://youtu.be/9Xy"
},
{
"path": "035.3_TSP_Lexical/Processing/CC_035_3_TSP_Lexical/CC_035_3_TSP_Lexical.pde",
"chars": 3214,
"preview": "// Coding Train\n// Ported to processing by Max (https://github.com/TheLastDestroyer)\n// Origional JS by Daniel Shiffman\n"
},
{
"path": "035.4_TSP_GA/P5/ga.js",
"chars": 2300,
"preview": "// Daniel Shiffman\n// The Coding Train\n// Traveling Salesperson with Genetic Algorithm\n\n// https://thecodingtrain.com/Co"
},
{
"path": "035.4_TSP_GA/P5/index.html",
"chars": 355,
"preview": "<html>\n<head>\n <meta charset=\"UTF-8\">\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsdelivr."
},
{
"path": "035.4_TSP_GA/P5/sketch.js",
"chars": 2078,
"preview": "// Daniel Shiffman\n// The Coding Train\n// Traveling Salesperson with Genetic Algorithm\n\n// https://thecodingtrain.com/Co"
},
{
"path": "035.4_TSP_GA/Processing/CC_035_4_TSP_GA/CC_035_4_TSP_GA.pde",
"chars": 2172,
"preview": "// Coding Train\n// Ported to processing by Max (https://github.com/TheLastDestroyer)\n// Origional JS by Daniel Shiffman\n"
},
{
"path": "035.4_TSP_GA/Processing/CC_035_4_TSP_GA/ga.pde",
"chars": 2358,
"preview": "// Coding Train\n// Ported to processing by Max (https://github.com/TheLastDestroyer)\n// Origional JS by Daniel Shiffman\n"
},
{
"path": "036_Blobby/P5/index.html",
"chars": 368,
"preview": "<html>\n<head>\n <meta charset=\"UTF-8\">\n <script type=\"text/javascript\" src=\"https://cdn.socket.io/socket.io-1.4.5.js\"><"
},
{
"path": "036_Blobby/P5/sketch.js",
"chars": 595,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for this video: https://youtu.be/Cl_"
},
{
"path": "036_Blobby/Processing/CC_036_Blobby/CC_036_Blobby.pde",
"chars": 595,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for this video: https://youtu.be/Cl_"
},
{
"path": "037_diastic/P5/index.html",
"chars": 456,
"preview": "<html>\n <head>\n <meta charset=\"UTF-8\">\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsd"
},
{
"path": "037_diastic/P5/rainbow.txt",
"chars": 12326,
"preview": "A rainbow is a meteorological phenomenon that is caused by reflection, refraction and dispersion of light in water dropl"
},
{
"path": "037_diastic/P5/sketch.js",
"chars": 943,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/u-HUtrpyi1c\n\nf"
},
{
"path": "037_diastic/Processing/CC_037_diastic/CC_037_diastic/CC_037_diastic.pde",
"chars": 1347,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/u-HUtrpyi1c\n\n/"
},
{
"path": "037_diastic/Processing/CC_037_diastic/CC_037_diastic/data/rainbow.txt",
"chars": 12325,
"preview": "A rainbow is a meteorological phenomenon that is caused by reflection, refraction and dispersion of light in water dropl"
},
{
"path": "038_word_interactor/P5/index.html",
"chars": 780,
"preview": "<html>\n <head>\n <meta charset=\"UTF-8\">\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsd"
},
{
"path": "038_word_interactor/P5/sketch.js",
"chars": 983,
"preview": "// Daniel Shiffman\n// http://codingtra.in\n// http://patreon.com/codingtrain\n// Code for: https://youtu.be/AKuW48WeNMA\n\nv"
},
{
"path": "039_madlibs/P5/index.html",
"chars": 516,
"preview": "<!DOCTYPE html>\n<html>\n\n<head>\n <script src=\"https://cdn.jsdelivr.net/npm/papaparse@5.3.2/papaparse.min.js\"></script>\n "
}
]
// ... and 972 more files (download for full content)
About this extraction
This page contains the full source code of the CodingTrain/Coding-Challenges GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 1172 files (100.7 MB), approximately 15.8M tokens, and a symbol index with 5556 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.