Coding Challenge

Поділитися
Вставка
  • Опубліковано 9 вер 2024

КОМЕНТАРІ • 133

  • @TheCodingTrain
    @TheCodingTrain  5 років тому +2

    Find the code and submit your version here! thecodingtrain.com/CodingChallenges/129-koch-snowflake.html

  • @lubaka8269
    @lubaka8269 5 років тому +24

    20:02 Haha! That moment when you get your code right on the first compile. Feels so good!

  • @hammer_ttk
    @hammer_ttk 5 років тому +39

    Mathematicians and Programmers are the only people on the internet that welcome snowflakes

    • @KuraIthys
      @KuraIthys 5 років тому +1

      That's funny because only snowflakes complain about snowflakes.

    • @VictorRivarola007
      @VictorRivarola007 4 роки тому +1

      Most definitely FALSE. I am a Computer Engineer, and I hate snowflakes, politically defined ones of course... Can you think of something better than holding a real, white, frozen water that has fallen from the sky... And shape it into Frosty?

  • @KuraIthys
    @KuraIthys 5 років тому +12

    "I will refactor this later" AKA programmer's code for 'it'll be like that forever, because I've got better things to do than fix stuff that mostly works" XD

  • @mattshnoop
    @mattshnoop 5 років тому +11

    Hey!! I did an assignment on this exact Fractal in my Calc I Course for my first year of University! We found that the area of the whole shape is [2*sqrt(3)*s²]/5 (when starting with a triangle), and that it’s perimeter is the limit as n -> ∞ of 3s(4/3)^n, where s is the initial sidelength and n is the iteration through, starting at 0. I’m very excited to finally see a coding challenge about something I’m familiar with!! :D

  • @beron_the_colossus
    @beron_the_colossus 5 років тому +21

    I do love me some snowflakes

  • @adamsero1249
    @adamsero1249 5 років тому +3

    16:00 you could actually accomplish the same result with such function:
    f(x)=sin(a*x)
    where a->infinity
    The sine wave will be more "squeezed", proportionally to the 'a' parameter, resulting in infinite length of the curve in a finite space (for example 2 PI).
    Of course there are many more examples, but this is a little bit easier to explain, because most people know how a sine wave looks like.

  • @David_Raab
    @David_Raab Місяць тому

    For the coding part and doing it "functional". You have an Input Line and a function that takes a Single input line and gives you 4 lines back. So function is like "Line -> Line list". You just run your function on every line and collect all result into a new list. You just repeat that step as how often you want your recursion to happen.

  • @mariomatschgi344
    @mariomatschgi344 5 років тому +19

    You are the BEST programmer I know...
    I wish that i could be soo good at programming.
    Kind regards from Austria
    EDIT:
    Thank you so much for the ❤

    • @arturf209
      @arturf209 5 років тому +1

      I love to watch this guy and all knowledge he's got

    • @KayOScode
      @KayOScode 5 років тому

      My ego is too high for this. I would say I'm better. I do far fewer small challenges, but many more big ones.

  • @jacky_ftw
    @jacky_ftw 5 років тому +5

    list.addAll(Arrays.asList(array));
    Great video!

  • @yonnitabeling7919
    @yonnitabeling7919 5 років тому

    Never find someone in france that can make coding fun for everyone ! thank you to bring that part of my life at a funnier step for other people !

  • @hathibelagalproductions2426
    @hathibelagalproductions2426 5 років тому

    You are an inspiration. Most enthusiastic and entertaining programmer I've ever seen.

  • @limboreversible
    @limboreversible Рік тому

    Dude, this challenge is insane

  • @jdawg761
    @jdawg761 5 років тому

    I would honestly buy that jumper / sweater in a heartbeat if I could. Great video, thanks!

  • @octavianstiq2541
    @octavianstiq2541 5 років тому +9

    Where did you study? You are too good

  • @lironmeler4099
    @lironmeler4099 5 років тому +1

    Congratulations on 700k keep up the great work!

  • @singhashutoshk
    @singhashutoshk 5 років тому +4

    Really Cool

  • @Tatubanana
    @Tatubanana 5 років тому +6

    I didn't know the videos were distributed first through the "The Coding Train" website :o

    • @blasttrash
      @blasttrash 5 років тому +2

      He did this in live video on thursday or something. most of his videos are like that.

  • @gamingbutnotreally6077
    @gamingbutnotreally6077 5 років тому +4

    Great video! P.S. addAll takes only arraylists as a parameter so you need to make the array a list first by doing Arrays.asList(myArray)

    • @jpisello
      @jpisello 5 років тому +2

      Actually, it will take any argument (parameter value) that implements the Collection interface.

  • @matthewgrimalovsky4876
    @matthewgrimalovsky4876 5 років тому +1

    Thank you so much!!!

  • @ganster1239
    @ganster1239 5 років тому

    Every next step, you divide the curve by 3, and multiply the length by 4! Since you do that every step, they get multiplied together, so the length of one side is (4/3)^n
    Since lim n->inf+ a^n goes to infinity for a > 1, the length of one side goes to infinity, and therefore the whole perimeter!

  • @thecoder5550
    @thecoder5550 5 років тому +4

    More christmas coding challanges!

  • @CutyCupy
    @CutyCupy 5 років тому +2

    Koch is a very difficult name for native English speakers :D Check it out in google translator with german or swiss as language and let google say it - i believe the "ch" gets pronounced in a way that most english speaking people dont know :)
    Amazing Video! I had to program this Koch Snowflake in my first year of highschool with the python turtle :D brings back highschool memories ^^

  • @putte1221
    @putte1221 5 років тому

    I dont know how to code at all and i am still completely hypnotized by your videos. Keep it up. Much love from sweden

    • @TheCodingTrain
      @TheCodingTrain  5 років тому +1

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

  • @bokkenka
    @bokkenka 5 років тому

    If you start with the equilateral triangle, the infinite curve surrounds a finite area.

  • @princeshukla3095
    @princeshukla3095 5 років тому

    Nice coding video tutorials ...
    You all videos are very very helpful
    thanks for making these videos

  • @David_Raab
    @David_Raab Місяць тому

    You don't need an infinite amount of ink. When i pour a single drop of ink on a sheet its probably fills out more than needed. Now think of it as removing ink to create the structure. You now can basically remove ink up to infinity, but it never will come to zero.

  • @lachlanzsembery2417
    @lachlanzsembery2417 5 років тому

    Gotta love those snowflakes

  • @metaorior
    @metaorior 5 років тому

    Over and over again

  • @krazykowsr
    @krazykowsr 5 років тому +2

    Wouldn't this be a perfect example for recursive objects where the show function either draws a line (no children generated yet), or calls the show function of it's children

    • @TheCodingTrain
      @TheCodingTrain  5 років тому +1

      Yes, this could be done elegantly and with very few lines of code with a recursive function!

  • @XeartyBG
    @XeartyBG 5 років тому

    Happy new year, Dan!

  • @synhegola
    @synhegola 3 роки тому

    Great advance in pronounciation, from Kotsch to Koke. I always wonder why the "ch" sound is so difficult for non-germans ^_
    ^

  • @deadend8111
    @deadend8111 5 років тому +2

    This one is easy with recursion

  • @jemarcoux
    @jemarcoux 5 років тому

    Good video as always!

  • @marcosimfeld2876
    @marcosimfeld2876 5 років тому

    wow! amazing

  • @ecsodikas
    @ecsodikas 3 роки тому

    You did some snowflakes, but what about flow snakes?

  • @krccmsitp2884
    @krccmsitp2884 Рік тому

    21:20 Just FYI, the Swedish name Koch is pronounced /ˈkɔkː/.

  • @Jolkkue
    @Jolkkue 5 років тому

    Hey can you make a video about generating terrain with the Diamond-Square algorithm

  • @user-tc1ur9qp5j
    @user-tc1ur9qp5j 5 років тому

    Good job !

  • @fpicoral
    @fpicoral 5 років тому

    Suggestion: make a game using UnityScrip, a language made to program games in Unity, based in JS

  • @riot1133
    @riot1133 5 років тому +2

    happy halloween

  • @aprilmintacpineda2713
    @aprilmintacpineda2713 5 років тому

    Wow.

  • @VinneDS
    @VinneDS 5 років тому

    next thing ...
    some random walking, fire works snowflakes ;)

  • @pietmens2216
    @pietmens2216 5 років тому

    I really like your hat :)

  • @kobeliesenborgs4006
    @kobeliesenborgs4006 5 років тому

    Amazing as always :D

  • @Cerzus
    @Cerzus 5 років тому +1

    1:36 Coke line? :p

  • @akiaki2562
    @akiaki2562 5 років тому

    How did you learn about programming ?? books ? Internet ?? university ???

  • @wowatomica
    @wowatomica 5 років тому

    Infinite ink reminded me of coastline paradox 8D

  • @gaborfekete3777
    @gaborfekete3777 5 років тому +4

    where can I listen to the refactor song?

    • @TheCodingTrain
      @TheCodingTrain  5 років тому +2

      soundcloud.com/kristianpedersen/sets/coding-rainbow-remixes

    • @gaborfekete3777
      @gaborfekete3777 5 років тому

      @@TheCodingTrain thank you!

  • @DaminGamerMC
    @DaminGamerMC 5 років тому +1

    Where do you get ideas for your coding challenges?

    • @TheCodingTrain
      @TheCodingTrain  5 років тому +1

      Here! github.com/CodingTrain/Rainbow-Topics/issues

    • @DaminGamerMC
      @DaminGamerMC 5 років тому

      The Coding Train Thank You!

  • @dandk_
    @dandk_ 5 років тому

    I'm just starting my third year of SE having never coded before starting the course but still don't feel like I know that much about the practical side of things compared to that of the planning/design side - do you think the majority of the technical ability comes through experience when eventually working in the industry or has my course neglected it?

  • @Minty1337
    @Minty1337 5 років тому

    what if you made it zoom in to the area near your mouse, to kinda zoom into the fractal a bit

  • @treeislife
    @treeislife 3 роки тому

    Without Turtle Graphics and recursion, it sounds so complicated.

  • @sangrambarge3250
    @sangrambarge3250 5 років тому

    Please do Riemann surface 😃😃

  • @dominicrann6699
    @dominicrann6699 5 років тому +1

    Where can I find the live streams and live chat. Love you videos

    • @TheCodingTrain
      @TheCodingTrain  5 років тому

      Right here on this channel! If you subscribe and click alarm bell you'll get a notification when I schedule a live stream.

    • @dominicrann6699
      @dominicrann6699 5 років тому

      Thanks so much your the best

  • @Lesser1222
    @Lesser1222 5 років тому

    It took me 2 days to code this
    .
    .
    .
    .
    Shiffman does it in 20 mins...

  • @joaovitordossantos9949
    @joaovitordossantos9949 5 років тому

    length of Gen n = (4/3)^n

  • @AB-Prince
    @AB-Prince 5 років тому +2

    von koch curve

  • @johanneseriksson1929
    @johanneseriksson1929 5 років тому

    Where can I find the shirt you are wearing. I do need it.

  • @wizwildworld2407
    @wizwildworld2407 3 роки тому

    p5 thinks setup = set() and setBPM() .

  • @max-yasgur
    @max-yasgur 5 років тому

    When Dan says “Koch” it sounds like he’s had three too many eggnogs, if ya know what I mean 😏

  • @wizwildworld2407
    @wizwildworld2407 3 роки тому

    can you teach me how to zoom in/out?

  • @VictorRivarola007
    @VictorRivarola007 4 роки тому

    3:23 Why? You never said why...

  • @alialiali4400
    @alialiali4400 5 років тому

    amazing as always ^_^

  • @SeargeB
    @SeargeB 5 років тому

    Every time I'm watching you, I'm wondering.
    Are you on drags?

    • @carterjean
      @carterjean 5 років тому +1

      he’s on Koch

    • @SeargeB
      @SeargeB 5 років тому

      😏👌🏻

  • @ancom161-m3b
    @ancom161-m3b 5 років тому

    didn't you already do something similar in the nature of code chapter on fractals?

  • @predicate
    @predicate 5 років тому

    1:27 you forgot a line segment :(

  • @janetjoy8313
    @janetjoy8313 5 років тому

    I hope I’m not the only one who didn’t get anything cause that will make me feel very dumb. Is there a beginner channel or videos someone can recommend
    Ps:I’m really new to coding

    • @TheCodingTrain
      @TheCodingTrain  5 років тому

      Try this playlist to start from the beginning! ua-cam.com/video/yPWkPOfnGsw/v-deo.html

  • @annaanna3260
    @annaanna3260 5 років тому

    ignore this comment----
    selber mit funktion (eingabe iteration) for loop

    • @annaanna3260
      @annaanna3260 5 років тому

      mathe funktion selbst machten

  • @paraschavan014
    @paraschavan014 5 років тому

    😄

  • @codehard105
    @codehard105 5 років тому

    The coke snowflake?

  • @easternteasers1127
    @easternteasers1127 5 років тому +1

    Pls do processing.py

  • @SaSok898
    @SaSok898 5 років тому

    I can't find the "I will refactor this later" song. I need it for...reasons. Does anyone know where to find it?

    • @TheCodingTrain
      @TheCodingTrain  5 років тому

      soundcloud.com/espen-sande-larsen-365984601/refactor

  • @eduardmart1237
    @eduardmart1237 5 років тому

    make trigonometry visualization tools. I meant interactive one.

  • @sujals7108
    @sujals7108 5 років тому

    Why is this video unlisted?

  • @dawid4190
    @dawid4190 5 років тому

    8:40 - where this song comes from??

    • @TheCodingTrain
      @TheCodingTrain  5 років тому

      soundcloud.com/kristianpedersen/sets/coding-rainbow-remixes

  • @alexbaltimore
    @alexbaltimore 5 років тому

    Wonder if you can snort it

  • @sujals7108
    @sujals7108 5 років тому

    Can you make Pacman game please?

  • @miguelomp
    @miguelomp 5 років тому

    Comment section, help! If I code a version of any challenge in other enviroment like unity, can I add into coding train repo?

    • @TheCodingTrain
      @TheCodingTrain  5 років тому

      Yes! More info:
      github.com/CodingTrain/website/wiki/Community-Contributions-Guide

    • @miguelomp
      @miguelomp 5 років тому

      @@TheCodingTrain Thank you! Happy new year!! :D

  • @luisaisat
    @luisaisat 5 років тому +1

    how transform this to p5?

    • @TheCodingTrain
      @TheCodingTrain  5 років тому +1

      You can find the p5 version here! thecodingtrain.com/CodingChallenges/129-koch-snowflake.html

  • @s4ecki
    @s4ecki 5 років тому

    0:28 no, no you're not xD

  • @bloemundude
    @bloemundude 5 років тому

    Return children? If only . . .

  • @honkatatonka
    @honkatatonka 5 років тому

    No, seriously. We need a link to the "refactor this later" song!

    • @honkatatonka
      @honkatatonka 5 років тому

      So very well explained, thanks!

    • @TheCodingTrain
      @TheCodingTrain  5 років тому +1

      soundcloud.com/espen-sande-larsen-365984601/refactor-1

  • @catlord69
    @catlord69 5 років тому

    yes, you were pornouncing the 'ch' incorrectly, since he has a 'germanic' name :D english doesn't use such sound

  • @willsouza3048
    @willsouza3048 5 років тому

    Which language does he uses?

    • @TheCodingTrain
      @TheCodingTrain  5 років тому

      This video uses Processing (which is built on top of the Java programming language). For more info, visit processing.org and also this video might help ua-cam.com/video/AmlAiKsiy0o/v-deo.html.

  • @emil8301
    @emil8301 5 років тому +2

    “Koch” is actually pronounced “kokk”.
    Love your videos and keep up the good work.

    • @cicciobombo7496
      @cicciobombo7496 5 років тому

      @@beyondcatastrophe_ "swedish mathmatician"

    • @Aaron-ff2ms
      @Aaron-ff2ms 5 років тому

      Helge von Koch
      [ˌhɛlːgə fɔnˈkɔkː]
      That is a
      k
      with a normal
      o
      behind and a long
      k
      Idk how a long k sounds but that is what (the German) Wikipedia says

  • @ernest3269
    @ernest3269 5 років тому

    8th(im being honest)

  • @ColeNOXyd2nd
    @ColeNOXyd2nd 5 років тому

    maybe you should start to use Collections instead of arrays...

  • @csanadtemesvari9251
    @csanadtemesvari9251 5 років тому

    It's pronounced koh

  • @OonHan
    @OonHan 5 років тому

    "Coke"

  • @TuanNguyen-uc1cs
    @TuanNguyen-uc1cs 5 років тому

    Code challenge for you: amino acid folding challenge(will be a hard one) if you can do it, I will share your video everywhere I can then give a sub. Good luck new protein for New Years

    • @TheCodingTrain
      @TheCodingTrain  5 років тому

      Please suggest here! github.com/CodingTrain/Rainbow-Topics/issues

  • @MarcosEsqueda
    @MarcosEsqueda 5 років тому

    Dude! how i can get this kind of skills? Drugs, Satan, Angels, witches? how? I feel so depressed right now becouse i can't get this of programming skills! :( i want to die.....! i have to leave the code....

    • @TheCodingTrain
      @TheCodingTrain  5 років тому

      Don't be depressed! If you are new to coding maybe start here! I believe in you! ua-cam.com/users/shiffmanplaylists?view=50&shelf_id=14&sort=dd

  • @bakimonaythor9395
    @bakimonaythor9395 5 років тому

    It's funny how English people can pronounce words like "massachusetts" but not "Koch" xD

  • @dainmeister
    @dainmeister 5 років тому

    Ok so...
    Lets say you are a two dimensional being. If you want to paint the perimeter of this, you would need an infinite amount of paint right? Just using a paint brush would be useless. BUT what would happen if you took the paint bucket and splashed the paint all over it? Would it cover the perimeter in paint, or would the paint seem to disappear as at comes into contact? Where did the paint go? What maniac made this two dimensional structure? WHERE DID THE MATERIAL COME FROM? WHAT IS LIFE?!?