Coding Challenge #123.1: Chaos Game Part 1

Coding Challenge #123.1: Chaos Game Part 1


65 thoughts on “Coding Challenge #123.1: Chaos Game Part 1”

  1. Israel Silvino Melo Batista

    By coincidence I watched the chaos game video on Numberphile a couple days ago and found it pretty interesting.

  2. This is really neat! Coincidentally, I made my own (very very minimal) Chaos Game with P5 just a few weeks ago (https://vvye.github.io/chaos-game ).

  3. hey I've just started using p5 with vs code as my text code editor but I can't seem to get IntelliSense working for the p5 library. I've downloaded the p5 @types using npm but it is not being detected by vs code and intellisense is not working. I've spent hours trying to figure out using google but I haven't found a solution to my problem. Any help would be greatly appreciated.

  4. TheTasteful Toastie

    function setup() {
    for (let n = 70000, _ = (createCanvas(800, 800), stroke(220), background(20)), p, col, points = [Object.defineProperty(createVector(width * 0.5, 0), 'color', { value: color(255, 0, 255) }), Object.defineProperty(createVector(0, height), 'color', { value: color(0, 255, 255) }), Object.defineProperty(createVector(width, height), 'color', { value: color(255, 255, 0) })], currentPoint = random(points).copy(), i = n; i–; currentPoint.lerp(p = random(points), 0.5), stroke(p.color)) point(currentPoint.x, currentPoint.y)
    }

  5. Really nice video. I should try P5 one-day. I did it in the past, with not much experience in coding this Sierpinsky triangle https://youtu.be/pgiu-sudDfk

  6. I did a version of this where there is 3 input boxes and we can modify the number of points, leap amount and fps
    https://github.com/DeathOfTime8/Chaos-Game

  7. Павел Менжинский

    Something amasing. I tried similar thing in 2d editor, make a some 3×3 rule box (black point – set rule, white point – not set), and rule was to place rule box into bigger cell (by step equal of width/height of rule box). in case of rule box is black and central point is white – we have a Menger sponge. In case of diagonal white dots – we have a slightly tilted Koch snowflake. So on.

  8. Wild Animal Channel

    If you have a low calorie diet you will be thin and hyperactive and also live a long time. This is why I think Dan will live to 100 years old.

  9. I've been recreating this in every language I've learned since the early 90s when I first played it with an actual marker and six-sided die. Including a Windows 95/98 screensaver written in VB3 (that's not a joke). Great video!

  10. OOH man! this program is so excitement, thank you for doing this, I remember program this sierpinsky triangle in c++ years ago. Now I will try do this caos in Python! 😀 Greetings from Mexico!!

  11. A much better video on chaos game than numberphile vid:
    https://youtu.be/IGlGvSXkRGI

    This guy has an excellent math channel overall.

  12. Could you please make a video about test driven development and robustness. It's a really great way to make a program to work!

  13. Hey, would you like to share your secret.from where you fine these challenges? I also wanna solve some without watching video pls

  14. That's another great video. I have leaned so much about coding and maths from your channel. here is my recreation of this code https://codepen.io/harsh-dhadwal/pen/QJPgBg

  15. I played with the Chaos Game as well, from triangles to 15-gons as starting points, and using different percentages.

    Just uploaded an animation to my new channel. More variations are coming soon!

    Please have a look, cheers!

  16. Well I did it: https://editor.p5js.org/spock1959/full/bqzorGmgS

    I refactored your code from this video. I now have two different arrays that hold values. One holds the newly drawn points and one holds the main anchors. You can easily add multiple anchors and set custom locations for each one. Then I automatically draw the dots that are held within a separate array.

    Each dot is also its own class of "Dot" with an x and a y and a color. When you choose to draw or show the point you can set the weight of that dot.

    I've also allowed you to easily slow down the framerate and the amount of iterations per frame so that you can more easily "watch" the dots get drawn to maybe help understand why the Sierpinski Triangle appears.

Leave a Reply

Your email address will not be published. Required fields are marked *