Coding Challenge #3: The Snake Game

  Рет қаралды 3,384,470

The Coding Train

The Coding Train

Күн бұрын

In this coding challenge, I code a p5.js version of the Snake Game. Code: thecodingtrain.com/challenges...
🕹️ p5.js Web Editor Sketch: editor.p5js.org/codingtrain/s...
🎥 Previous video: • Coding Challenge #2: M...
🎥 Next video: • Coding Challenge #4: P...
🎥 All videos: • Coding Challenges
References:
🌐 Snake Game on Wikipedia: en.wikipedia.org/wiki/Snake_(...)
Live Stream Archive:
🔴 Coding Train Live 32: • Coding Train Live 32: ...
Related Coding Challenges:
🚂 #32 Agar.io: • Coding Challenge #32.1...
🚂 #72 Frogger: • Coding Challenge #72: ...
🚂 #173 AppleSoft Basic Snake Game: • What was Coding like 4...
🚂 #115 Snake Game Redux: • Coding Challenge #115:...
Timestamps:
0:00 Creating a Snake object
3:00 Adding keyboard control
5:20 Grid and World Constraints
8:00 Adding Food!
11:00 Eating The Food!
13:05 Getting Longer When Eating
17:40 Fixing Mistakes
21:48 Game Over State
25:55 Coding Challenge Complete Choo Choo!
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: kzfaq.infojoin
🛒 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...
#snake #game #vectors #arrays #p5js #javascript

Пікірлер: 3 500
@TheCodingTrain
@TheCodingTrain 5 жыл бұрын
If you want to know what happened during "technical difficulties"! kzfaq.info/get/bejne/r7t_ZcWIy6jLfmw.html
@dixoncyprian8633
@dixoncyprian8633 5 жыл бұрын
cool bro
@abandonj
@abandonj 4 жыл бұрын
So fast😮
@Nurutomo
@Nurutomo 4 жыл бұрын
Why not using "shift()" "unshift" "pop()" "push()"?
@nugs2727
@nugs2727 4 жыл бұрын
NsG Frantic just copy him but this is how Function setup() { CreateCanvas(400,400) } Function draw() { background(51) } This is in java script. If you wanna know in a different language than you can watch a tutorial video Edit: function draw is optional, it just changes the background colour or if you wanna draw a circle or a square
@pratigyasingh317
@pratigyasingh317 4 жыл бұрын
Wow wow wow
@Warm_Ice0
@Warm_Ice0 7 жыл бұрын
Anyone get this guy randomly recommended to them? Im loving it.
@tarkin843
@tarkin843 7 жыл бұрын
Daniel Esen J. Oliviėr Yes
@Kevin-ji1sr
@Kevin-ji1sr 7 жыл бұрын
Daniel Esen J. Oliviėr I think KZfaq can read my mind ;)
@diyansueka3192
@diyansueka3192 7 жыл бұрын
Yes
@user-ys1gt7ze9s
@user-ys1gt7ze9s 7 жыл бұрын
yep...i want to learn how to programme and how to code :/ and then this guy comes out :D
@Hanzi2u
@Hanzi2u 7 жыл бұрын
Daniel Esen J. Oliviėr yes i just watched the purple rain video by him
@captstrugglebunny
@captstrugglebunny 5 жыл бұрын
It is pretty amazing that a game that was once considered good enough for commercial distribution in arcades became a time waster pack-in on cellphones, and then finally a 30 minute coding tutorial.
@chonkydog6262
@chonkydog6262 2 жыл бұрын
I'd pay a quarter to play snake
@bleepboop
@bleepboop 9 ай бұрын
The framework does some pretty heavy lifting here compared to 1976-versions
@shanewalsch
@shanewalsch 4 ай бұрын
​@@bleepboopthe main loop and drawing. Its not that hard to implement yourself
@rdevan3245
@rdevan3245 2 ай бұрын
​@@shanewalschcool. Now try it with the technology that was actually available in 1976 lmao
@thelavagod
@thelavagod 5 ай бұрын
Hey there Daniel, It's me in 2024. Back in 2017, I discovered this video and this was where my programming interests began. I first started off by learning JavaScript (because it was the language you were using) then Python, a bit of C++, Java and Ruby and I went into more advanced stuff such as Logic, and how programming languages work, and computer science. I learned how to code in Visual Basic, as well as learning about the parts of PC, the basic input devices, the BIOS, and more. All because I discovered this video of yours. I cannot find the words to express my gratitude to you.
@TheCodingTrain
@TheCodingTrain 5 ай бұрын
Thank you for sharing this, I'm so happy to hear!
@lakhaidir9284
@lakhaidir9284 2 ай бұрын
Woah, despite 7 years later you're still replying comments tho. Respect...
@wifeless
@wifeless 5 жыл бұрын
Damn! This video is almost 3 years old and you're still responding to comments? Saw you in my recommended and found the video super interesting. Thanks!
@sujatha.a9702
@sujatha.a9702 4 жыл бұрын
😂
@bodharajdahal4855
@bodharajdahal4855 4 жыл бұрын
😁
@the_neto06
@the_neto06 3 жыл бұрын
this comment had 666 likes lmao
@xuxavier6924
@xuxavier6924 3 жыл бұрын
4 years now lol
@risab6218
@risab6218 3 жыл бұрын
Still responding....
@dennisvargas7719
@dennisvargas7719 7 жыл бұрын
do call of duty next
@radecreative6620
@radecreative6620 7 жыл бұрын
In 15 years 😂
@Jorolfs
@Jorolfs 7 жыл бұрын
KZfaqr shots fiyerd :P
@Robert_199
@Robert_199 7 жыл бұрын
too easy
@johnsims9907
@johnsims9907 7 жыл бұрын
Like from the ground up writing an effects engine and everything?
@slowdragon4169
@slowdragon4169 7 жыл бұрын
lmao
@hackwise
@hackwise 7 жыл бұрын
You totally earn my respect , you are a great programmer and mentor, thanks for all your videos.
@um_idkw
@um_idkw 11 ай бұрын
252 likes and no replies, I honestly don't care.
@The_Foreman
@The_Foreman 5 жыл бұрын
"Hello and welcome to what today will be a 15 minute coding challenge" *Looks at video length* Uh huh....
@forest3064
@forest3064 4 жыл бұрын
Well, work expands to fill the time given.
@abdelrahmanmohamed6701
@abdelrahmanmohamed6701 4 жыл бұрын
He takes more time to explain for us We appreciate your efforts 🙏😊😘
@Melvin420x12
@Melvin420x12 4 жыл бұрын
Basically every project ever
@k-vin2073
@k-vin2073 4 жыл бұрын
@@abdelrahmanmohamed6701 indeed
@AjeetSingh-xq4yb
@AjeetSingh-xq4yb 7 жыл бұрын
dont know why this channel appeared in my recommended, clicked on 1 video and have been browsing for hours now. This makes we want to learn to code.
@TheCodingTrain
@TheCodingTrain 7 жыл бұрын
+Ajeet Singh I'm really wondering why it's being recommended too! Lots of new viewers thanks for the comment. (Take a look at my foundations of JavaScript playlist if you want to learn from the beginning)
@phinix827
@phinix827 7 жыл бұрын
haha got it recommended too :D i haven't watched many of such videos :D but VERY nice :D I mean i watched nearly the hole video even if im not into coding :D
@johnpyp
@johnpyp 7 жыл бұрын
Just appeared in my recommended as well, maybe because I have been learning to code, but I love these videos!
@alephbet6265
@alephbet6265 7 жыл бұрын
this appeared on my recommended because i learn python
@Dylan5246
@Dylan5246 7 жыл бұрын
X-Core Aleph but this is javascript
@camelcase9225
@camelcase9225 7 жыл бұрын
Seriously wish I could code like you. I can think of what I need to do but can't implement it as effectively as you can. I just found this channel randomly and am loving it! You're very entertaining.
@TheCodingTrain
@TheCodingTrain 7 жыл бұрын
so nice to hear, thank you!
@Savage_Gamer777
@Savage_Gamer777 6 жыл бұрын
Radbeh Yousefi you don’t need college.
@derronwhite375
@derronwhite375 6 жыл бұрын
I wish i can code like him too
@meanstreak110
@meanstreak110 6 жыл бұрын
The Coding Train Ha! You're a narcissistic person. At least in this comment you are...because I thought you were gonna help him out....but no. You don't care :( Edit: I've seen enough of ur content to know that you just care about yourself. #NARCISSISTIC-af
@Guevara1015
@Guevara1015 6 жыл бұрын
nah, he's a lovely guy. He posts videos on basically everything related to coding (mostly Processing stuff). I've probably seen more of his content than you do so I know he's just a great guy sharing his love for programming. He isn't google. If you need answers to a specific problem, let me inaugurate you into the upper class of programming: StackOverflow. your welcome
@NiiAnikin
@NiiAnikin 4 жыл бұрын
just jumped on the javascript/coding train and I'd love to say, this is the most useful video, I have seen to date. I know enough to understand the basic mechanics of whats going on here but seeing this implementation and real time description is super awesome and very useful. Big thumbs up
@Horse-tradeEu
@Horse-tradeEu 2 жыл бұрын
Story of every programmer, will finish by tomorrow. Three years later... Thank you man, I am learning so much!
@invictuz4803
@invictuz4803 7 жыл бұрын
Wow, just randomly found this video. Now I understand javascript...i think
@senpaisanchoyt5225
@senpaisanchoyt5225 7 жыл бұрын
Hey im taking classes for this and i understand this.... i think. I won't say its hard but there is alot of difficulties.
@invictuz4803
@invictuz4803 7 жыл бұрын
SenpaiSancho YT What kind of difficulties? And are you taking these class online for free?
@Yorelz
@Yorelz 7 жыл бұрын
InvictuZ try out something like CodeHs it's where I started (prior experience with Python)
@senpaisanchoyt5225
@senpaisanchoyt5225 7 жыл бұрын
InvictuZ School, we are just messing around with and programming a robot.
@ginney1032
@ginney1032 7 жыл бұрын
InvictuZ hahaha, no you don't ;)
@ALLCAPS
@ALLCAPS 7 жыл бұрын
I love how you fucking start from a CHALLENGE but then you shift into this in-depth tutorial and omg I LOVE HOW YOU TEACH
@TheCodingTrain
@TheCodingTrain 7 жыл бұрын
Heh, thanks for the feedback. :)
@ALLCAPS
@ALLCAPS 7 жыл бұрын
I wish I was as fluent as you are in the Java script, and Java language. I'm currently in school for programming, and will aim to be a senior-software engineer one day.
@StelznerGaming
@StelznerGaming 3 жыл бұрын
As someone who just got into coding I am so happy I just found your channel. Love your passion!
@maluxon5324
@maluxon5324 5 жыл бұрын
I just started to get into programming recently and i definetly won't be able to build such a code yet but im so happy that i understood 80-90% of the steps you did there. That is a great motivation ^^
@TheFloatingSheep
@TheFloatingSheep 7 жыл бұрын
2:27 I'm nervous about wasting time so I'm just gonna call it "s" then brag about it for a minute. - Daniel Shiffman 2016
@quantumvac7737
@quantumvac7737 7 жыл бұрын
Him Talking : 15 minute challenge On-screen Bar : 10 Minute Challenge Video Length : 30 Minutes Me : Seems Legit.
@jonathanmorrison8223
@jonathanmorrison8223 5 жыл бұрын
15:25 lol
@kingfoxx6697
@kingfoxx6697 5 жыл бұрын
😂😂
@skilz8098
@skilz8098 4 жыл бұрын
I agree I can probably write the code in about 15 - 20 minutes to solve a problem, but it will probably take 2-3 times that to fix compiler errors and to debug it! Then again I don't use Java, I'm accustomed to C and C++, rarely C#... I did start to learn Python and that I don't mind, Python is pretty decent, Java eh... Now, JavaScript isn't too bad, but it takes a bit to get accustomed to it but I don't do much "web development". I word on the backend, libraries, interfaces, 3D graphics or rendering engines, etc... I do a bit of hardware emulation, etc. This is why I prefer C/C++!
@mattwayne9128
@mattwayne9128 2 жыл бұрын
@@skilz8098... Wrong thread? I don't believe what you just said is relevant to anything in this comment section.
@IndianGamer-qz8lf
@IndianGamer-qz8lf 2 жыл бұрын
I like how coding challenges are suspenseful, entertaining and informative at the same time 🌀
@FelixxFelixx-tt7sf
@FelixxFelixx-tt7sf 4 жыл бұрын
I dont know how, but in only 15 minutes, you taught me more than multiple hours of someone speaking my language
@mateopolanco213
@mateopolanco213 7 жыл бұрын
4 years of learning programming this challenge will probably take me a week. I'm bad
@flowolf86
@flowolf86 7 жыл бұрын
mateo polanco he prepared for it obviously...
@muhanad102
@muhanad102 7 жыл бұрын
yeah but if you did it once ...the next time you will do it in 1 day...then 50 min ...and so on coding is a language when you speak it alot you become fluent
@skylarkenneth3784
@skylarkenneth3784 6 жыл бұрын
It's a matter of doing two things at the same time: 1) Visualizing what you want a program to do 2) Visualizing how your code works line by line In other words, debugging as you code. The big takeaway from this is having a good spatial memory or abstract thinking.
@JordanShackelford
@JordanShackelford 7 жыл бұрын
at 12:23 instead of writing out "if (d
@DareDevilPhil
@DareDevilPhil 7 жыл бұрын
Jordan Shackelford true, however that function is later modified to increment this.total
@JordanShackelford
@JordanShackelford 7 жыл бұрын
He explained in another vid that he does this on purpose to make code more readable. just letting you guys know there's another way
@sloppyy
@sloppyy 7 жыл бұрын
scrolled down to see if anyone had said this already
@Yopi69
@Yopi69 7 жыл бұрын
Ivan Dobrev a
@MineMoore
@MineMoore 7 жыл бұрын
Chris Pierce hi Chris pierce big fan
@phunguyenuc3747
@phunguyenuc3747 5 жыл бұрын
Oh boi, I love youtube recommendation. They brought me to this wonderful art of coding
@marlynstark341
@marlynstark341 5 жыл бұрын
Never knew JavaScript codes are so light and u can do much with so little.....
@SleazyNice
@SleazyNice 5 жыл бұрын
He is using a library that hides much of the code.
@Jackarius86
@Jackarius86 5 жыл бұрын
Raymond Cruz it isnt THAT much code that is hidden. You could do the same using canvas with exactly the same number of lines possibly less, which are also just as easy to use.
@azizalaliq8
@azizalaliq8 5 жыл бұрын
Ikr I've been using pygame and its so intensive
@smanzoli
@smanzoli 5 жыл бұрын
@@azizalaliq8 Don´t use pygame, use processing.py (just the same language as the P5 used here, but with Python instead of JS)
@tilostammwitz4226
@tilostammwitz4226 4 жыл бұрын
they aren't - this dude shows only a part of the code. As in his other "challenges" he types some code, and some kind of strange framework does things like drawing, etc. I never saw him starting a project from scratch - every time an empty window - he writes some functions, that are never called in his code and, tadaa.... some kind of fancy animation. Professionals can't learn anything from him - they can do at their own - and beginners don't understand anything. Kind of useless in my opinion.
@juleslardon3036
@juleslardon3036 7 жыл бұрын
how gome i enjoy watching you code but i dont accually know how to code :P
@TheCodingTrain
@TheCodingTrain 7 жыл бұрын
+TheBaconGamer that is amazing to me. Go back and watch my intro to JavaScript playlist and learn!
@juleslardon3036
@juleslardon3036 7 жыл бұрын
+Daniel Shiffman i will :D
@11ditto11
@11ditto11 7 жыл бұрын
TheBaconGamer hahaha I was thinking exactly the same
@epilefchannel9424
@epilefchannel9424 7 жыл бұрын
wow... happens the same to me lol.... i'ts fun as fuck... but no clue how to even code xD, don't even know how i got to this channel, gonna sub xD
@sigurdriseth5923
@sigurdriseth5923 7 жыл бұрын
TheBaconGamer true
@k2k4
@k2k4 7 жыл бұрын
so i spend 4+ hours trying to understand and copy verbatim what another person did to make snake in a youtube video, and you get it done in like 25ish minutes. Absolutely brilliant coding skills dude.
@LapSiLap
@LapSiLap 5 жыл бұрын
You dont need a head and a tail. You can have 1 array with 1 vector in the beginning and when it grows you just push a vector to it. To update it, you will set for example index 5's position 4, 4->3, 3->2, 2->1, 1->0 and then index 0 being the head will just head whatever direction the player controls it. Update function will be much easier: // Move the tail for (var i = this.snake.length - 1; i > 0; i--) { this.snake[i].x = this.snake[i-1].x; this.snake[i].y = this.snake[i-1].y; } // Move the head this.snake[0].x = this.snake[0].x + this.xspeed * scl; this.snake[0].y = this.snake[0].y + this.yspeed * scl;
@amirhamzah6146
@amirhamzah6146 4 жыл бұрын
you are brilliant
@52.yusrilihsanadinatanegar79
@52.yusrilihsanadinatanegar79 4 жыл бұрын
genius
@bendertequila8881
@bendertequila8881 4 жыл бұрын
awesome! this solution is the one i was trying to do :)
@lastsecond959
@lastsecond959 4 жыл бұрын
I don't know what it says because I only know a bit (very little) of C and java, but I still give it a like.
@ahmadyogi1340
@ahmadyogi1340 4 жыл бұрын
Thank you
@OakSwami
@OakSwami 6 жыл бұрын
Damn dude... You make programming so intertaining! Im gonna start watching your vids to learn and try to pass my subject. xD
@dm8dd
@dm8dd 7 жыл бұрын
genius, haven't coded for 15 years, tempted to have a go again. thanks bro!
@TheCodingTrain
@TheCodingTrain 7 жыл бұрын
Thanks for watching!
@taylorhetherington745
@taylorhetherington745 7 жыл бұрын
Damn I wanna be like you, that's my New Years resolution :p - be energetic - be good at coding - wear cool shirt combos - be generally brilliant
@Felixpf1
@Felixpf1 7 жыл бұрын
Hjard Kuk so stop playing lol you lazy piece of shit :D
@taylorhetherington745
@taylorhetherington745 7 жыл бұрын
Felixpf1 I haven't played in a while, logged on today and fed my ass off :p
@armanpapa3
@armanpapa3 7 жыл бұрын
add being a cringey weeb to ur list
@taylorhetherington745
@taylorhetherington745 7 жыл бұрын
ReX - donald trump pp - uploaded a picture of a girl to ur g+ page - name is rex You're the cringey one and I've never watched an anime, apart from pokemon when i was kid
@tryhitmecs9699
@tryhitmecs9699 7 жыл бұрын
lol rekt trump got stumped
@brandonnorsworthy
@brandonnorsworthy 5 жыл бұрын
"I'm going to make var s, mainly to save time.." proceeds to keep talking about var s for more time than it would've been to create var snake
@AndresHernandez-dc6ow
@AndresHernandez-dc6ow 3 жыл бұрын
I have a question what does var S do?
@kaskadouff1349
@kaskadouff1349 3 жыл бұрын
@@AndresHernandez-dc6ow i think var s is the variable where a instance of the Snake 'class' is stocked (but im not sure, and even not if it's called a class in javascript too)
@looch95
@looch95 5 жыл бұрын
I love how much you explain your code, really helps us beginners, especially the diagrams.
@EdwardGordington
@EdwardGordington 7 жыл бұрын
i want whatever this guys having lmfao.
@TheCodingTrain
@TheCodingTrain 7 жыл бұрын
+Mazzza3 chamomile tea.
@hatben
@hatben 7 жыл бұрын
Posted on 4/20 :P
@mkmush1982
@mkmush1982 7 жыл бұрын
Daniel Shiffman more like Daniel Sniffman.. But great video!
@roychh1
@roychh1 7 жыл бұрын
meth
@iwanttodie8331
@iwanttodie8331 7 жыл бұрын
I dun bet it's Adderal
@pulisichhh
@pulisichhh 7 жыл бұрын
Dude, you code like in movies. Keep going.
@ScibbieGames
@ScibbieGames 7 жыл бұрын
Speedcell nobody codes like in movies
@andrewking9271
@andrewking9271 7 жыл бұрын
Course you can. All you have to do is penetrate the firewalls and reverse the mainframe.
@Yorelz
@Yorelz 7 жыл бұрын
Andrew King I don't even think a mainframe is an actual thing 😂 gotta love movies "code.hackperson"
@joshmosky
@joshmosky 7 жыл бұрын
Joe Biden Mainframe is an actual thing. We have one and use one at work. It's just not what you think of it as.
@EnterpriseKnight
@EnterpriseKnight 7 жыл бұрын
Don't forget to Enhance.
@alisonjannette3084
@alisonjannette3084 5 жыл бұрын
i found this so entertaining, i love your enthusiasm
@pnkfld7892
@pnkfld7892 4 жыл бұрын
Thanks for inspiring me to try to do this myself in cpp using sfml, I originally saw this video when it was live in 2016 and tried to implement in cpp without coming back to this vid. It was a lot of fun to practice some basic programming skills and learn a bit of sfml for graphics handling.
@kenneybohjort4314
@kenneybohjort4314 7 жыл бұрын
The adderall is strong in this one :D
@hmm-.-
@hmm-.- 8 жыл бұрын
And you just got a new subscriber :D You are amazing!
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
thank you, so glad to hear!
@zakisudo9611
@zakisudo9611 7 жыл бұрын
+1:)
@Meganthamac
@Meganthamac 7 жыл бұрын
Agreed! Subbed!
@extremist0276
@extremist0276 7 жыл бұрын
Same!
@belskysol
@belskysol 5 жыл бұрын
these videos are seriously amazing, really helpful for someone who wants to learn coding.
@lordvenomous6335
@lordvenomous6335 5 жыл бұрын
Keep up the good work, you inspire me to love programming even more and have given me a love of it.
@Jan-vw5cg
@Jan-vw5cg 7 жыл бұрын
I've always thought that I look/sound like I'm mental every time I explain my codes in class. Now that I found your videos I'm certain that everyone thinks I'm insane... This is like looking at a mirror.
@amirnoble1371
@amirnoble1371 6 жыл бұрын
Jan what class are you doing?
@fuelks
@fuelks 6 жыл бұрын
"codes" lol
@denzel3972
@denzel3972 5 жыл бұрын
Amir Noble computer science maybe
@dvnmnd5020
@dvnmnd5020 5 жыл бұрын
Arach Thou shall not pass
@Ray-jg5dj
@Ray-jg5dj 5 жыл бұрын
"Ce qui se conçoit bien s'énonce clairement et les mots pour le dire vous viennent aisément." Rough translation : "What is nicely designed is easily explained". If you have trouble explaining what one of your classes do, rethink the class.
@NighthowlsMusic
@NighthowlsMusic 7 жыл бұрын
I love this video! It was incredibly informative and enthusiastic over something so tedious. I started to freak out at the 1 min mark. I started in Python but this has motivated me to start jumping into JS. Cheers!
@maaziik1166
@maaziik1166 4 жыл бұрын
Such a great video, even though I didn't understand a single word. This got me so hyped, guess I am going to start coding
@2b4u-lmpedro14
@2b4u-lmpedro14 5 жыл бұрын
I'm trying to learn to code. The basics r so boring but I learn so much for these video your fast pace and explaining as you go really keeps me watching
@Robertlavigne1
@Robertlavigne1 7 жыл бұрын
Wow!! just found your channel and I have to say you are a boss. No way I could do that in the time you banged it out and I do a lot of topcoder competitions. You earned my sub. I think an efficient data structure for the snake would be a circular linked list. As only the last block and first block are moving. I guess this assumes that the snake is moving one grid per time unit though which I don't remember if yours was doing. But I suppose we can leave optimizations for the C monkeys.
@BulldogMindsetArchive
@BulldogMindsetArchive 7 жыл бұрын
Definitely incredible. It definitely caught my attention ha
@chrit8519
@chrit8519 7 жыл бұрын
Love his enthusiasm when he making these video. You can tell he has so much passion for what he does.
@SvetiMFNikola
@SvetiMFNikola 6 жыл бұрын
because of you, I started to learn some programming and coding...inspiration!!!
@opannefrank1986
@opannefrank1986 6 жыл бұрын
dope a pod. I just got into coding, and this was a mind trip to say the least. i can't wait to get this knowledgeable.
@gnamp
@gnamp 7 жыл бұрын
If only we could pull that "technical difficulties" trick during our final exams...
@TheCodingTrain
@TheCodingTrain 7 жыл бұрын
Hah!
@CaioDanielNunesSantos
@CaioDanielNunesSantos 7 жыл бұрын
I spent several days to do it in Assembly
@ScibbieGames
@ScibbieGames 7 жыл бұрын
Caio Daniel Nunes Santos why would you do that in assembly.. mad respect but it's not really necessary..
@CaioDanielNunesSantos
@CaioDanielNunesSantos 7 жыл бұрын
Scibbie / ǝıqqıɔS It's not necessary, but it's fun.
@CaioDanielNunesSantos
@CaioDanielNunesSantos 7 жыл бұрын
Haeral It's not a good language for everything, but it's one of the easier ones after BASIC.
@ScibbieGames
@ScibbieGames 7 жыл бұрын
Caio Daniel Nunes Santos I can understand it's fun, if you like doing that then I'm sure you'll be a great programmer. I tried to understand it . but my code never runs, but assembly is really cpu-specific which is a thing I don't like that much xD. still, MAD RESPECT
@CaioDanielNunesSantos
@CaioDanielNunesSantos 7 жыл бұрын
I'm not a programer, and I won't be. But I alays make it for fun. Follow me on Git Hub: github.com/caillouplus
@pikachuu3542
@pikachuu3542 4 жыл бұрын
I dont know anything about programming but i enjoyed watching this video
@aaronsundstrom9921
@aaronsundstrom9921 4 жыл бұрын
Huwaran GT same
@all-roundtech4872
@all-roundtech4872 5 жыл бұрын
How many of you are understanding nothing but still watching 😂😂😂
@sabirnawaz1304
@sabirnawaz1304 5 жыл бұрын
Manisha Mhetre
@supercool1312
@supercool1312 5 жыл бұрын
Manisha Mhetre me
@abbywiley6467
@abbywiley6467 5 жыл бұрын
Not me, I've been studying processingJS for months now. I understand everything he's saying. Have an outstanding day!!!
@chappie3642
@chappie3642 5 жыл бұрын
@@abbywiley6467 who cares lol, and processing isn't that hard of a thing
@abbywiley6467
@abbywiley6467 5 жыл бұрын
@@chappie3642 Good point, I agree. processing isn't that hard, I'm just prideful that I'm 12 and understand it while some people at my school don't care enough about anything to even try to do mental math and when given the opportunity, will only use the calculator.
@BulldogMindsetArchive
@BulldogMindsetArchive 7 жыл бұрын
This was amazing lol Will definitely consider doing some of those for my channel Ha! Amazing video
@ayazahmad6378
@ayazahmad6378 7 жыл бұрын
respect..nice to see
@radioleta
@radioleta 7 жыл бұрын
Hey, John. I din't expect to find you here!
@toxanism6050
@toxanism6050 6 жыл бұрын
were you using atom
@mrcoolgoat9391
@mrcoolgoat9391 7 жыл бұрын
lmao when he turned the volume down I turned it up just before
@joem8251
@joem8251 5 жыл бұрын
Your tutorials are helpful. I recommend losing the time limit for most videos. A calm problem solver is more effective, applicable, and instructional. An arbitrary time limit can be meaningless without statistical metrics and a rigorous measure of problem complexity; but even then, a strong focus on time limits seems to be detrimental. Either way I appreciate your effort!
@carloscabrera8446
@carloscabrera8446 5 жыл бұрын
Started programming today, will share when I'm able to do it, love ur vids, keep it up:)
@TheCodingTrain
@TheCodingTrain 5 жыл бұрын
Thank you!
@immortalgamerz5599
@immortalgamerz5599 3 жыл бұрын
Did u ever learn carlos
@Philgob
@Philgob 7 жыл бұрын
I am watching this but I literally have NO idea what's going on
@TheCodingTrain
@TheCodingTrain 7 жыл бұрын
+Philgob 😁
@RAIRAIIRAI
@RAIRAIIRAI 7 жыл бұрын
same xD
@jezd2223
@jezd2223 7 жыл бұрын
same!
@devolee8302
@devolee8302 6 жыл бұрын
Not alone.. unless you have some ideas by now.. LOL!!
@Lamarsh67
@Lamarsh67 7 жыл бұрын
I've been feeling bummed about my coding ability lately because I'm entering the final year of my university degree and university has been such an awful experience for me. I decided to attend a technical institute next year and complete a two year program for a computer systems technology diploma. Initially seeing this video made me sad because I know I'd never be at your level but when you didn't complete it in the time limit and had so many other things to solve after the fact, it just resonated with me so much and I felt the exact same feelings when I'm working on a difficult assignment. You have that initial clarity and almost simplistic idea of the assignment but then you start coding and the devil really is in the details which only becomes apparent the more you code. Thank you for being so inspiring and I really want to commend you on your skill as a programmer!! Cheers.
@TheCodingTrain
@TheCodingTrain 7 жыл бұрын
love this comment!
@KunwaringVlogTV
@KunwaringVlogTV 6 жыл бұрын
Thank god found this channel. Please do more games so I could check your algorithms and learn from them. Keep it up
@matrixluk103
@matrixluk103 5 жыл бұрын
Very, very good and amazing js coding tutorial! Interesting and a suspenseful movie! Thank you very much:D
@ChuckNorrisRullZz
@ChuckNorrisRullZz 7 жыл бұрын
You are seriously the most entertaining person while teaching code! Wish my professors were like you. lol Been binge watching all your Code Challenges
@TheCodingTrain
@TheCodingTrain 7 жыл бұрын
Thanks for the nice feedback!
@MrCKay26
@MrCKay26 7 жыл бұрын
There's a neat way of implementing a snake: You might notice that none of the snake elements, except the first and the last change. So you could simply create a dequeue, and every time the snake moves, an element gets added to the head (as the snakes current head + it's speed) and an element removed from it's tail. When the snake eats the food, you simply don't remove the element from it's tail. An efficient dequeue would ensure that snake.update is an O(1) operation, as opposed to shifting which is an O(n) operation, where n is the size of the snake. Simpler and Faster code! Also all food collisions and edge collisions would need to only check the head against them, which I think you're doing already, so that's not much of an improvement. I would suggest creating a new Snake object when a collision happens however, so that it's obvious that the snake starts over.
@empoliyis1127
@empoliyis1127 3 жыл бұрын
Man it makes me happy seeing how much fun u have coding :)
@cannabisanomaly
@cannabisanomaly 11 ай бұрын
What an absolute madman and even more-so, an icon. I can only hope to have an iota of your brilliance at any given time in my life
@job2k656
@job2k656 8 жыл бұрын
I'm currently in college and just finished the second semester of my program where we covered basic JavaScript. I'd love to have you as a teacher for JS. The classes would be hilarious and highly educational. I'll have to settle for the videos, which are also great! Cheers.
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
+job2k6 Thanks for the nice feedback!
@burzumumbra
@burzumumbra 8 жыл бұрын
+job2k6 I support dat thought, at my colleger they didn't teach JS or nothin related to web.
@tim..indeed
@tim..indeed 8 жыл бұрын
+Ronald Flores That's weird. What did you study?
@burzumumbra
@burzumumbra 8 жыл бұрын
+Tim Fischer Computer Ing.
@locrates
@locrates 7 жыл бұрын
i know nothing of code. reeeealy wanted to see it complete =/
@radecreative6620
@radecreative6620 7 жыл бұрын
Same
@T0ly113
@T0ly113 7 жыл бұрын
locrates just learn to code?
@locrates
@locrates 7 жыл бұрын
You know- Id love to learn but I'm such a slow learner. I have a couple of graphic designs for apps, one I know damn well facebook would be down to buy.. I'm simply hoping my youtube channel next year helps me be put in the position I could work with someone who really knows what they are doing to make the app possible..
@vernonalbayeros4719
@vernonalbayeros4719 7 жыл бұрын
if you want to learn at your own pace, hit codeacademy up, it's got free courses on c,c++, python and javascript. Udemy sometimes offers discounts on their courses for around 15€ if you want more advanced stuff :)
@izybit
@izybit 7 жыл бұрын
You can check freecodecamp.com for completely free coding lessons.
@whoami1223
@whoami1223 3 жыл бұрын
he couldve done this in 5 minutes if he wasnt worried about the time or explaining what everything is.
@OfficialZaire
@OfficialZaire 3 жыл бұрын
In Italy they'd called him "fulminato"
@iamoneofHERO
@iamoneofHERO 3 жыл бұрын
And the moronic acting too
@siddharthswami9148
@siddharthswami9148 3 жыл бұрын
Exactly
@matiastoledo4201
@matiastoledo4201 3 жыл бұрын
He should had either focus on doing the challenge or just making a good video explaining the code as he was writing it, but still the video was simple and understandable
@georgiymalinovskiy3118
@georgiymalinovskiy3118 3 жыл бұрын
His amusing behaviour is what makes it worth WATCHING, if I need to get a quick ref - I'l check github sources or whatever.
@Andresdas
@Andresdas 5 жыл бұрын
I just found this randomly and I like how you learn while you tech, great job dude keep on it 👏
@korujaa
@korujaa 7 жыл бұрын
Great, now do Battlefield code.
@TheCodingTrain
@TheCodingTrain 7 жыл бұрын
Oh, live this idea!
@truekep
@truekep 7 жыл бұрын
in 10 minutes
@korujaa
@korujaa 7 жыл бұрын
TK TrueKep hahahaaaahahah
@FTWMFXD
@FTWMFXD 7 жыл бұрын
that works*
@justskillfull
@justskillfull 7 жыл бұрын
while(connected){ disconnect() }
@n00bie96
@n00bie96 7 жыл бұрын
1. I don't get why this popped on my recomended videos list 2. I clicked this because I'm curious (also after finishing 2 seasons of Mr.Robot and learned python 2.7 and 3 ish) 3. the fact that he's like he lost his mind and recorded this alone, gives me an image of what the average programmers look like
@glokta1
@glokta1 7 жыл бұрын
n00bie Lmao exact situation I am in. Where are you learning Python from and how far have you gone?
@n00bie96
@n00bie96 7 жыл бұрын
TechyBoyProductions what are the odds. I only took free courses from I forgot his name (zed something, look it up) also from a phone app 'Learn Python' (forgot the developer). Currently laying my fingertips on Object Oriented Programming and it's intrigued me in many ways. Also still need to memorize some syntaxes though. You?
@glokta1
@glokta1 7 жыл бұрын
n00bie Just KZfaq basically. I've learned the loops and all and now I'm just practicing by looking up exercises to do. Check out Automate the Boring Stuff with Python, it's a great book to learn python. It's for free on the author's website. Oh and I think you're taslking about Learn Python The Hard Way by Zed Shaw.
@Dude-kd3ey
@Dude-kd3ey 7 жыл бұрын
Lol Mr robot brought me here too xD
@pie7747
@pie7747 4 жыл бұрын
the best to master something is learn from mistakes, when other videos shows they' have non mistakes during program it, it's hard to understand each of the component . this is an excellent example to learn and understand parts by parts. thanks sir
@nerdiousgaming3835
@nerdiousgaming3835 5 жыл бұрын
Couldn't hold my self from subscribing and Liking this Video Thanks a bunch, twas sooo great and fun
@MunyokiKilyungi
@MunyokiKilyungi 7 жыл бұрын
Amazing dude. Please upload more videos. Can you do Tetris?
@TheCodingTrain
@TheCodingTrain 7 жыл бұрын
definitely will consider it!
@bYgfoot
@bYgfoot 7 жыл бұрын
really cool video it thought me a lot about java script I use the gamemaker engine and i'm really considering using java script
@rowanburns4841
@rowanburns4841 7 жыл бұрын
Subbed, glad this was on my recommended
@iYankrozHD
@iYankrozHD 6 жыл бұрын
I went ahead and coded this challenge before watching this and I was using a Block class to keep track of each individual part of the snake and also had to keep track of positions when the user pressed a key to know when the blocks should change direction etc.. Your solution was sooo much simpler :D
@shirazimam21
@shirazimam21 5 жыл бұрын
thank you! you are such a brilliant guy. im gonna start learning things from your channel. i cannot support with money but what i can do is subs ur channel and watch it ever time you update. pls keep making us understand that coding is fun. i really mean it. thank you one more time!
@violencechildren7603
@violencechildren7603 7 жыл бұрын
Challenge Recuest... Online FPS game with realistic graphics in 10 seconds please
@dazzyx3644
@dazzyx3644 7 жыл бұрын
lets give him 11 seconds just cuz he has to make it online Kappa
@Heidjnejdihbwjdihnskdhbe
@Heidjnejdihbwjdihnskdhbe 7 жыл бұрын
Classic programmer/developer/coder ( whatever you prefer ), always underestimating the time needed. Think of a project and be like "hmm, ok I can nail this in 15 minutes", 30 minutes later, not yet finished, "why do I always do this!?!?!?!".
@TheCodingTrain
@TheCodingTrain 7 жыл бұрын
+John Doe so true.
@sureshcarpenter7797
@sureshcarpenter7797 5 жыл бұрын
man you are so funny your sense of humour is great although nice coding
@P7.001
@P7.001 4 жыл бұрын
I love your charisma! I subscribed within the first 3 minutes!
@tonewipera
@tonewipera 7 жыл бұрын
You totally remind me of myself when I am solving something in the code.... talking to my self like you do to us. Neat video.
@Juke172
@Juke172 7 жыл бұрын
tonewipera that's like rubber duck debugging. Really helps :D
@thesmileynoob
@thesmileynoob 7 жыл бұрын
Man you are amazing! Subscribed! Also its nice that you explain stuff along the way. Keep it up.
@TheCodingTrain
@TheCodingTrain 7 жыл бұрын
Thanks for watching!
@granumuse7847
@granumuse7847 4 жыл бұрын
Man you are my hero!! You have coded so many things so far!!! Thank you!!!!
@airaielion
@airaielion 4 жыл бұрын
This was hella cool! Awesome video!
@Yorelz
@Yorelz 7 жыл бұрын
Wow a guy that can actually keep me interested and still tell me what the stuff does
@TheRealDexeN_
@TheRealDexeN_ 7 жыл бұрын
24:48 - look at his face :D:D:D - runs the snake backwards. - dies from it - doesn't know whats going on - realizes that the "death" really worked, because he just died by running backwards.. - realizes that it's actually impossible to run backwards in the original game AT ALL - ...? :D its actually entertaining watching you code :D
@gendawg4584
@gendawg4584 4 жыл бұрын
Despite the time limit and building from scratch. You are really great at explaining. Better then most how to code tutorials....
@masonengland306
@masonengland306 2 жыл бұрын
“Debugging” means awkwardly staring at the code and doing nothing wondering where you went wrong…then spacing out
@haider4899
@haider4899 7 жыл бұрын
FUCKIN hell. there's no way i can think of EXACTLY which methods I'd need beforehand. I'd add method as I need them. how are you able to do it? are you on drugs? did you plan it beforehand? i think you did.
@baqikenny
@baqikenny 7 жыл бұрын
cocaine is a hell of a drug son
@haider4899
@haider4899 7 жыл бұрын
yeah, i never fuck around with JavaScript graphics stuff but I'm slowly getting into it. seems like he's also pretty familiar with the p5 framework. I'll have to read the docs, like for 20 mins before I can draw a single rectangle.
@baqikenny
@baqikenny 7 жыл бұрын
candh he's probably a teacher lol
@baqikenny
@baqikenny 7 жыл бұрын
Demonism yeah all the confidence and passion with his job haha
@baqikenny
@baqikenny 7 жыл бұрын
Demonism just like your name
@solemnej6270
@solemnej6270 7 жыл бұрын
Ive only coded in computer class and i built a website that was total clickbait and it was super fun (but i cant code like this guy FeelsBadMan)
@srgiggity
@srgiggity 7 жыл бұрын
keep learning my dude. you'll get there
@adlanehichembriki1831
@adlanehichembriki1831 7 жыл бұрын
Trump Hates carrots dota fan?
@sandeepyadav-dn5sw
@sandeepyadav-dn5sw 5 жыл бұрын
funniest programmer i have ever seen , i liked it, i want to learn from you!!!!
@opetrescu
@opetrescu 5 жыл бұрын
You're the boss of cool nerds. Thank you for this!
@thehomierudy1190
@thehomierudy1190 7 жыл бұрын
I've never seen anything like this and have no idea what any of this stuff means or how's he's doing it but I'd love to learn how its very interesting. you've gained a new sub
@jonhtte
@jonhtte 7 жыл бұрын
My mind just blew up.
@NataschaYT
@NataschaYT 6 жыл бұрын
It's very helpful that you say whatever you think, that way I can follow your whole train of thought and learn from my own initial wrong guesses :)
@prajwalbk5725
@prajwalbk5725 4 жыл бұрын
Dude you are the best. Watched one video on making purple rain. Now I'm just addicted to your videos. :P
@doodlemonstah5656
@doodlemonstah5656 7 жыл бұрын
him: "I don't really want to use 'death' as a variable name" me: uses death as often as possible
@Entertainer760
@Entertainer760 7 жыл бұрын
I'm not quite sure how I found you, but your channel is awesome! Keep up the great work! :) +1 sub
@TheCodingTrain
@TheCodingTrain 7 жыл бұрын
Thanks for watching!
@gentleasp6589
@gentleasp6589 Жыл бұрын
subCount++
@danieljulien4099
@danieljulien4099 4 жыл бұрын
you are so great!!! so funny, brilliant, like a brain stimulator haha. i’m new to code, addicted to learning and using it, so i installed git last week! this is how i discovered your channel with the video series « git for poets », a true masterpiece! thank youuuuu haha! i’m a fan now! and you dont know it but you are my teacher from now on. you cover so many different things, just great! and sooooo fun to watch! 🤙🏾❤️
@cipherhex
@cipherhex 3 жыл бұрын
I think I've watched every Coding Rainbow/Train/Cubana... I'm very glad Dan didn't keep with the timed format 👍 Its much more relaxing content to enjoy when he's not panicked up to the eyeballs 😂
Coding Challenge #4: Purple Rain in Processing
12:14
The Coding Train
Рет қаралды 1,9 МЛН
Coding Challenge #115: Snake Game Redux
35:04
The Coding Train
Рет қаралды 180 М.
UFC Vegas 93 : Алмабаев VS Джонсон
02:01
Setanta Sports UFC
Рет қаралды 204 М.
Coding Challenge #71: Minesweeper
53:46
The Coding Train
Рет қаралды 525 М.
Throbber #genuary7
0:53
The Coding Train
Рет қаралды 40 М.
I Made a Neural Network with just Redstone!
17:23
mattbatwings
Рет қаралды 600 М.
Coding Challenge 180: Falling Sand
23:00
The Coding Train
Рет қаралды 767 М.
Coding Challenge: 3D on Apple II
45:40
The Coding Train
Рет қаралды 320 М.
Async JS Crash Course - Callbacks, Promises, Async Await
24:31
Traversy Media
Рет қаралды 1,4 МЛН
Coding Challenge #85: The Game of Life
38:20
The Coding Train
Рет қаралды 678 М.
Coding Challenge #7: Solar System in Processing - Part 1 (2D)
30:47
The Coding Train
Рет қаралды 240 М.
VOLT: Das steckt hinter dem Erfolg!
20:20
DIE DA OBEN!
Рет қаралды 151 М.
UFC Vegas 93 : Алмабаев VS Джонсон
02:01
Setanta Sports UFC
Рет қаралды 204 М.