MENU

Fun & Interesting

Coding Challenge #91: Snakes & Ladders - Part 1

The Coding Train 76,459 7 years ago
Video Not Working? Fix It Now

In this multi-part coding challenge, I attempt to create a simulation of the classic board game Snakes & Ladders (also known as Chutes and Ladders). Code: https://thecodingtrain.com/challenges/91-snakes-and-ladders 🕹️ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/fxyOnKXlw Other Parts of this Challenge: 📺 Part 2 : Add Snakes and Ladders: https://youtu.be/wN5Is0DjW8w 📺 Part 3 : Visualize the States of the Game: https://youtu.be/1Ec_-wzJCPY 🎥 Previous video: https://youtu.be/0L2n8Tg2FwI?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH 🎥 Next video: https://youtu.be/188B6k_F9jU?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH 🎥 All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH References: 🌐 Snakes and Ladders on Wikipedia: https://en.wikipedia.org/wiki/Snakes_and_Ladders Videos: 🎥 Video Games track: https://thecodingtrain.com/tracks/games 🔴 Coding Train Live 116.1: https://youtu.be/nvvjYJ2L57c?t=1379s Related Coding Challenges: 🚂 #71 Minesweeper: https://youtu.be/LFU5ZlrR21E 🚂 #72 Frogger: https://youtu.be/giXV6xErw0Y 🚂 #94 2048 Sliding Puzzle Game: https://youtu.be/JSn-DJU8qf0 Timestamps: 00:00 Introduction 01:10 The Game of Snake & Ladders 04:14 Code! Create Player and Tile classes 05:21 Create a Grid of Tiles 08:56 Make a Zig Zag Path 12:15 Show the Tiles 17:21 Make a Checkerboard Pattern 18:17 Create a Player 18:34 Roll a Die 19:14 Show the Player 21:20 End Condition to the Game 22:41 The Monte-Carlo Simulation 24:43 Compute the Average number of Rolls 30:09 See you in Part 2! 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://thecodingtrain.com/discord 💖 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 #snakesandladders #game #p5js #javascript

Comment