tubeshowcase●913,532 videos♡ My collection 0
← Learn to Code

Learn to Code15:53

Random Walker in p5.js (Coding Challenge 52)

The Coding Train ↗

From the creator

In this coding challenge, I simulate a "random walk" with the p5.js library. This video is part of the course Nature of Code at ITP, Tisch, NYU. Code: https://thecodingtrain.com/challenges/52-random-walker 🕹️ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/N-qqe1ExZ 🎥 Previous video: https://youtu.be/aKYlikFAV4k?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH 🎥 Next video: https://youtu.be/bqF9w9TTfeo?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH 🎥 All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH References: 🚶🏽‍♀️ Random walk Wikipedia article: https://en.wikipedia.org/wiki/Random_walk 5️⃣ random Function Reference Page: https://p5js.org/reference/#/p5/random 5️⃣ floor Function Reference Page: https://p5js.org/reference/#/p5/floor 📕 The Nature of Code GitHub (Spring 2017): https://github.com/nature-of-code/NOC-S17-1-Physics-Animation Live Stream Archive: 🔴 Live Stream #73: https://youtu.be/RDULjRLn3pk Related Coding Challenges: 🚂 #53 Random Walker with Vectors and Lévy Flight: https://youtu.be/bqF9w9TTfeo 🚂 #162 Self Avoiding Walk: https://youtu.be/m6-cm6GZ1iw Timestamps: 0:00 Introduction to the Random Walker Coding Challenge 1:56 Whiteboard explanation of a random walk 6:48 Into the code...drawing a point! 7:30 Picking a random number between 0 and 4 using p5.js's 'random' and 'floor' functions 9:58 Setting up the code to use the random number 12:26 First run! The point...it wibbles...it wobbles 12:48 Stop clearing the back

Published 2017-01-27 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code