The Coding Train
The Coding Train
  • Видео 1 254
  • Просмотров 125 300 076
Coding Challenge 183: Paper Marbling Algorithm
All aboard as I attempt to simulate the artistic process of paper marbling. The algorithm is based on the paper 'Mathematical Marbling' by S. Lu, A. Jaffer, X. Jin, H. Zhao, and X. Mao. The code is written in JavaScript using the p5.js library. Code: thecodingtrain.com/challenges/183-mathematical-marbling
🚀 Watch this video ad-free on Nebula nebula.tv/videos/codingtrain-coding-challenge-183-paper-marbling-simulation
p5.js Web Editor Sketches:
🕹️ Mathematical Marbling: editor.p5js.org/codingtrain/sketches/fsw-rJrpr
🕹️ Dodecahedron: editor.p5js.org/codingtrain/sketches/frIcGeI8l
🕹️ Marbling Phyllotaxis: editor.p5js.org/codingtrain/sketches/xoK1M7K3-
🕹️ Marbling Mouse: editor.p5js.org/codingtrain/...
Просмотров: 66 228

Видео

Coding Challenge 182: Apollonian Gasket Fractal
Просмотров 78 тыс.3 месяца назад
Happy Pi Day 2024! In this video, I attempt to create an Apollonian Gasket using the Descartes Circle Theorem and complex numbers. So many circles! Code: thecodingtrain.com/challenges/182-apollonian-gasket 🚀 Watch this video ad-free on Nebula nebula.tv/videos/codingtrain-coding-challenge-182-apollonian-gasket p5.js Web Editor Sketches: 🕹️ Apollonian Gasket: editor.p5js.org/codingtrain/sketches/...
Coding Challenge 181: Weighted Voronoi Stippling
Просмотров 154 тыс.4 месяца назад
Stippling is an artistic technique that uses numerous dots to craft an image. In this coding challenge I attempt to implement a weighted Voronoi stippling algorithm with p5.js along with the Delaunay triangulation package from d3.js. Code: thecodingtrain.com/challenges/181-image-stippling 🚀 Watch this video ad-free on Nebula nebula.tv/videos/codingtrain-coding-challenge-181-weighted-voronoi-sti...
Coding Challenge 180: Falling Sand
Просмотров 788 тыс.5 месяцев назад
It's Genuary 2024! Watch as I attempt to build a falling sand simulation in p5.js using a grid of pixels and simple rules. Code: thecodingtrain.com/challenges/180-falling-sand 🚀 Watch this video ad-free on Nebula nebula.tv/videos/codingtrain-coding-challenge-180-falling-sand p5.js Web Editor Sketches: 🕹️ Falling Sand: editor.p5js.org/codingtrain/sketches/AoH40T6fV 🕹️ Falling Sand with Gravity: ...
Coding Challenge 179: Elementary Cellular Automata
Просмотров 144 тыс.5 месяцев назад
How is nature hidden in a pile of 0s and 1s? Let's find out by coding a p5.js visualization of the Wolfram Elementary Cellular Automaton! Code: thecodingtrain.com/challenges/179-wolfram-ca 🚀 Watch this video ad-free on Nebula nebula.tv/videos/codingtrain-wolfram-elementary-ca p5.js Web Editor Sketches: 🕹️ Wolfram Cellular Automata: editor.p5js.org/codingtrain/sketches/IE77UYZ-G 🕹️ Wolfram CA wi...
I made a Discord Bot that says Choo Choo
Просмотров 39 тыс.7 месяцев назад
I made a Discord Bot that says Choo Choo
How to Set Up a Node.js Project
Просмотров 63 тыс.7 месяцев назад
How to Set Up a Node.js Project
Workflow: Terminal, Shell, Node.js, VSCode
Просмотров 71 тыс.7 месяцев назад
Workflow: Terminal, Shell, Node.js, VSCode
Creative Coding for Beginners - Full Course!
Просмотров 165 тыс.8 месяцев назад
Creative Coding for Beginners - Full Course!
All aboard the new Coding Train website!
Просмотров 35 тыс.Год назад
All aboard the new Coding Train website!
Coding Challenge 178: Climate Spiral
Просмотров 85 тыс.Год назад
Coding Challenge 178: Climate Spiral
Coding Challenge 177: Soft Body Physics
Просмотров 150 тыс.Год назад
Coding Challenge 177: Soft Body Physics
Coding Challenge 176: Buffon's Needle
Просмотров 98 тыс.Год назад
Coding Challenge 176: Buffon's Needle
Coding Challenge: 3D on Apple II
Просмотров 321 тыс.Год назад
Coding Challenge: 3D on Apple II
Apple ][ Coding Challenge: Fractal Tree
Просмотров 368 тыс.Год назад
Apple ][ Coding Challenge: Fractal Tree
What was Coding like 40 years ago?
Просмотров 1,7 млнГод назад
What was Coding like 40 years ago?
Coding Challenge 172: Horizontal Directional Drilling
Просмотров 118 тыс.Год назад
Coding Challenge 172: Horizontal Directional Drilling
Coding Challenge 171: Wave Function Collapse
Просмотров 528 тыс.Год назад
Coding Challenge 171: Wave Function Collapse
Coding Challenge 170: The Monty Hall Problem
Просмотров 157 тыс.2 года назад
Coding Challenge 170: The Monty Hall Problem
Local Storage in JavaScript with p5.js
Просмотров 37 тыс.2 года назад
Local Storage in JavaScript with p5.js
The Anal Retentive Coder
Просмотров 42 тыс.2 года назад
The Anal Retentive Coder
2.6 Mutual Attraction - The Nature of Code
Просмотров 113 тыс.2 года назад
2.6 Mutual Attraction - The Nature of Code
Coding Challenge 169: Pi in the Sky Game
Просмотров 86 тыс.2 года назад
Coding Challenge 169: Pi in the Sky Game
Coding Challenge 168: MandelBulb 3D Fractal
Просмотров 367 тыс.2 года назад
Coding Challenge 168: MandelBulb 3D Fractal
Beginner's Guide to Machine Learning in JavaScript with ml5.js
Просмотров 130 тыс.2 года назад
Beginner's Guide to Machine Learning in JavaScript with ml5.js
Coding Challenge 167: Ulam Spiral of Prime Numbers
Просмотров 750 тыс.2 года назад
Coding Challenge 167: Ulam Spiral of Prime Numbers
Coding Challenge 166: ASCII Text Images
Просмотров 1,1 млн2 года назад
Coding Challenge 166: ASCII Text Images
Coding Challenge 165: Slide Puzzle
Просмотров 164 тыс.2 года назад
Coding Challenge 165: Slide Puzzle
Coding Challenge 164: Bending Time Slitscan
Просмотров 99 тыс.2 года назад
Coding Challenge 164: Bending Time Slitscan
5.7 Path Following (Steering) - Nature of Code
Просмотров 106 тыс.2 года назад
5.7 Path Following (Steering) - Nature of Code

Комментарии

  • @youtubeonly3770
    @youtubeonly3770 17 часов назад

    It's sad to see the p5 guy growing OLD. I am following your content from when I was in high school.

  • @bhuvi5030
    @bhuvi5030 День назад

    Why there is depth in minimax props whats is the purpose of that

  • @adminiget1602
    @adminiget1602 День назад

    When the square was imperfect on the whiteboard i almost gone crazy.

  • @RazingForx
    @RazingForx 2 дня назад

    WOW, this is such a great video, love it.

  • @mmtatlas4705
    @mmtatlas4705 2 дня назад

    thanks for the video. Patenting algorithms is such a scummy thing, its like patenting logic and telling people they cant think in this way.

  • @PatrickHoodDaniel
    @PatrickHoodDaniel 2 дня назад

    I remember making similar games but on the TRS-80 model 1. When I upgraded to the model 3, I started advertising the game in software publications similar to yellow pages. I didn't sell a single copy. Haha.

  • @phaneedrakumaribharadwaj2392
    @phaneedrakumaribharadwaj2392 3 дня назад

    i like your face after seeing your face i feel more relaxed

  • @leiflangford1673
    @leiflangford1673 3 дня назад

    You have a gift? First youtube personality to get me to want to learn to program! Thank you for your time!

  • @jonpatchmodular
    @jonpatchmodular 4 дня назад

    I loved these Apple II coding challenges! I really hope you revisit this series at some point. I have programmed a lot on a somewhat modernised version of BASIC thanks to SmileBASIC for the Nintendo Switch and Nintendo 3DS, so I have a fondness for this old-fashioned algorithmic programming. Maybe at some point you could take a look at this great piece of software by SmileBoom! (I reccomend the switch version so you can use a USB keyboard) Aside from the text-based and graphics mode stuff, it has capacity to load and save backgrounds, display tilemaps, move sprites, and play sounds and music, with a built-in library of example graphics, music and sound. This makes it into a very simple game engine of sorts, but it has a real vintage feel since you do all by code, like a commodore and an NES put together. You can even use the hardware's unique features, like the 3DS dual-screens and touch screen, and I think the Switch version is compatible with the LABO cardboard controllers. It can be compared to Processing in how it makes programming fun, visual and creative, but running on a BASIC-style paradigm. You can really tell it's a labour of love. A shame that you can't compile the programs for PC. At one point I even programmed a game engine to wrap the per-sprite code functionality, being able to define and instantiate sprite classes, and run framerate independent code calculating Delta Time, in addition to some utility functions like linear interpolation. I called it the Reptile Engine for some reason. I never used it to make any games, because I couldn't deal with the mess of having so much code on a single program, and I hadn't figured out the self-modifying code functionality or any other way to separate the engine code from the game script. Still, a proud achievement, coded by touchscreen and stylus on a 3DS with no real OOP functionality.

  • @jordanwhistler9597
    @jordanwhistler9597 4 дня назад

    You had me until you pronounced gif with a hard G 😂

  • @bjbell52
    @bjbell52 4 дня назад

    I don't program in Javascript. I'm trying to relearn object Pascal and I thought your starfield simulation would be a good starting off point. I've got as far as creating a star type, creating an array of stars, giving them starting positions, and displaying them on the screen. Now I'm trying to animate them but Pascal doesn't have a map function. I tried to find out using Google but so far I've only found a map function in Javascript that works on arrays. What exactly is this line of code doing : sx = map(x / z, 0, 1, 0, width) ? TIA.

    • @TheCodingTrain
      @TheCodingTrain 3 дня назад

      It’s not the JS map function it’s a special p5 function that maps a number from one range to another you can reimplement it in pascal! Search map function and p5.js for more!

    • @bjbell52
      @bjbell52 3 дня назад

      @@TheCodingTrain Thanks.

    • @bjbell52
      @bjbell52 3 дня назад

      @@TheCodingTrain Thanks again. One quick Google search and I found the source code for the Map function. It was only one line long and very easy to create it in Pascal.

  • @zrodger2296
    @zrodger2296 4 дня назад

    Came for the Khan reference, stayed for the coding! Keep coding, everyone!🎉

  • @junseopark3933
    @junseopark3933 5 дней назад

    9:45 240622

  • @NinjaNezumi
    @NinjaNezumi 5 дней назад

    This looks amazing! I just wish the video was in English. :D j/k ;) If there is a way to make this in C# I need to figure out how :D

  • @zeyusdotcom
    @zeyusdotcom 6 дней назад

    I've been coding since forever, I'm not even sure why I started watching this, but I'm so happy I did! What a great video, you're an engaging and entertaining teacher, and I think (it's hard to say) you present it in a way that's accessible for people of all levels. Awesome work. 💗

  • @gauravtejpal8901
    @gauravtejpal8901 6 дней назад

    It is people like yourself that made me love programming. You, Sir, are a force for good 👍

  • @burrdid
    @burrdid 6 дней назад

    I give this a like because you used interrobang in the captions.

  • @heychiembugua1414
    @heychiembugua1414 6 дней назад

    Wish I saw this videos sooner! Finally I'm understanding

  • @dawnstar24
    @dawnstar24 7 дней назад

    25:42 the people laughing in background feels like he is doing a comedy skit.

  • @menachemlevi
    @menachemlevi 7 дней назад

    you are one of the best teacher and your intusiasem is a lot

  • @possibilityspace
    @possibilityspace 7 дней назад

    1. We're going to go quickly. 2. We're not going to rush. 3. We're going to meditate.

  • @DemetrioTorgan
    @DemetrioTorgan 7 дней назад

    The great Shiffman!!!!

  • @ryzehaha
    @ryzehaha 7 дней назад

    i lub u

  • @Rob-nb6zi
    @Rob-nb6zi 7 дней назад

    This is possibly my favorite RUclips video. "This probably won't work out". Now there are 1.69 million subscribers. Shiffman is the GOAT!!

  • @lovemadeinjapan
    @lovemadeinjapan 8 дней назад

    I really like the eighties shirt, but TUCK IT. People tucked shirts in the eighties! We're not on Hawaii!

  • @user-hy4he4cq2d
    @user-hy4he4cq2d 8 дней назад

    Whilst watching the coding train, thought he was coding a game. His maths was sound, the topic profound. He taught me something again.

  • @jonpatchmodular
    @jonpatchmodular 8 дней назад

    NOITA SHOUTOUT!! THAT GAME IS INSANE!

  • @RaulScanavino
    @RaulScanavino 8 дней назад

    Please, can someone show me how to export the final stippling to a svg file. I'm not a programmer! Tks!

  • @DemetrioTorgan
    @DemetrioTorgan 8 дней назад

    Professor, your class is incredible!!!!

  • @DemetrioTorgan
    @DemetrioTorgan 8 дней назад

    Thank you very much teacher, that was wonderful!!!!!!

  • @yvanpearson7024
    @yvanpearson7024 9 дней назад

    maybe contains function should be called is_within?

  • @KECHENGLIU-oz777
    @KECHENGLIU-oz777 9 дней назад

    This is the third time I watch this video

  • @TomLeg
    @TomLeg 10 дней назад

    Butterfly wing might cause a storm, at least in theory, but that's not the sort of thing that causes a volcano eruption.

  • @Churagawa
    @Churagawa 10 дней назад

    impossible to watch.

  • @Jilinhall
    @Jilinhall 10 дней назад

    this is actually such a smart way to generate a random but smooth-ish curve!

  • @gauravjain183
    @gauravjain183 10 дней назад

    love this!! :)

  • @ManishFrenchStudio
    @ManishFrenchStudio 11 дней назад

    An absolute triumph! 🌟🎥 This video is a triumph of content creation, seamlessly blending knowledge and entertainment. The presentation is flawless, and the visuals are nothing short of spectacular. I was entranced from the first moment and left with a deep appreciation for the subject matter. It's evident that the creators poured their creativity and expertise into this project, and the result is nothing short of exceptional. I'll be singing the praises of this video for a long time. Bravo! 👏🚀2.8k

  •  11 дней назад

    It seems like your quadtree example doesn't have any improvement over non quadtree approach.

  • @dkyeboah1
    @dkyeboah1 11 дней назад

    Great video as always. Question: If I want to be able to click on an object and drag that same one object to a new location, how do I achieve this?

  • @SMVK
    @SMVK 11 дней назад

    Next, make this algorithm in raster (each individual's pixels)🌚

  • @Muffin--Man
    @Muffin--Man 12 дней назад

    let m=0; function setup() { createCanvas(400, 400); background(0); } function draw() { noStroke(); if(mouseIsPressed) ellipse(mouseX,mouseY,m); } function mousePressed(){ fill(random(255),random(255),random(255),100); m=random(20,50); }

    • @Muffin--Man
      @Muffin--Man 12 дней назад

      let m=0; function setup() { createCanvas(400, 400); background(0); } function draw() { noStroke(); if(mouseIsPressed){ fill(random(255),random(255),random(255),100); ellipse(mouseX,mouseY,random(50)); } } /* function mousePressed(){ fill(random(255),random(255),random(255),100); m=random(20,50); }*/

    • @Muffin--Man
      @Muffin--Man 11 дней назад

      //Each individual ellipse has its own color let balls=[]; function setup() { createCanvas(windowWidth, windowHeight); } function draw() { background(220); for(let t of balls){ fill(random(100,255),random(100,255),random(100,255),200); t.show(); } } function mouseDragged(){ let d=new ball(mouseX,mouseY, random(20,50)); balls.push(d); } class ball{ constructor(x,y,d){ this.x=x; this.y=y; this.d=d; } show(){ // noStroke(); ellipse(this.x,this.y,this.d); } }

  • @ZyPPy_
    @ZyPPy_ 12 дней назад

    why do you need a seperate function for this? its same as just col=(255/600)*mouseX in the case of ranges starting from random values, u can just add the difference

  • @zsoltm2119
    @zsoltm2119 12 дней назад

    Fun video! This channel has a lot of these simulation and math type coding problems, but unfortunately using java or JS isn't the right tool or language. Also as others have said, this particular way of calculating PI is best done with a dense scan of the rectangle, not random points. Lastly, we shouldn't need to use the prior knowledge of Pi ti calculate PI. We can compare the calculated PI at the end of the calculation, it just cannot be part of the calculation. Imagine, I can generate random numbers between 0 and 4 and compare them to the real PI, picking the closest one - this is not an actual algorithm to compute PI. So let's do this correctly. Written in C (not C++ which has complex syntax), which not only is significantly faster than Java but has a cleaner syntax and more options to use long double type for more precision. I've ran the code below for a few minutes to calculate PI to the 9th digit: Calculated PI: 3.1415926525707500000482441659954702117830 Real PI : 3.1415926535897932384626433832795028841971 main() { long long circle = 0; long long r = 2000000; long long r2 = r * r; for (long long y = -r; y < r; y++) { for (long long x = -r; x < r; x++) { if ((x * x + y * y) <= r2) circle++; } } long long total = 4 * r * r; printf("Calculated PI: %.40Lf ", 4.0L * (long double)circle / (long double)total); printf("Real PI : 3.1415926535897932384626433832795028841971 "); } compiled with: gcc main.c -w -O3 -mavx2 Really simple code, right? And for those who don't like C pointers, just use the array notation. Please, these tutorials would be so much better and faster in C. I've seen a lot of videos on this channel, where the resolution was dropped to get performance to be decent or there was a lot of waiting required to get the computed result - The Mandelbrot based PI (at 0.25, 0 location) was a perfect example where using a native language like C would have made it significantly faster.

  • @spongebobseyelashes8548
    @spongebobseyelashes8548 12 дней назад

    I remember using grammars and lexers/parsers in Ocaml last year for college, was great to see it visualized like this!

  • @rodrigoqteixeira
    @rodrigoqteixeira 12 дней назад

    21:37 ✅ "fd": function() {turtle.forward()} ❌ "fd": turtle.forward

  • @spongebobseyelashes8548
    @spongebobseyelashes8548 12 дней назад

    8 years later frameRate() works when you put it in setup but still breaks when I try to use it in draw()

  • @pietroantenucci6415
    @pietroantenucci6415 12 дней назад

    That’s amazing

  • @rodrigoqteixeira
    @rodrigoqteixeira 12 дней назад

    13:40 Why did bro put a POST increment insead of an PRE increment. That returns the OLD value, not the NEW INCREMENTED one.

  • @jehree9850
    @jehree9850 12 дней назад

    The continue keyword is a joke to this man

  • @grimm2376
    @grimm2376 13 дней назад

    СУПЕР ТОПОВЫЙ КАНАЛ, жаль что я нашел этот канал только недавно. чууух чууух