Coding Challenge #3: The Snake Game

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ย. 2024

ความคิดเห็น • 3.5K

  • @TheCodingTrain
    @TheCodingTrain  5 ปีที่แล้ว +293

    If you want to know what happened during "technical difficulties"! th-cam.com/video/yUO2bWfBgN8/w-d-xo.html

    • @dixoncyprian8633
      @dixoncyprian8633 5 ปีที่แล้ว +1

      cool bro

    • @cmdvoid
      @cmdvoid 4 ปีที่แล้ว +1

      So fast😮

    • @Nurutomo
      @Nurutomo 4 ปีที่แล้ว +2

      Why not using "shift()" "unshift" "pop()" "push()"?

    • @nugs2727
      @nugs2727 4 ปีที่แล้ว +1

      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 ปีที่แล้ว +1

      Wow wow wow

  • @captstrugglebunny
    @captstrugglebunny 5 ปีที่แล้ว +336

    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 ปีที่แล้ว +5

      I'd pay a quarter to play snake

    • @bleepboop
      @bleepboop ปีที่แล้ว +6

      The framework does some pretty heavy lifting here compared to 1976-versions

    • @shanewalsch
      @shanewalsch 8 หลายเดือนก่อน +1

      ​@@bleepboopthe main loop and drawing. Its not that hard to implement yourself

    • @rdevan3245
      @rdevan3245 5 หลายเดือนก่อน +2

      ​@@shanewalschcool. Now try it with the technology that was actually available in 1976 lmao

  • @Warm_Ice0
    @Warm_Ice0 7 ปีที่แล้ว +1667

    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 ปีที่แล้ว +7

      Daniel Esen J. Oliviėr I think TH-cam can read my mind ;)

    • @diyansueka3192
      @diyansueka3192 7 ปีที่แล้ว

      Yes

    • @عبدالحليم-و3ه
      @عبدالحليم-و3ه 7 ปีที่แล้ว +9

      yep...i want to learn how to programme and how to code :/ and then this guy comes out :D

    • @Hanzi2u
      @Hanzi2u 7 ปีที่แล้ว +12

      Daniel Esen J. Oliviėr yes i just watched the purple rain video by him

  • @wifeless
    @wifeless 5 ปีที่แล้ว +919

    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!

  • @AjeetSingh-xq4yb
    @AjeetSingh-xq4yb 7 ปีที่แล้ว +448

    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 ปีที่แล้ว +42

      +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 ปีที่แล้ว +1

      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 ปีที่แล้ว +2

      this appeared on my recommended because i learn python

    • @Dylan5246
      @Dylan5246 7 ปีที่แล้ว +3

      X-Core Aleph but this is javascript

  • @Lamarsh67
    @Lamarsh67 7 ปีที่แล้ว +5

    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.

  • @ALLCAPS
    @ALLCAPS 7 ปีที่แล้ว +16

    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 ปีที่แล้ว +5

      Heh, thanks for the feedback. :)

    • @ALLCAPS
      @ALLCAPS 7 ปีที่แล้ว +3

      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.

  • @NiiAnikin
    @NiiAnikin 4 ปีที่แล้ว +5

    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

  • @quantumvac7737
    @quantumvac7737 7 ปีที่แล้ว +428

    Him Talking : 15 minute challenge
    On-screen Bar : 10 Minute Challenge
    Video Length : 30 Minutes
    Me : Seems Legit.

    • @jonathanmorrison8223
      @jonathanmorrison8223 6 ปีที่แล้ว +14

      15:25 lol

    • @kingfoxx6697
      @kingfoxx6697 5 ปีที่แล้ว +1

      😂😂

    • @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 3 ปีที่แล้ว +1

      @@skilz8098... Wrong thread? I don't believe what you just said is relevant to anything in this comment section.

  • @dm8dd
    @dm8dd 8 ปีที่แล้ว +9

    genius, haven't coded for 15 years, tempted to have a go again. thanks bro!

  • @FelixxFelixx-tt7sf
    @FelixxFelixx-tt7sf 4 ปีที่แล้ว +7

    I dont know how, but in only 15 minutes, you taught me more than multiple hours of someone speaking my language

  • @EdwardGordington
    @EdwardGordington 7 ปีที่แล้ว +453

    i want whatever this guys having lmfao.

    • @TheCodingTrain
      @TheCodingTrain  7 ปีที่แล้ว +129

      +Mazzza3 chamomile tea.

    • @hatben
      @hatben 7 ปีที่แล้ว +11

      Posted on 4/20 :P

    • @mkmush1982
      @mkmush1982 7 ปีที่แล้ว +7

      Daniel Shiffman more like Daniel Sniffman.. But great video!

    • @roychh1
      @roychh1 7 ปีที่แล้ว +7

      meth

    • @iwanttodie8331
      @iwanttodie8331 7 ปีที่แล้ว +4

      I dun bet it's Adderal

  • @joem8251
    @joem8251 5 ปีที่แล้ว +7

    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!

  • @juleslardon3036
    @juleslardon3036 7 ปีที่แล้ว +1005

    how gome i enjoy watching you code but i dont accually know how to code :P

    • @TheCodingTrain
      @TheCodingTrain  7 ปีที่แล้ว +79

      +TheBaconGamer that is amazing to me. Go back and watch my intro to JavaScript playlist and learn!

    • @juleslardon3036
      @juleslardon3036 7 ปีที่แล้ว +19

      +Daniel Shiffman i will :D

    • @11ditto11
      @11ditto11 7 ปีที่แล้ว

      TheBaconGamer hahaha I was thinking exactly the same

    • @epilefchannel9424
      @epilefchannel9424 7 ปีที่แล้ว +6

      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

  • @job2k656
    @job2k656 8 ปีที่แล้ว +10

    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 ปีที่แล้ว +2

      +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.

  • @MrCKay26
    @MrCKay26 7 ปีที่แล้ว +21

    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.

  • @Robertlavigne1
    @Robertlavigne1 8 ปีที่แล้ว +39

    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 8 ปีที่แล้ว +7

      Definitely incredible. It definitely caught my attention ha

  • @CaioDanielNunesSantos
    @CaioDanielNunesSantos 7 ปีที่แล้ว +337

    I spent several days to do it in Assembly

    • @ScibbieGames
      @ScibbieGames 7 ปีที่แล้ว +38

      Caio Daniel Nunes Santos why would you do that in assembly.. mad respect but it's not really necessary..

    • @CaioDanielNunesSantos
      @CaioDanielNunesSantos 7 ปีที่แล้ว +20

      Scibbie / ǝıqqıɔS It's not necessary, but it's fun.

    • @CaioDanielNunesSantos
      @CaioDanielNunesSantos 7 ปีที่แล้ว +5

      Haeral It's not a good language for everything, but it's one of the easier ones after BASIC.

    • @ScibbieGames
      @ScibbieGames 7 ปีที่แล้ว +1

      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 ปีที่แล้ว +4

      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

  • @maluxon5324
    @maluxon5324 6 ปีที่แล้ว +1

    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 ^^

  • @kenneybohjort4314
    @kenneybohjort4314 8 ปีที่แล้ว +49

    The adderall is strong in this one :D

  • @gnamp
    @gnamp 8 ปีที่แล้ว +18

    If only we could pull that "technical difficulties" trick during our final exams...

  • @pikachuu3542
    @pikachuu3542 4 ปีที่แล้ว +2

    I dont know anything about programming but i enjoyed watching this video

  • @BulldogMindsetArchive
    @BulldogMindsetArchive 8 ปีที่แล้ว +339

    This was amazing lol
    Will definitely consider doing some of those for my channel Ha!
    Amazing video

    • @ayazahmad6378
      @ayazahmad6378 8 ปีที่แล้ว +7

      respect..nice to see

    • @radioleta
      @radioleta 7 ปีที่แล้ว +4

      Hey, John. I din't expect to find you here!

    • @toxanism6050
      @toxanism6050 6 ปีที่แล้ว

      were you using atom

  • @haider4899
    @haider4899 7 ปีที่แล้ว +99

    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 ปีที่แล้ว +26

      cocaine is a hell of a drug son

    • @haider4899
      @haider4899 7 ปีที่แล้ว +12

      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 ปีที่แล้ว +8

      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

  • @bersi3306
    @bersi3306 หลายเดือนก่อน

    I like how he spares no words for the explaination against the time...he just speaks faster

  • @unclefkr8945
    @unclefkr8945 7 ปีที่แล้ว +16

    Just got accepted to the CodeCamp offered by Launch Code. Super exited to learn coding and get a job as a programmer!

  • @Miiney23
    @Miiney23 5 ปีที่แล้ว +2

    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.

  • @Heidjnejdihbwjdihnskdhbe
    @Heidjnejdihbwjdihnskdhbe 7 ปีที่แล้ว +6

    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!?!?!?!".

  • @looch95
    @looch95 6 ปีที่แล้ว

    I love how much you explain your code, really helps us beginners, especially the diagrams.

  • @MunyokiKilyungi
    @MunyokiKilyungi 8 ปีที่แล้ว +30

    Amazing dude. Please upload more videos. Can you do Tetris?

    • @TheCodingTrain
      @TheCodingTrain  8 ปีที่แล้ว +28

      definitely will consider it!

    • @bYgfoot
      @bYgfoot 8 ปีที่แล้ว

      really cool video it thought me a lot about java script I use the gamemaker engine and i'm really considering using java script

  • @thehomierudy1190
    @thehomierudy1190 7 ปีที่แล้ว +6

    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

  • @OakSwami
    @OakSwami 6 ปีที่แล้ว +4

    Damn dude...
    You make programming so intertaining!
    Im gonna start watching your vids to learn and try to pass my subject. xD

  • @violencechildren7603
    @violencechildren7603 8 ปีที่แล้ว +31

    Challenge Recuest... Online FPS game with realistic graphics in 10 seconds please

    • @dazzyx3644
      @dazzyx3644 8 ปีที่แล้ว +27

      lets give him 11 seconds just cuz he has to make it online
      Kappa

  • @maaziik1166
    @maaziik1166 4 ปีที่แล้ว +6

    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

  • @Ergoperidot
    @Ergoperidot 7 ปีที่แล้ว +46

    I'm currently 19 and thinking about majoring in computer science. I can only dream of the day I can do something like this...

    • @MrJeng300
      @MrJeng300 7 ปีที่แล้ว +12

      Rin Tezuka well then start game programming as a hobby! I could make stuff like snake or simple platformers when i was 14 or so, just because i really wanted to make games! so many great tutorials and stuff online!

    • @MrJeng300
      @MrJeng300 7 ปีที่แล้ว

      *****
      I'd say Java is a good start because you can make a LOT of stuff with it right out of the box, without the need for external libraries. Personally, I'd start with C nowerdays, to get a better grasp of the basics, but really, it doesn't matter as long as you do something.

    • @MrJeng300
      @MrJeng300 7 ปีที่แล้ว

      *****
      I think it depends a lot on the type of person. For me, the beginning was pretty easy and I made small games with Java pretty soon. With some dedication and effort you can be coding games in like a week!

    • @MrJeng300
      @MrJeng300 7 ปีที่แล้ว +1

      *****
      Yeah, I taught myself though and it was still a good experience. Nowerdays great tutorials on programming are everywhere! I did start with a youtube series that the creator nowerdays sells though, so it was indeed quite a good source. Anyways, you can always find help in forums and stuff if you need it!

    • @MrJeng300
      @MrJeng300 7 ปีที่แล้ว +1

      *****
      Those drag&drop tools are a cool way for introduction, but if you actually wanna do something with programming later I would recommend learning a proper language. Many find python being a good way to start. I personally don't like python too much and started with visual basic and later Java myself, but that is totally up to you, really. You will learn more languages later anyways. If you wanna go the hard but possibly better way, I'd start with learning C. Getting a hang of pointers & memory management can be a huge boost in understanding what your code does. The biggest factor anyways, is that you do start. Make coding a habit, learn something new every week! Have fun!

  • @SammYLightfooD
    @SammYLightfooD 6 ปีที่แล้ว

    I didnt code in python for 2 years and now I built a working Snake game in an evening. Thanks for this!!

  • @deeeeeds
    @deeeeeds 7 ปีที่แล้ว +11

    it's a shame you cut the debugging out, it's really interesting to watch the process.

    • @TheCodingTrain
      @TheCodingTrain  7 ปีที่แล้ว +11

      +SenoreQueso if you watch my live stream archives nothing is cut out!

  • @all-roundtech4872
    @all-roundtech4872 5 ปีที่แล้ว +604

    How many of you are understanding nothing but still watching 😂😂😂

    • @sabirnawaz1304
      @sabirnawaz1304 5 ปีที่แล้ว +1

      Manisha Mhetre

    • @supercool1312
      @supercool1312 5 ปีที่แล้ว +1

      Manisha Mhetre me

    • @abbywiley6467
      @abbywiley6467 5 ปีที่แล้ว +18

      Not me, I've been studying processingJS for months now. I understand everything he's saying. Have an outstanding day!!!

    • @chappie3642
      @chappie3642 5 ปีที่แล้ว +19

      @@abbywiley6467 who cares lol, and processing isn't that hard of a thing

    • @abbywiley6467
      @abbywiley6467 5 ปีที่แล้ว +11

      @@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.

  • @pdrgallo
    @pdrgallo 7 ปีที่แล้ว +9

    I dont know the first thing about programming but i really enjoyed it somehow. I like how your mind works

  • @rowanburns4841
    @rowanburns4841 7 ปีที่แล้ว +13

    Subbed, glad this was on my recommended

  • @professorspace3485
    @professorspace3485 5 ปีที่แล้ว +1

    Doesn't matter whatever time you took.
    Best part is, you make everything easist for learners to learn! 😊

  • @Orangeszs
    @Orangeszs 7 ปีที่แล้ว +4

    Description: Welcome to this 10 minute coding challenge.
    Video Intro: Welcome to this 15 minute coding challenge.
    Video Length: 27 minutes

  • @smilingalpaca1025
    @smilingalpaca1025 5 ปีที่แล้ว +5

    I can't believe the fact that I've watched this vid a few months ago without any knowledge for programming and now I'm here again realising that he's actually using Processing, that I'm actually learning with

  • @prajwalbk5725
    @prajwalbk5725 4 ปีที่แล้ว

    Dude you are the best. Watched one video on making purple rain. Now I'm just addicted to your videos. :P

  • @oscart4368
    @oscart4368 7 ปีที่แล้ว +98

    I know nothing about coding. Why am I watching this?

    • @sudoaj
      @sudoaj 7 ปีที่แล้ว +49

      MLG POE so u can learn it

    • @parkjiminz2556
      @parkjiminz2556 7 ปีที่แล้ว +6

      MLG POE will propably be the best thing you could ever learn in life

    • @Dino-Kupinic
      @Dino-Kupinic 7 ปีที่แล้ว +2

      true.

    • @devolee8302
      @devolee8302 7 ปีที่แล้ว +1

      Cause it is entertaining.. This guy rocks!!

    • @chacalXXX
      @chacalXXX 6 ปีที่แล้ว

      "will probably be the best thing you cold ever learn in life"
      can you tell me exactly why? As extensively as a YT comment allows it to be? I've been flirting with the idea of getting into coding, but I guess I just need some reason to do it

  • @belskysol
    @belskysol 5 ปีที่แล้ว +1

    these videos are seriously amazing, really helpful for someone who wants to learn coding.

  • @roversfan1115
    @roversfan1115 8 ปีที่แล้ว +42

    1. var subscriberCount = subscriberCount + 1;
    error!

    • @TheCodingTrain
      @TheCodingTrain  8 ปีที่แล้ว +3

      +roversfan 111 hah!

    • @xenithmusic3029
      @xenithmusic3029 7 ปีที่แล้ว +3

      Code Fix!
      loc(1)
      wait(59)
      update(SubscribedCount)
      if(SubscribedCount) = 100000 then
      playbutton(silver)
      if(SubscribedCount) = 1000000 then
      playbutton(gold)
      if(SubscribedCount) = 10000000 then
      playbutton(diamond)
      end
      end

    • @dimitri9502
      @dimitri9502 7 ปีที่แล้ว

      roversfan 111 i would use: subscriberCount++

    • @Tsskyx
      @Tsskyx 7 ปีที่แล้ว +3

      DevPlayz that's Ruby, but we're talking about Javascript. Here, lemme fix that for you:
      var subCount = subCount + 1;
      if (subCount >= 10000000) {
      playButton('diamond');
      } else if (subCount >= 1000000) {
      playButton('gold');
      } else if (subCount >= 100000) {
      playButton('silver');
      }

    • @m00str
      @m00str 7 ปีที่แล้ว

      Tsskyx no need to redefine subCount, so:
      subCount++;

  • @dog-tc5uc
    @dog-tc5uc 7 ปีที่แล้ว +41

    know 0 about coding. this is crazy

  • @adnanyjanuzaj19
    @adnanyjanuzaj19 6 ปีที่แล้ว

    I want to start coding but seriously you just freaked me out.
    And you are a genius!

    • @TheCodingTrain
      @TheCodingTrain  6 ปีที่แล้ว

      Try either of these playlists to start from scratch!
      th-cam.com/users/shiffmanplaylists?view=50&shelf_id=14&sort=dd
      th-cam.com/users/shiffmanplaylists?view=50&shelf_id=2&sort=dd

  • @georgie1874
    @georgie1874 7 ปีที่แล้ว +4

    you earned a sub. have no idea what is going on but I'm learning lol

  • @cannabisanomaly
    @cannabisanomaly ปีที่แล้ว

    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

  • @SvetiMFNikola
    @SvetiMFNikola 6 ปีที่แล้ว +1

    because of you, I started to learn some programming and coding...inspiration!!!

  • @shune84
    @shune84 7 ปีที่แล้ว +13

    in this.update he could have used "+=" right? im thinking for speed.

  • @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! 🤙🏾❤️

  • @fylmr
    @fylmr 7 ปีที่แล้ว +32

    This is just my tempo. Not boring as most lessons are, and also useful and fun to watch. Thanks!
    I also wanted to offer you Russian translation for your videos. I have a channel here which is not as popular as yours but has a couple of thousand subscribers that want to learn how to code. I like your style but don't like stealing, so if you're interested please e-mail me.

    • @TheCodingTrain
      @TheCodingTrain  7 ปีที่แล้ว +4

      Russian translation would be great!

  • @stingy1304
    @stingy1304 7 ปีที่แล้ว +5

    Idk how i got here. But the content is bomb, so i subbed and hit the bell.

  • @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 :)

  • @PushaaaT
    @PushaaaT 7 ปีที่แล้ว +5

    i dont code yet just watched this entire video gg

  • @YiftachShlezingerking
    @YiftachShlezingerking 6 ปีที่แล้ว +1

    What I did for the scale was just having 2 variables: size, and scale. The width of the canvas is width*size, and every time I draw the snake I just multiple every coordinate in the scale

  • @skilz8098
    @skilz8098 4 ปีที่แล้ว

    I've been following some of your videos for some time and I enjoy them. I don't know Java nor JavaScript all that well as I'm more familiar with the C languages mostly C++. I have learned a little bit of Python which isn't bad. For me, it's more about learning algorithms, specifically with machine learning, path-finding, A.I., etc. It's also fun to watch you do the code challenges. I don't know where to go to propose a challenge, so I'm hoping that here is good...
    My code challenge:
    I would like to see you implement a hardware emulator (CPU) with your own ISA (Instruction Set Architecture) and design an accompanying Assembler and Disassembler that works with it. It doesn't have to have a super complex instruction set, but at least the basics such as an early version of MIPs or the 6502... It could be 8, 16 or 32 bit your choice..., now this would make up the "back end" of the program.
    The middle end would be all of the graphical interfaces where you could animate the internal parts of the CPU for example, the registers, the data paths, the cache, the ALU, the Ram, etc. as you run a program that you have written to run on that emulated CPU. Besides the visual graphics of the hardware that is rendered within one viewport, you should have a second viewport that would draw the binary - hex code based on your Assembly language pneumonics. You can even add a few user controls that would adjust the speed of the CPU's clock, add control to pause it and step through the code, etc. You can create your own CPU as you don't have to design one that's already been done, but you can if you want, that's completely up to you. I'd just like to see what kind of steps you would go through in this entire process.
    The front end would be allowing users to write their own code based on your assembly language. They would be able to write programs and it should execute them if the assembler is able to build their object code, otherwise, it should generate the correct error messages either it be a syntax error, an invalid instruction such as an improper argument to a specific call, etc.
    You wouldn't have to do this in one quick video, you could do it in a mini-series such as one video for each of the major parts. For example, in the first video, you could set up a working framework. In your second video, an error handler, exception manager, a debugger, logger, etc. Then you could take a break from coding and the next video or videos you could just simply whiteboard the design of your intended CPU, its instruction set and the assembly language you are planning on implementing in code. The next video(s) would be programming the Hardware Emulator. Then it would be to program the assembler and disassemblers. The following video(s) would be showing how to write short programs that will run on the virtual CPU and checking the results via the console. Then you could display the running code in either binary or hex within a rendered table showing the associated assembly pneumonics with the opcodes split into its different arguments or fields while having the option to switch between binary and hex views, or just render both. In the last few videos, you could then begin the rendering or drawing process of the actual virtual CPU having its components light up or change color when they become active while also showing the direction of the data or signals are moving from and to. And finishing up with the frontend user interface.
    Something like this I think would make for a great mini-series watching you go through the process of building it. I'd like to see your thought process on how you would achieve this. The tools and languages of choice are completely yours to make! I just want to see you in action with your problem-solving abilities, the choices you would make. How you would go about tackling this project. Also, with this kind of challenge, try not to short cut anything. I'd like to see you in action as if this were to be a piece of production code!

  • @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.

  • @developertools95
    @developertools95 4 ปีที่แล้ว +23

    me : successfully prints "Hello World"
    I'm gonna hack Nasa now.

  • @P7.001
    @P7.001 4 ปีที่แล้ว

    I love your charisma! I subscribed within the first 3 minutes!

  • @skelia8343
    @skelia8343 5 ปีที่แล้ว +1

    It's amazing how you read the comments from a video 3 years ago

  • @badxcode
    @badxcode 4 ปีที่แล้ว +12

    He just named "s" to snake for saving time and wasted 2x time explaining why he named it "s" lmao

  • @mrsnoo86
    @mrsnoo86 7 ปีที่แล้ว +75

    omg my brain hurts a lot 😵😵

  • @brodileus
    @brodileus 4 ปีที่แล้ว

    Thanks so much for doing this video. I was just about to give up on javascript until I saw p5 here. It's the best tool I've used in a while, not to mention it's online. I don't have a computer so I rely on web-based things. All I've gotta do is find a java version of this and I'll be all set. I wish processing ran online Lol

  • @jaggerryan9425
    @jaggerryan9425 7 ปีที่แล้ว +15

    The numbers mason!! WHAT DO THEY MEAN?!?!

    • @jaggerryan9425
      @jaggerryan9425 7 ปีที่แล้ว +3

      Haha Jagger, you're so funny!

    • @jaggerryan9425
      @jaggerryan9425 7 ปีที่แล้ว +3

      Thanks Jagger

    • @jaggerryan9425
      @jaggerryan9425 7 ปีที่แล้ว +4

      you're welcome Jagger

    • @Bulsreder
      @Bulsreder 7 ปีที่แล้ว +2

      me 2 thanks

    • @dukethotness
      @dukethotness 7 ปีที่แล้ว +1

      Heard this after so many years :')

  • @tpolton36
    @tpolton36 4 หลายเดือนก่อน

    That was a wild ride my boy. This vid the other and back to finish.

  • @aid6n
    @aid6n 7 ปีที่แล้ว +8

    If you haven't already, code Tetris

  • @LordWannix
    @LordWannix 3 ปีที่แล้ว

    I don't know javascript but I understood the logic. Will try to do this in python. Thank you for this awesome video :)

  • @youngbeatboxmen
    @youngbeatboxmen 7 ปีที่แล้ว +5

    Next time GT VI in 20minutes ?
    This could be work ;)

    • @Agent-jf3eh
      @Agent-jf3eh 7 ปีที่แล้ว +1

      John Mwo No you could just do anything because there is no gta 6 so that's pretty easy

  • @mannys8887
    @mannys8887 6 ปีที่แล้ว

    I followed along and did it all but I feel just a little confused by what is exactly going on with the array "math" and how it is working. But im hoping the more I follow along , the more Ill understand. Thanks so much for making these!!

  • @StudioSerinn
    @StudioSerinn 6 ปีที่แล้ว

    Food as a vector was a good call. Using food as a value and not an object being the take away from this.

  • @colwarsstudiobrickfilmandm8580
    @colwarsstudiobrickfilmandm8580 4 ปีที่แล้ว +1

    This no joke got me in to game dev lol I'm glad this came on my recommendation page thanks youtube

  • @YoutubeChannel-oq6ss
    @YoutubeChannel-oq6ss 4 ปีที่แล้ว +4

    In the amount of time it took him to explain y it was called s instead of snake he cuda jus namned it snake

  • @retrotap
    @retrotap ปีที่แล้ว

    This was good fun, thanks. P5 looks pretty accessible

  • @exactiasgames
    @exactiasgames 8 ปีที่แล้ว +8

    Why why do you not have more subs then pewdiepie you should because you actually Code and create things while pewdiepie screams like a littl girl.

    • @noelearlwatson2724
      @noelearlwatson2724 8 ปีที่แล้ว

      Why why do you steal comments

    • @Limpuls
      @Limpuls 8 ปีที่แล้ว +6

      I'm not a fan of pewds, but if you think of him as little screaming girl, try to do the same or outwin him on youtube. Damn, his content is high quality, just from the comedy side. They both are good, but you can't say pewds is shit otherwise no one would watch him. And he no longer screams to the mic, he has changed for a while now. Don't try to compare them either.

    • @aiman_yt
      @aiman_yt 8 ปีที่แล้ว

      Pewdiepie is shit. period.

    • @RocketLR
      @RocketLR 8 ปีที่แล้ว

      Limpuls Is right. You try to have the same enthusiast as Pewdiepie, i bet you that you cant. Atleast not while still being funny or pleasant to watch. Also Pewdiepie is a king of editing. Not just his game videos. I actually prefer to watch pewds do other things than gaming. Mostly because very few games today are interesting and new.

  • @flobb91
    @flobb91 7 ปีที่แล้ว +17

    at 12:26 : cant you just *return (d < 1);* ?

    • @TheCodingTrain
      @TheCodingTrain  7 ปีที่แล้ว +18

      +flobb91 yes that would be a much shorter option!

    • @flobb91
      @flobb91 7 ปีที่แล้ว

      ok cool. thx for the answer :)

  • @engineeringfun5011
    @engineeringfun5011 6 ปีที่แล้ว

    Great man... Its Awesome... Feels very nice. Keep it up. I want to do Programming like this.

  • @yrnxthing
    @yrnxthing 6 ปีที่แล้ว +2

    what part of TH-cam have I stumbled into?
    I'm enjoying it so far tho, very interesting

  • @Hlidskialf
    @Hlidskialf 7 ปีที่แล้ว +8

    Thats why i love and hate coding in the same time.

  • @achlyssFTW
    @achlyssFTW 5 ปีที่แล้ว +1

    Do i have to make separate files or can i just put all in one?

  • @MaximilianoChirino
    @MaximilianoChirino 7 ปีที่แล้ว +10

    I don't speak english (just a little) and I don't know how to code. Well, this is gonna be fun xD

  • @TheGlendriv
    @TheGlendriv 5 ปีที่แล้ว +3

    Ty help me alot with OOP concept.

  • @lanayaassasin5373
    @lanayaassasin5373 6 ปีที่แล้ว

    Maybe u should make a video that helps people who want to be a programmer by giving the terminologies and purposes or do's and don't.

  • @dizioni1956
    @dizioni1956 5 ปีที่แล้ว +51

    The Coding Train > Eminem

    • @yankomirov4290
      @yankomirov4290 5 ปีที่แล้ว

      wtf is that supposed to mean?

    • @antimatter2376
      @antimatter2376 5 ปีที่แล้ว

      @@yankomirov4290 You're language sounds like it came from a mumble rap community

    • @rokbleki3929
      @rokbleki3929 5 ปีที่แล้ว +3

      @@antimatter2376 you are language?

    • @user-zu6ts5fb6g
      @user-zu6ts5fb6g 4 ปีที่แล้ว

      @@rokbleki3929 probably autocorrect idk

  • @verflakes1890
    @verflakes1890 4 ปีที่แล้ว +1

    I'm new to it.. I have written the code in p5.js.. then what I have to do to run the program??

  • @drewestification
    @drewestification 5 ปีที่แล้ว +5

    "we need something to call the size of this grid, I dunno what to call it.. what, R.
    R? R.. let's call it R.
    What we want to do is call it SCL"

  • @vietnamgamer9490
    @vietnamgamer9490 3 ปีที่แล้ว

    This is the most productive chaos I have ever seen

  • @RehanChamp
    @RehanChamp 4 ปีที่แล้ว +1

    I started to learn Python and seeing this I want to give up, this is so dam big programming.

  • @SatyajitGhana7
    @SatyajitGhana7 7 ปีที่แล้ว +8

    lol i tried to do this in c++. i f'ed it badly. fried my mind.

  • @derekfume8810
    @derekfume8810 6 ปีที่แล้ว

    Если бы он не разговаривал на протяжении видео, то сделал бы минут за 5 ))) хорошо что сущевуют такие каналы - это то, за что я люблю youtube.

  • @Adam-cn5ib
    @Adam-cn5ib 7 ปีที่แล้ว +6

    What does "this" mean?

    • @TheCodingTrain
      @TheCodingTrain  7 ปีที่แล้ว

      +Aspect search for my video about the constructor function

    • @Adam-cn5ib
      @Adam-cn5ib 7 ปีที่แล้ว

      Daniel Shiffman ok i'll do that

    • @richsocaplaya
      @richsocaplaya 7 ปีที่แล้ว

      "this" refers to the recording {}, here "Snale". You could write Snake.x etc.

    • @bigbajwa991
      @bigbajwa991 7 ปีที่แล้ว +3

      this means this video, this world.

  • @cedricyum9940
    @cedricyum9940 6 ปีที่แล้ว

    Um, so when will u give out the video about the missed functions(doesn't allow to go backwards, hitting the wall, etc..)?

  • @vish4544
    @vish4544 7 ปีที่แล้ว +4

    Why did he filled the array form last why not from the front

    • @killere2009
      @killere2009 7 ปีที่แล้ว

      I am FRIENDLY YT maybe he is thinking in stacks

    • @hfyaer
      @hfyaer 7 ปีที่แล้ว

      Yes exactly!! That was so frustrating. He just had to replace the last tail rect location by the new one!!
      Something like "tail = tail.slice(-1); tail.unshift(new rect(x,y,scl,scl))" ?
      And when the food is added "tail.unshift(food)"

  • @tessuttaja
    @tessuttaja 5 ปีที่แล้ว

    I don't know anything about coding, but I find it interesting and fun and now I want to learn it. Also if it would be possible I would try to copy this but add some changes because it would be a good practice and for some reason I understood almost all of this xd

  • @kristypolymath1359
    @kristypolymath1359 4 ปีที่แล้ว +3

    "There's my snake. It's moving across the window".
    What happens at home, stays at home o_0

  • @_Master_P
    @_Master_P 7 ปีที่แล้ว +9

    hi, i was wondering how did you learn code? i've been trying to learn html/css but free online courses don't get you really far, i dont' have the budget to pay 20$ per month. do you/anyone have some helpfull advice on learning code (html/css). thanks

    • @TheCodingTrain
      @TheCodingTrain  7 ปีที่แล้ว +6

      Try starting here! th-cam.com/play/PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA.html

    • @erperejildo
      @erperejildo 7 ปีที่แล้ว

      2pvideo try also with codeSchool. There are a lot of free options over there

    • @vnpallstar7008
      @vnpallstar7008 7 ปีที่แล้ว +4

      2pvideo try:codeacademy

    • @CorstiaanSmorenburg
      @CorstiaanSmorenburg 7 ปีที่แล้ว

      Why don't you just push next location (determined by key input) in the array and drop the last index unless food is being eaten. Then just draw all coordinates in the array. No need for total, just use array length. Been fun watching!

    • @xez531
      @xez531 7 ปีที่แล้ว

      Theres a book by jon duckett about it, you can find a pdf online

  • @danielsalas6373
    @danielsalas6373 5 ปีที่แล้ว

    I really enjoy watching you. Thanks