Coding Challenge #2: Menger Sponge Fractal

Поделиться
HTML-код
  • Опубликовано: 13 янв 2025

Комментарии • 387

  • @OrchidAlloy
    @OrchidAlloy 8 лет назад +297

    Considering you're also taking the time to explain everything to the audience, you should start by giving yourself 15 minutes instead of only 10. It's fair!

    • @TheCodingTrain
      @TheCodingTrain  8 лет назад +50

      heh, good point!

    • @Acecool
      @Acecool 4 года назад +6

      The biggest part is design; coding doesn't take long at all when you have a plan.

    • @__europa
      @__europa Год назад +1

      @Acecool the point of this challenge is to make spmething up in under 10 minutes, not to get everything designed prepared beforehand.

  • @jadiel237
    @jadiel237 2 года назад +29

    Can we just take a moment and acknowledge that with 10 seconds to go in bonus time, he managed to come up with an outstanding fractal completely by accident, the inverse Menger Sponge Fractal. Now that's nature!

  • @AlxM96
    @AlxM96 8 лет назад +177

    Who on Earth would ever dislike such a masterpiece of a video?

    • @11itech11
      @11itech11 5 лет назад

      Yeah a masterpiece.

    • @johnlemon273
      @johnlemon273 5 лет назад +4

      those who hate to break sweat to Math

    • @dr.dank5769
      @dr.dank5769 5 лет назад

      it's non-human

    • @condor1234
      @condor1234 3 года назад

      Someone who spend 15hrs, thinking of the logic, writing the code and still ends up failing. And after that coming into youtube just to drop in this video to let them see someone did it + explanation in less than 15mins. 😂😂😂😂

    • @theonecallednick
      @theonecallednick 3 года назад +1

      Probably it was mediocore, no offense

  • @cimmik
    @cimmik 8 лет назад +257

    What I did in order to learn as much as possible from this video, was trying to make it myself before I saw how Daniel would do it. Then I compare my approach to Daniel’s approach. This way, I challenge myself, and I will find alternative ways to solve problems.

    • @noelearlwatson2724
      @noelearlwatson2724 8 лет назад +6

      Nice

    • @TheCodingTrain
      @TheCodingTrain  8 лет назад +44

      love that!

    • @SaintPepsiSanCoca
      @SaintPepsiSanCoca 8 лет назад +9

      Wow that is a very good approach, I think i'll do it this way as well! :D

    • @spoderman15
      @spoderman15 8 лет назад +4

      Lol this is how I do all my school work problems (the ones that have solutions anyway)

    • @2001herne
      @2001herne 5 лет назад +1

      I'm not quite confident enough in my abilities to do this - however, I work in python, not java/processing - so I need to figure out how to implement the logic in python, which still takes a bit of thinking.

  • @johnvonhorn2942
    @johnvonhorn2942 8 лет назад +70

    If this man did these challenges at parties women would want him. I find him to be downright heroic.

    • @pmAdministrator
      @pmAdministrator 8 лет назад +2

      Whoa... you dirty....

    • @aurias42
      @aurias42 7 лет назад +1

      I mean, I'm not sure if dirty is quite the right word here... but it's definitely inappropriate...

    • @nickjimenez3250
      @nickjimenez3250 7 лет назад +3

      Christopher Johns - What's dirty about it? ._.

    • @martynBVT
      @martynBVT Год назад

      maybe all the intellectual, comp sci loving and math loving women XD

  • @trekhopton
    @trekhopton 8 лет назад +4

    I'm absolutely loving these 10 min episodes! Keep it up man!

    • @trekhopton
      @trekhopton 8 лет назад +1

      +Trekobius I'm learning a lot and I really enjoy your teaching style

    • @TheCodingTrain
      @TheCodingTrain  8 лет назад +1

      +Trekobius thank you so much, glad to hear!

  • @Eddygeek18
    @Eddygeek18 8 лет назад +1

    Was coding along with it, was doing little bits myself and coppied a most of it from yours and it worked perfect. I know other languages but im reasonably new to java and js. Watching your videos is a great way to learn. Thank you and cant wait to keep watching :)

  • @DThorn619
    @DThorn619 8 лет назад +1

    Now these are some really interesting videos. Really puts your other coding tutorials into perspective because you can clearly see parts of them being used throughout your video. Great supplemental material!

    • @TheCodingTrain
      @TheCodingTrain  8 лет назад +1

      +Asad Mirza Thanks for this feedback, glad to hear!

  • @frankakn_7448
    @frankakn_7448 8 лет назад +17

    You deserve way more subscribers

  • @predicate
    @predicate 6 лет назад +72

    [insert clever joke about how the content of this video relates to my profile picture]

  • @abdulbakiaybakan8836
    @abdulbakiaybakan8836 6 лет назад +15

    I wish I had that much energy and intelligence. You think and find solution so fast. Just Amazing!!! (I wonder who dislikes this video)

  • @ShawnTowne
    @ShawnTowne 8 лет назад +3

    Awesome! Loving your 10 min coding projects... this should be a tv show 😉

  • @harrys4698
    @harrys4698 7 лет назад +3

    I just got an ad with you in it on your own video, and I'm glad youtube is now this meta

  • @Xeronimo74
    @Xeronimo74 8 лет назад +5

    these 10 min challenges are really amazing, educational and inspiring!

  • @lumigg2556
    @lumigg2556 8 лет назад +93

    my brain just exploded :D

  • @Charlesbabbage2209
    @Charlesbabbage2209 8 лет назад +8

    I think my brain just liquefied and drained out my ear.
    I've got my work cut out for me for the next couple of years.
    You are the man, Prof Shiffman!

  • @santoryu8940
    @santoryu8940 8 лет назад +80

    man for how long have you been coding

  • @bravodude6175
    @bravodude6175 2 года назад

    Even if I don’t know the math behind your processes, I’m still learning valuable information on how you approach these problems and think them out! I appreciate all the content you put out!

  • @grandosprey6450
    @grandosprey6450 7 лет назад

    Always love watching you do challenges. It truly shows the magic of writing code. I hope I can one day be as impressive.

  • @BloodyScythe666
    @BloodyScythe666 8 лет назад

    I love these coding challenge videos. would really enjoy more of them.

  • @CesareVesdani
    @CesareVesdani 6 месяцев назад +1

    What is the best and easiest software application for creating a menger sponge?

  • @cristianhakansson7443
    @cristianhakansson7443 8 лет назад +11

    This is like watching let's plays but with coding, I like it!
    Not sure if someone already suggested it, but when checking which blocks to exclude i think you could have checked if (x*y*z == 0). The product will be zero if and only if at least one of the terms are :)

    • @jamiesanders9865
      @jamiesanders9865 8 лет назад +2

      But he needed two or more of x,y,z to be == 0

    • @cristianhakansson7443
      @cristianhakansson7443 8 лет назад +3

      Ah, of course :) What I wrote would just leave the corners!

    • @landsgevaer
      @landsgevaer 2 года назад

      x*y + y*z + x*z == 0 would work, although that isn't as simple...

  • @Moviechopper200
    @Moviechopper200 3 года назад

    Hey! you are amazing man. One of the best teachers I've ever seen.

  • @jacosh3924
    @jacosh3924 7 лет назад

    Checking if the combined absolute value was less than 0 is a genius way to work this out centres. Thanks for the great video!!

  • @liwaiyip1769
    @liwaiyip1769 8 лет назад

    Your videos are so educational and interesting, please keep making more of these :D

  • @eddy911
    @eddy911 4 года назад +1

    coding train is my life train since i was 7 years old...i love the challenges

  • @feyzullaharas9334
    @feyzullaharas9334 8 лет назад +7

    insane in the membrane
    this is how pupil want to learn coding ++

  • @vincentruben
    @vincentruben 4 года назад +1

    The inverse looked really good!

  • @rajuns5288
    @rajuns5288 5 лет назад

    Dude HOW are you so good at programming it’s just incredible

  • @informationera4761
    @informationera4761 5 лет назад

    Your the BlackPink in Programming, you are a true artist.

  • @ArnoldsKtm
    @ArnoldsKtm 7 лет назад

    That looks awesome. That xyz sum was a neat idea.

  • @leonmueller8710
    @leonmueller8710 7 лет назад

    I like that u directly say what you think 11:03 is a good example

  • @wendyzhou7618
    @wendyzhou7618 3 года назад

    thank you for sharing! love this type of challenge

  • @palmweaver
    @palmweaver 6 лет назад

    Once again, a very good demonstration.

  • @darshgupta6276
    @darshgupta6276 3 года назад +2

    I love that Dan is sacrificing his time to make sure that his audience understands what he's doing. 😁

  • @AbhiKumar-fb2zd
    @AbhiKumar-fb2zd 2 года назад +1

    This still looks like a lot of learning in 2022.

  • @valor36az
    @valor36az 3 года назад

    Thank you so much for teaching us I added peasy cam, I will continue with these excellent tutorials

  • @thiagovalentin688
    @thiagovalentin688 5 лет назад

    Well that was the best coding challenge I've seen someone going through - that was pretty cool! Now I am trying to get my Menger Sponge Level 2 done in Origami hehe =)

  • @kevin._.27
    @kevin._.27 6 лет назад +2

    I think you are remaking every generation, when you make a new generation.

  • @Smomid
    @Smomid 5 лет назад

    Dude, you are a programming god.

  • @mr.mysteriousyt6118
    @mr.mysteriousyt6118 7 лет назад

    this RUclips channel is the heaven of programmers I'm 15 and so new to programing but I'm still learning.

  • @lilHoodRD
    @lilHoodRD 8 лет назад

    Hey Mate, That was awesome!

  • @SerilaBuck
    @SerilaBuck 8 лет назад +13

    you should rework it as 15min challenge as you have to account the time you take to explain stuff

    • @TheCodingTrain
      @TheCodingTrain  8 лет назад +2

      +SerilaBuck I think you are probably right! I would like to see if I can get better / more efficient, but we'll see.

  • @jimmycerdaruiz6281
    @jimmycerdaruiz6281 7 лет назад +2

    9:29 he says 27 at the same time timer is 27 iluminati confirmed

  • @kid_kulafu_1727
    @kid_kulafu_1727 7 лет назад

    Omg! Why people dislike this awesomeness! Anyway are you using the macbook pro with touchbar sir?

  • @brunomello7499
    @brunomello7499 7 лет назад

    You my friend, are a genius

  • @zansaviogamer007
    @zansaviogamer007 8 лет назад

    You're awesome dude.

  • @iancraftsandmines6266
    @iancraftsandmines6266 8 лет назад

    I can get it to level five (which takes about half a minute to render) and I'm too scared to try level 6. That should theoretically take about 15 minutes). Also I literally hand-typed every single character along with you and got this and then after my wrists were screaming in pain you said the code was in the description. *cri.* But at least it's good practice to type it because I'm learning a lot about Processing from watching you. Thanks for these great videos.

  • @quintopia
    @quintopia 8 лет назад +1

    the sum thing is exactly what i was thinking to do. impressed you thought of it on the fly while talking.

  • @boiimcfacto2364
    @boiimcfacto2364 7 лет назад +1

    14:00 Glory Hallelujah! Praise the lawd!!!

  • @exod4
    @exod4 8 лет назад +2

    I like your energy! ! Seems you have a new sub ;)

    • @TheCodingTrain
      @TheCodingTrain  8 лет назад

      +exod4 Thanks so much!

    • @CharTheDude
      @CharTheDude 8 лет назад +1

      +Daniel Shiffman Same here. I love it when someone has this much enthusiasm about something! I hope your channel picks up sometime soon!

  • @BeastOfTraal
    @BeastOfTraal 8 лет назад

    An interesting way to create the Menger Sponge is with the chaos game.
    Mark the 8 points of cube's corner.
    Pick some random starting point.
    Randomly pick one of the 8 corners.
    Mover 1/3 the distance from your current position and that of the random corner.
    Mark that point.
    Continue randomly picking corners and moving 1/3 the distance.
    Do this about 1 million times

  • @XilenceDoGood
    @XilenceDoGood 8 лет назад

    Following your video, I got a working fractal with a few differences in the rotation, etc. However, you made a comment about making the boxes rainbows, so I went ahead and modified the array with floats for red, green, and blue values (that way they've each got their own randomly assigned color). What I can't figure out is how to pull those values for each box out of the array and push it to the fill command.

  • @DanielKierkegaardAndersen
    @DanielKierkegaardAndersen 8 лет назад

    You are indeed awesome!

  • @sweethomes674
    @sweethomes674 2 года назад

    Excellent 😊

  • @bishalgupta49
    @bishalgupta49 7 лет назад

    U r a genius man .. i love your coding skills .. hope to be a coder like you .. 😄

  • @mrping2603
    @mrping2603 8 лет назад

    this young thing strolls from The Indian Ocean since Rome pounces on my bad problem

  • @tw7522
    @tw7522 6 лет назад

    Great stuff!

  • @shoaibmirza3082
    @shoaibmirza3082 8 лет назад

    awesome Dan !

  • @circli
    @circli 7 лет назад +1

    In all fairness... The ratio of likes to dislikes is nice, ≈173.4, even haters see how amazing a coder we see here! Great video!

  • @tusharmaurya1668
    @tusharmaurya1668 7 лет назад

    That 10 minutes, always went off!

  • @StevesMakerspace
    @StevesMakerspace 3 года назад

    That was intense.

  • @shivammehta6923
    @shivammehta6923 8 лет назад +64

    what you are man or robot or alien??
    i can't see the human being who can code as fast as you

  • @rahulgeorge2409
    @rahulgeorge2409 6 лет назад

    Amazing work!!
    Thanks a lot @Daniel :D

  • @dsyt985
    @dsyt985 6 лет назад

    U r a coding god

  • @alexanderbergkvist9224
    @alexanderbergkvist9224 7 лет назад

    You are amazing *-*

  • @hvrc0
    @hvrc0 8 лет назад +8

    'Some kind of birthing experience' holy shit that killed me

  • @CarlFurrow
    @CarlFurrow 8 лет назад

    That was great!

  • @josephjohnson4761
    @josephjohnson4761 10 месяцев назад

    its like a mad scientist

  • @mathematicalmatt
    @mathematicalmatt 8 лет назад +1

    How did I not know about you before?! I don't know if this is where you accept challenge requests, but you should totally do langton's ant, and if possible multiple color langton's ant. Don't really know if that's the kind of thing Processing was designed for, but it would be awesome!

  • @okoiful
    @okoiful 8 лет назад

    That was amazing dan! :)

  • @MerlinZuni
    @MerlinZuni 2 года назад

    This was impressive

  • @tapiocagaming8376
    @tapiocagaming8376 8 лет назад +14

    why does he start the time while he is explaining at the beginning? love the vids but it is strange.

    • @LOL13176
      @LOL13176 7 лет назад +11

      Cuz he doesn't really care about the time, he never finishes a challenge in time anyway.

    • @purpleice2343
      @purpleice2343 7 лет назад +3

      And he already stopped doing the "timed" challenges, instead he let's himself not to rush it in like ~15mins max and that way we both get more content and he has more time to explain/tell a lot more in detail so at the end of the video we aren't just like "oh so x exists, cool", but instead actually understand, at least just a bit, about the topic as a whole.

  • @Richard_is_cool
    @Richard_is_cool 8 лет назад

    Loved it.

  • @mannyc6649
    @mannyc6649 4 года назад

    10:55 The best way would have been to replace x++ by x+=2, and so on. That's going to skip the zero for all three.

  • @6san6sei6
    @6san6sei6 8 лет назад

    so amazing!

  • @typedeaf
    @typedeaf 6 лет назад

    I BOSD'ed my computer about 4 times, and crashed the browser a dozen times because my triple loop section had x++ on all three, creating an infinite loop. Jeez!

  • @Spaghettttto
    @Spaghettttto 2 года назад

    This man, smart smart

  • @rupertrussell1
    @rupertrussell1 8 лет назад

    Amazing stuff. I will definitely make something with this. I just hope you still have the code handy.

    • @TheCodingTrain
      @TheCodingTrain  8 лет назад

      Code is here! github.com/CodingRainbow/Rainbow-Code

  • @owenchetty64
    @owenchetty64 8 лет назад

    That's so cool!!

  • @Donaldo
    @Donaldo 6 лет назад

    >Implements a fractal
    >Uses retained mode representation

  • @myselfgroot6721
    @myselfgroot6721 6 лет назад

    Ont the internet There is nothing i can compare with u are Just Amazing

  • @MauveTendingToBeige
    @MauveTendingToBeige 2 года назад

    The inverse menger sponge looks suspiciously like the Vicsek fractal.

  • @iamtimsson
    @iamtimsson 9 месяцев назад

    4:17
    i want
    all the
    small things
    truth cares
    truth brings

  • @pantallahueso
    @pantallahueso 3 года назад

    I don't know if anyone will see this, but if anyone is following along in Processing for macOS and finding that the box won't render, you might want to try specifying a frameRate(). Apparently something changed in Big Sur that broke P3D without a specified frameRate(). The default is 60.

  • @konstantinrebrov675
    @konstantinrebrov675 4 года назад

    What are all these functions that you are using? Where are they coming from?
    translate(), rotateX(), box(), lights()

  • @rosslahive
    @rosslahive 8 лет назад

    Thanks so Awesome.

  • @Juke172
    @Juke172 8 лет назад

    mesmerizing

  • @nicktucker3387
    @nicktucker3387 8 лет назад

    I LOVE THESE!!!

    • @TheCodingTrain
      @TheCodingTrain  8 лет назад +1

      +Nick Tucker They are a lot of fun to make! Going to do many more.

    • @katekay
      @katekay 8 лет назад +1

      +Daniel Shiffman you should make more games :) they're really fun to watch being made

    • @TheCodingTrain
      @TheCodingTrain  8 лет назад

      +Kate McNamara ok! Will keep this in mind, would love any suggestions for quick and simple ones I might be able to make. Some suggested a "snake" game which is a good one.

    • @katekay
      @katekay 8 лет назад

      +Daniel Shiffman snake is a really good one to learn from, maybe pong and block breaker too :)

    • @TheCodingTrain
      @TheCodingTrain  8 лет назад

      +Kate McNamara got it thanks!

  • @ThePoke151
    @ThePoke151 7 лет назад

    I'm using part of the code you wrote to create a public available menger-sponge wallpaper.
    I hope you're cool with it :)
    But I have a problem, I'm using p5.js and the performance is so bad it doesn't allow me to call the generate function more than twice. Any tips or help?

  • @ianprado1488
    @ianprado1488 6 лет назад

    I love how abrupt the ending is

  • @scebsy6524
    @scebsy6524 2 года назад

    Could you add backface culling to make it more efficient with more subdivisions?

  • @컨트롤D
    @컨트롤D 5 лет назад

    wow, amazing sponge fractal! it's very hard to make!

  • @mulanszechuansauceisthemeaning
    @mulanszechuansauceisthemeaning 6 лет назад

    ending of the video: goodb

  • @shapkofil4708
    @shapkofil4708 4 года назад +1

    11:21 Pressure truly blinds men beyond multiplication

  • @luhao4337
    @luhao4337 7 лет назад

    well played

  • @piedesinistro8861
    @piedesinistro8861 5 лет назад

    that's what i want to do when i graduate have fun programming

  • @xiaoqi200268146
    @xiaoqi200268146 7 лет назад

    The man is working for NSA

  • @iamtimsson
    @iamtimsson 9 месяцев назад

    3:00 i usually wanna see that box

  • @DaleBasye
    @DaleBasye 8 лет назад

    this was awesome times 3 or 4 !