Coding Challenge #71: Minesweeper
About
No channel description available.
Latest Posts
Video Description
In this challenge, I attempt to code the classic game Minesweeper in JavaScript with the p5.js library. Code: https://thecodingtrain.com/challenges/71-minesweeper πΉοΈ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/-mz-ePoqd π₯ Previous video: https://youtu.be/N8Fabn1om2k?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH π₯ Next video: https://youtu.be/giXV6xErw0Y?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH π₯ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH References: π Minesweeper on Wikipedia: https://en.wikipedia.org/wiki/Minesweeper_(video_game) π Floodfill on Wikipedia: https://en.wikipedia.org/wiki/Flood_fill π± Minesweeper suggestion on GitHub: https://github.com/CodingTrain/Rainbow-Topics/issues/164 Videos: π₯ Prototypes in JavaScript: https://www.youtube.com/watch?v=hS_WqkyUah8 π₯ Inheritance with Prototype in JS: https://www.youtube.com/watch?v=CpmE5twq1h0 π΄ Coding Train Live 92: https://youtu.be/zxR7KfVMGqk?t=2282s Related Coding Challenges: π #3 The Snake Game: https://youtu.be/AaGK-fj-BAM π #46 Asteroids: https://youtu.be/hacZU523FyM π #67 Pong!: https://youtu.be/IIrC5Qcb2G4 π #91 Snakes & Ladders: https://youtu.be/JrRO3OnWs5s π #115 Snake Game Redux: https://youtu.be/OMoVcohRgZA Timestamps: 0:00 Welcome! 1:26 All aboard! 2:36 Explaining the logic of the game 4:31 Defining the cells 11:03 Let's make a show() function using object protypes! 17:30 Checking if mouse is inside a grid 20:15 Revealing the cells after clicking 22:58 Checking how many bees are neighboring a particular cell 34:20 Starting to work on the game mechanic! 41:50 Let's implement floodfill! 48:45 Defining when the game is over 51:11 Minesweeper! 53:12 Thanks for watching! 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 #games #prototypes #floodfill #javascript #p5js
Boost Your Coding Skills Today
AI-recommended products based on this video

10.1 Inch Touch Portable Monitor IPS Screen 1366x768P 60Hz 400 Brightness 99% sRGB HDMI USB-C Monitors Switch for Xbox PS3/4/5 Laptop Compatible with Raspberry Pi, Mini Touch Screen

ELECROW 8 Inch Portable Monitor, 1280x800 Mini HD Display with Built-in Speakers, USB Powered, Non-Touch LCD Screen for Raspberry Pi, PC, Laptop, Jetson Nano, Game Consoles

7 Inch Portable Monitor Touchscreen HD 1024x600 LED Display Dual HDMI Port Small Monitor for PC Raspberry Pi Laptop Computer Xbox PS4/5 Switch Built-in Speakers

BrosTrend 1800Mbps WiFi 6 Linux WiFi Adapter for PC and Raspberry Pi 2+, Long Range USB WiFi Dongle Linux for Ubuntu, Mint, Debian, Kubuntu, Lubuntu, Zorin, Windows 11/10, Dual Band Wireless Antenna

Logitech M185 Wireless Mouse, 2.4GHz with USB Mini Receiver, 12-Month Battery Life, 1000 DPI Optical Tracking, Ambidextrous, Compatible with PC, Mac, Laptop - Black

Logitech G203 Wired Gaming Mouse, 8,000 DPI, Rainbow Optical Effect LIGHTSYNC RGB, 6 Programmable Buttons, On-Board Memory, Screen Mapping, PC/Mac Computer and Laptop Compatible - Black

Logitech G305 Lightspeed Wireless Gaming Mouse, Hero 12K Sensor, 12,000 DPI, Lightweight, 6 Programmable Buttons, 250h Battery Life, On-Board Memory, PC/Mac - Black

Logitech G502 Hero High Performance Wired Gaming Mouse, Hero 25K Sensor, 25,600 DPI, RGB, Adjustable Weights, 11 Programmable Buttons, On-Board Memory, PC/Mac, Black

Cmokifuly GMK67 65% Mechanical Keyboard Kit Tri-Mode South-Facing RGB LED for 3/5pin Switches,66 Keys+1 Knob Hotswap Socket PCB Gasket Mounted Plate Gaming DIY Keyboard Kit (White)

5 Pcs Adult Keyboard Clicker Toys, Portable Mechanical Keyboard Keychain Toy, Decompression Toys, Funny Cube Key Button Stress Relief for Adults Present to Relief Pass Time

Asus ROG Azoth Wireless Mechanical Gaming Keyboard β 75% TKL, Tri-Mode Connectivity, Hot Swappable Pre-lubed ROG NX Snow Linear Switches, PBT Keycaps, RGB, OLED Display, PC/Mac Support - Black

TMKB 60% Mechanical Gaming Keyboard, Brown Tactile Switch, LED Backlight, Anti-Ghosting, Detachable USB-C, Double-Shot Keycaps, 61 Keys, Wired, White

Anker 332 USB-C Hub (5-in-1) with 4K HDMI Display, 5Gbps - and 2 5Gbps USB-A Data Ports and for MacBook Pro, MacBook Air, Dell XPS, Lenovo Thinkpad, HP Laptops and More

Anker USB C Charger Cable (6ft 100W, 2Pack), USB 2.0 Type C Fast Charging Cable for iPhone 15 / 15Pro / 15Plus / 15ProMax MacBook Pro 2020, iPad Pro 2020, iPad Air 4, Samsung Galaxy S23+/S23 Ultra ClimatePartner certified
![Anker USB C Cable, [2-Pack, 6 ft] Type C Charger Premium Nylon USB Cable, USB A to Type C Charging Cable Fast Charge for Samsung Galaxy S10 S10+ / Note 8, LG V20 and Other USB C Charger (Black)](https://m.media-amazon.com/images/I/71N7xhCJnoL._AC_UL960_FMwebp_QL65_.jpg)
Anker USB C Cable, [2-Pack, 6 ft] Type C Charger Premium Nylon USB Cable, USB A to Type C Charging Cable Fast Charge for Samsung Galaxy S10 S10+ / Note 8, LG V20 and Other USB C Charger (Black)

Anker Nano USB C Wall Charger,45W Fast Charging Smart Display Charger,with 180Β°Foldable Plug,Smart Recognition,Built-in Care Mode,for iPhone17/16/15 (Non-Battery,One USB-C Port,No Cable Included) ClimatePartner certified

NEEWER Advanced 18 inch LED Ring Light for Phone, LCD Touch Screen, 2.4G Remote Lights Control, 3200-5600K, Tripod Light for iPhone Action Camera, for Studio Makeup TikTok YouTube Video Salon (Black)

Bose QuietComfort Wireless Noise Cancelling Headphones, Bluetooth Over Ear Headphones with Up to 24 Hours of Battery Life, Moonlight Grey - Limited Edition

UGREEN USB to USB C Adapter & USB C to USB Adapter Combo 4-Pack, 10Gbps Type-C Converter, Car Charger Compatible with MacBook Pro, iPad Mac mini, iPhone 17/16, Galaxy, PC/Laptop, Hard Drive Enclosure

Hi.FANCY Portable Laptop Stand with Dual Cooling Fans for 14-17inch Laptops, Grey, 23.5 x 25.9 x 0.95cm

Laptop Stand, OMOTON Laptop Mount, Aluminum Laptop Holder Riser Stand for Desk, Compatible with MacBook Air/Pro, Dell, HP, Lenovo and All Laptops (10-15.6 inch),Silver

BESIGN LSX7 Laptop Stand with 360Β° Rotating Base, Ergonomic Adjustable Notebook Stand, Riser Holder Computer Stand Compatible with Air, Pro, Dell, HP, Lenovo More 10-15.6" Laptops (Black) Recycled Claim Standard Blended





![Apple ][ Coding Challenge: Fractal Tree](https://imgz.pc97.com/?width=500&fit=cover&image=https://i.ytimg.com/vi/UNkHditYGls/hqdefault.jpg)














