Coding Challenge #29: Smart Rockets in p5.js

Subscribers:
1,740,000
Published on ● Video Link: https://www.youtube.com/watch?v=bGz7mv2vD6g



Duration: 48:17
395,060 views
6,011


In this coding challenge, I implement a "smart rockets" algorithm (based on a simulation by Jer Thorp). Code: https://thecodingtrain.com/challenges/29-smart-rockets-in-p5js

πŸ•ΉοΈ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/o5PwECj42

πŸŽ₯ Previous video: https://youtu.be/ccYLb7cLB1I?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
πŸŽ₯ Next video: https://youtu.be/KWoJgHFYWxY?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
πŸŽ₯ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH

Videos:
πŸŽ₯ My Genetic Algorithm playlist: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6bJM3VgzjNV5YxVxUwzALHV
πŸ”΄ Livestream Archive: https://youtu.be/A01_aKgIeCo

Related Coding Challenges:
πŸš‚ #69 Evolutionary Steering Behaviors: https://youtu.be/flxOkx0yLrY
πŸš‚ #100 Neuroevolution Flappy Bird: https://youtu.be/c6y21FkaUqw
πŸš‚ #147 Chrome Dinosaur Game: https://youtu.be/l0HoJHc-63Q

Timestamps:
0:00 Introduction
3:10 Rocket object
7:07 Population object
10:48 DNA object
15:09 Add target
17:24 Evaluate function
19:35 Mating pool
23:26 Selection function
25:36 Crossover function
33:56 Is the genetic algorithm working?
35:50 Check if rocket has reached target
38:05 Mutation function
40:17 Add obstacle
43:34 Check if rocket hits canvas edges
46:55 Conclusion and possible improvements

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

πŸš‚ Website: http://thecodingtrain.com/
πŸ‘Ύ Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide
🚩 Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
πŸ’‘ GitHub: https://github.com/CodingTrain
πŸ’¬ Discord: https://discord.gg/hPuGy2g
πŸ’– Membership: http://youtube.com/thecodingtrain/join
πŸ›’ Store: https://standard.tv/codingtrain
πŸ–‹οΈ Twitter: https://twitter.com/thecodingtrain
πŸ“Έ Instagram: https://www.instagram.com/the.coding.train/

πŸŽ₯ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
πŸŽ₯ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA

πŸ”— p5.js: https://p5js.org
πŸ”— p5.js Web Editor: https://editor.p5js.org/
πŸ”— Processing: https://processing.org

πŸ“„ Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct

This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new

#geneticalgorithm #dna #evolutionaryalgorithm #p5js #javascript







Tags:
challenge
coding
rockets
code
smart
p5.js
javascript
coding challenge
object oriented programming
oop
object oriented
programming challenge
creative coding
daniel shiffman
p5js
nature of code
genetic
genetic algorithm
genetic algorithms
the nature of code
evolution
algorithm
genotype
phenotype
genotype vs phenotype
dna
darwin
evolutionary
evolutionary computing
survival of the fitest
evolutionary algorithm