Тёмный
No video :(

Coding Challenge #91: Snakes & Ladders - Part 1 

The Coding Train
Подписаться 1,7 млн
Просмотров 75 тыс.
50% 1

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: thecodingtrain.com/challenges...
🕹️ p5.js Web Editor Sketch: editor.p5js.org/codingtrain/s...
Other Parts of this Challenge:
📺 Part 2 : Add Snakes and Ladders: • Coding Challenge #91: ...
📺 Part 3 : Visualize the States of the Game: • Coding Challenge #91: ...
🎥 Previous video: • Coding Challenge #90: ...
🎥 Next video: • Coding Challenge #92: ...
🎥 All videos: • Coding Challenges
References:
🌐 Snakes and Ladders on Wikipedia: en.wikipedia.org/wiki/Snakes_...
Videos:
🎥 Video Games track: thecodingtrain.com/tracks/games
🔴 Coding Train Live 116.1: • Live Stream #116.1 - S...
Related Coding Challenges:
🚂 #71 Minesweeper: • Coding Challenge #71: ...
🚂 #72 Frogger: • Coding Challenge #72: ...
🚂 #94 2048 Sliding Puzzle Game: • Coding Challenge #94: ...
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: thecodingtrain.com/
👾 Share Your Creation! thecodingtrain.com/guides/pas...
🚩 Suggest Topics: github.com/CodingTrain/Sugges...
💡 GitHub: github.com/CodingTrain
💬 Discord: thecodingtrain.com/discord
💖 Membership: ru-vid.comjoin
🛒 Store: standard.tv/codingtrain
🖋️ Twitter: / thecodingtrain
📸 Instagram: / the.coding.train
🎥 Coding Challenges: • Coding Challenges
🎥 Intro to Programming: • Start learning here!
🔗 p5.js: p5js.org
🔗 p5.js Web Editor: editor.p5js.org/
🔗 Processing: processing.org
📄 Code of Conduct: github.com/CodingTrain/Code-o...
This description was auto-generated. If you see a problem, please open an issue: github.com/CodingTrain/thecod...
#snakesandladders #game #p5js #javascript

Опубликовано:

 

31 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 82   
@dermathze700
@dermathze700 6 лет назад
"Ancient Indian Videogame". I really like these kinds of coding challenges where you basically break down a well-known game as simple as possible. It really shows you the basics of programming.
@TheCodingTrain
@TheCodingTrain 6 лет назад
Thank you! I’m not sure I made this one as simple as possible but I hope it’s useful and helpful to watch my process even when I mess up a lot!
@thefunnybuddy4138
@thefunnybuddy4138 2 года назад
Thought you were going to address the fact he said video game instead of board.
@SeFreaCweth
@SeFreaCweth 8 месяцев назад
An ancient Desi Vidja! I heard that too.
@Drakkofire
@Drakkofire 6 лет назад
I saw a video of yours 1 year ago and I realized that I really like programming, I wasn’t even understanding what you were writting and now I understand everything and I make my own games, thank you for bringing to us this kind of videos and your sense of humor while explaining something, keep it up! PS: I don’t have the best english sorry :P
@TheCodingTrain
@TheCodingTrain 6 лет назад
Thank you for this very nice feedback!
@thisdood4103
@thisdood4103 6 лет назад
Half the time I have no idea what's going on, but you've inspired me to start learning to code with your sense of humor. Keep doing what you're doing
@dominick253
@dominick253 4 месяца назад
After almost a year and a half I think it's all starting to click. I don't know how it is for everybody else but it feels like one issue after another when you just get started. But after encountering the same issue a couple times you start to get a handle on how to solve it quickly. Add a bunch of those together and I start to feel like I'm being productive now.
@xetop
@xetop 6 лет назад
Thanks for sharing. I find your videos so interesting and entertaining :) I don't even program in javascript, and still watch almost all your videos. I really find your problemsolving so interesting, and even learn a thing or two :) Keep up the good work.
@MarkJay
@MarkJay 6 лет назад
congrats on 400k! Coding challenges are my favorite videos.
@abdo6059
@abdo6059 6 лет назад
FINALLYYYYY, OMGGG THANK YOU SO MUCH FOR THIS
@nelsoncardona64
@nelsoncardona64 3 года назад
Thank you!. very good.
@fuschia-draws
@fuschia-draws 6 месяцев назад
funnily enough i think the most globally known name for this game might just be “eels and escalators” from spongebob. someone should totally make that
@aradarbel4579
@aradarbel4579 6 лет назад
I am sad because the Like button is not an OMG ITS ANOTHER AMAZING CODING CHALLENGE FROM THE CODING TRAIN LOOOOVVVEEEE ITTTTTT!!!!!!!!!
@sadhlife
@sadhlife 6 лет назад
I have also made a snakes and ladders for my school project in Python, it will be nice to see how different we make it, I'm sure it will be very different ;)
@sumedh1591
@sumedh1591 2 года назад
NO WONDER YOU ARE A OVERREACTING KING
@Nobiag
@Nobiag 6 лет назад
you seem a bit like a real life dr. seuss character. and i totally mean that in a positive way ;) great channel, keep up the good work :)
@walter1357
@walter1357 6 лет назад
Pascal Wüsten o
@critstixdarkspear5375
@critstixdarkspear5375 6 лет назад
I was finding it hard to keep my kids interested in coding. Then I put them onto this channel. Now if they have a computer turned on there is always a text editor open. Can’t thank you enough.
@TheCodingTrain
@TheCodingTrain 6 лет назад
That’s so fun to hear! What ages are your kids?
@Iucebowel
@Iucebowel 3 года назад
@@TheCodingTrain They are three years older now, according to my calculations.
@drigocks3715
@drigocks3715 6 лет назад
You Sir inspired me to study Computing Engineering. Thank you for changing my life!
@TheAsadhaider007
@TheAsadhaider007 6 лет назад
The only video that has no dislikes! Thumbs up!
@simpletongeek
@simpletongeek 6 лет назад
I thought Snakes and Ladders is 10 minute challenge? it surprised me that this comes in 3 parts!
@TheCodingTrain
@TheCodingTrain 6 лет назад
Me too. I wonder if I did it again and thought about things more simply it could be done quickly and in one part?
@simpletongeek
@simpletongeek 6 лет назад
The Coding Train I'm sure you can. Practice makes perfect! :) I did a BASIC version (text only) and it was really quick. I like the way you did your graphics, though. Thumbs up!
@kostasgeorgiou2417
@kostasgeorgiou2417 6 лет назад
Great video Daniel! What about a tutorial on how to build a machine/deep learning algorithm that beats the games you made?
@TheCodingTrain
@TheCodingTrain 6 лет назад
Planning on it!
@jamesfrost3532
@jamesfrost3532 6 лет назад
But what about the Pepper Pig snakes and ladders?!?! we need to know! - love the video.
@TheCodingTrain
@TheCodingTrain 6 лет назад
Oh no! I forgot. I will check tonight!
@Remls
@Remls 6 лет назад
.
@SandshrewSamurai
@SandshrewSamurai 6 лет назад
I ended up googling it and he's correct, the Peppa Pig version does end on the opposite corner to the start.
@GevinMadharha
@GevinMadharha 4 года назад
tonight, 2 years later
@dave6012
@dave6012 2 года назад
@@GevinMadharha lol I expected nothing less from a chaotic good person
@programmingandstatus1539
@programmingandstatus1539 5 лет назад
You are comedy man also.
@paintingjo6842
@paintingjo6842 6 лет назад
8:49 that was a smoooth catch :)
@faisaltaher851
@faisaltaher851 6 лет назад
COOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOL
@manlyaltes5174
@manlyaltes5174 4 года назад
What kind of language you used?
@durbansmoke3364
@durbansmoke3364 6 лет назад
I need help with coding a game
@nick11927
@nick11927 6 лет назад
I BELIEVE it to be defined
@manlyaltes5174
@manlyaltes5174 4 года назад
Can you please used a php language for this game. Thanks a lot😊
@AWP85
@AWP85 5 лет назад
what leanguage program you used mister ?
@TheCodingTrain
@TheCodingTrain 5 лет назад
This video uses JavaScript with the p5.js library, for more: p5js.org.
@oystercam1040
@oystercam1040 3 года назад
hi, can you plz do a video showing how to do a board game on unity, where can the character choose to go or not to the other way? like a square with a line on de midle where they walk on it based on a dice movement..it would be really amazing ;v;
@huffliger9079
@huffliger9079 6 лет назад
Could you make a coding chalange, where you would code chess? You could then later make an chess ai or something like that...
@pavolslamka9214
@pavolslamka9214 6 лет назад
Hi *great* video! _Can you make video abot menu in game?_ (Start game, options exit) _And is it possible to convert p5.js to .exe ?_ Thank you :)
@enjey6763
@enjey6763 6 лет назад
You ar cool, iam from russia, but watching u and understand half of all your words, its pretty simple to understand the way you explain. Would you make a tilemap generation in your way you coding ? Its going to be very interesting for me.
@MrMattical123
@MrMattical123 6 лет назад
Why snakes and ladders? Could have made the far superior game Eels and Escalators?
@LP-bf9oe
@LP-bf9oe 3 года назад
is it c++ ?
@Ark-ju2gt
@Ark-ju2gt 6 лет назад
There is no video of the last live before this one about gradient descent ? Perhaps you plan to redo it ?
@michaelbennington7426
@michaelbennington7426 6 лет назад
I am new to javascript and p5.js. I am trying to load my code into a web browser through an HTML file (as you normally would). If i load the html file straight, it says the browser can't read local files. If I load it through a local server it says the files can't be found. Does anyone have any advice? Thanks
@TheCodingTrain
@TheCodingTrain 6 лет назад
This workflow video might help: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-HZ4D3wDRaec.html Also: sublime text: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-UCHzlUiDD10.html atom editor: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-d3OcFexe9Ik.html brackets: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-nmZbhManVcY.html codepen: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-5gfUgNpS6kY.html
@redhen
@redhen 6 лет назад
You could also use the CodePen website to run your p5.js sketch. It's free :) Here's a link to a CodePen that is already linked to the p5.js library: codepen.io/RedHenDev/pen/MpJeoo
@michaelbennington7426
@michaelbennington7426 6 лет назад
Thank you so much!
@funkyb6598
@funkyb6598 6 лет назад
Setting up the board is tricky : )
@adarsh-chakraborty
@adarsh-chakraborty 10 месяцев назад
AverageP 😅😅
@Rea.M
@Rea.M Год назад
Is this delphi?
@prayaglehana7187
@prayaglehana7187 6 лет назад
sir plz upload a playlist on how to use tensorflow or openCV
@glennismade
@glennismade 6 лет назад
Prayag Lehana there are several tensorflow videos on RU-vid depending on your ML experience. Personally I really like sentdex but he assumes you have a pretty decent understanding of ML and NN logic.
@dhvalden
@dhvalden 6 лет назад
is that 1 million Random Numbers wit 100.000 normal deviates, from RAND Corp?
@TheCodingTrain
@TheCodingTrain 6 лет назад
YES!
@TheChunkeh
@TheChunkeh 6 лет назад
At 28:38 shouldn't it be rolls.length-2? You said you didn't want to include the last index in the array but rolls.length-1 would still include that wouldn't it? Meaning that the average rolls will be off. (albeit very slightly)
@yashrajanshukla7790
@yashrajanshukla7790 6 лет назад
Can i code it with arrays
@SimonTiger
@SimonTiger 4 года назад
5:10 Since when does wh stand for square? WH and SQUARE don't have any letters in common!
@yashasgangadhar2109
@yashasgangadhar2109 4 года назад
width and height xD
@SimonTiger
@SimonTiger 4 года назад
@@yashasgangadhar2109 I know, I know.
@caster_team6301
@caster_team6301 6 лет назад
what program is he using???
@timvanderleeden6569
@timvanderleeden6569 6 лет назад
Benich_04 he uses atom as a text editor (see atom.io), chrome for displaying the page and he uses the p5.js library for amongst other things premade render functions
@deadzen
@deadzen 6 лет назад
I was looking for this. Ill try atom, been using brackets and im not happy with the JS
@BichaelStevens
@BichaelStevens 6 лет назад
deadzen Atom is a CPU hog that lags periodically. MS Visual Code is better.
@WarriorX16
@WarriorX16 6 лет назад
Don't leave us hanging, how is the Peppa Pig version played?!
@TheCodingTrain
@TheCodingTrain 6 лет назад
Oh, I keep forgetting!
@Dhakshith1189
@Dhakshith1189 6 лет назад
I Am An INDIAN, But The Game Snakes And Ladders Was Not A Video Game, That Was A Board Game.
@TheCodingTrain
@TheCodingTrain 6 лет назад
Yes, my apologies I completely misspoke!
@Dhakshith1189
@Dhakshith1189 6 лет назад
It's OK!
@SimonTiger
@SimonTiger 4 года назад
18:58 *DO YOU KNOW THAT A DICE IS 1-6 INCLUSIVE??*
@Speeskees
@Speeskees 6 лет назад
So... What about the Peppa Pig game?
@TheCodingTrain
@TheCodingTrain 6 лет назад
I was right all along!
@Speeskees
@Speeskees 6 лет назад
The Coding Train never doubt yourself!
Далее
Coding Challenge #91: Snakes & Ladders - Part 2
26:22
Coding Challenge #71: Minesweeper
53:46
Просмотров 527 тыс.
Штаны легионера
00:44
Просмотров 193 тыс.
Coding Challenge #88: Snowfall
52:33
Просмотров 171 тыс.
Daniel Shiffman Presents The Nature of Code
1:43
Просмотров 1,7 тыс.
Coding Challenge #97: The Book of Pi - Part 1
37:05
Просмотров 51 тыс.
The IBM 1401 compiles and runs FORTRAN II
23:41
Просмотров 1,2 млн
8 Design Patterns EVERY Developer Should Know
9:47
Introduction to shaders: Learn the basics!
34:50
Просмотров 308 тыс.
Coding Challenge 93: Double Pendulum
31:11
Просмотров 917 тыс.
Coding Challenge #103: Fire Effect
29:36
Просмотров 104 тыс.