Coding Challenge #94: 2048 - Part 4
In this multi-part coding challenge, I code the sliding puzzle game 2048 in JavaScript using canvas and p5.js. Code: https://thecodingtrain.com/challenges/94-2048
πΉοΈ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/aeIk9JZ-U
Other Parts of this Challenge:
πΊ Part 1: https://youtu.be/JSn-DJU8qf0
πΊ Part 2: https://youtu.be/8f8P1i0W26E
πΊ Part 3: https://youtu.be/3iYvT8TBIro
π₯ Previous video: https://youtu.be/uWzPe_S-RVE?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Next video: https://youtu.be/5cNnf_7e92Q?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
References:
πΎ 2048: https://gabrielecirulli.github.io/2048/
π 2048 on Wikipedia: https://en.wikipedia.org/wiki/2048_(video_game)
Videos:
π₯ CircleCI - Unit Testing and Continuous Integration: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6bLqwFa52YGEHy-L1-D_Ve-
Related Coding Challenges:
π #142 Rubik's Cube: https://youtu.be/9PGfL4t-uqE
π #149 Tic Tac Toe: https://youtu.be/GTWrWM1UsnA
π #165 Slide Puzzle: https://youtu.be/uQZLzhrzEs4
Timestamps:
0:00 List of improvements & fixes
1:20 Fix a bug in the code
4:00 Add a function that indicates that the player has won
7:26 Add colors to the tiles
16:55 Add styling to indicate which tile has just been added
19:38 Change the odds of getting a "4"
20:54 Refactor code by adding a transposeGrid function
23:30 Add a switch statement
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
#2048 #slidingpuzzlegame #javascript #p5js
Other Videos By The Coding Train
Other Statistics
2048 Statistics For The Coding Train
At present, The Coding Train has 244,813 views spread across 4 videos for 2048, and about an hours worth of 2048 videos were uploaded to his channel. This is less than 0.15% of the total video content that The Coding Train has uploaded to YouTube.