Coding Challenge #121: Logo Interpreter

[ad_1]
In this coding challenge, I attempt to make a Logo interpreter and draw “turtle graphics” in JavaScript.

🔗
💻

🔗
🔗

🎥 push/pop tutorial:
🎥 Angles and angular motion:

🚂 Website:
💖 Patreon:
Store:
📚 Books:

🎥 Coding Challenges:

🔗 p5.js:
🔗 Processing:


Posted

in

by

Tags:

Comments

8 responses to “Coding Challenge #121: Logo Interpreter”

  1. MrZakrencony Avatar

    i was YELLING ++index when u wrote index++ at around 13:40

  2. simpletongeek Avatar

    That's great! I used to say that nobody is willing to teach turtle graphic programming, despite the fact that the problem is simply conversion from Polar coordinate to Cartesian coordinate. I now will have to qualify it with "… except Dan Shiffman!"

    I do wish you kind of practice a bit. The first time I did it, it took me one hour. I was having trouble with screen wrap. The quickest I did was about 10 minutes, without clearscreen command. I just forgot. 🙂
    You managed to do it in 20 minutes, so I guess you're better than me. Congratulations!

    BTW, Logo is not equal to Turtle graphic. I actually ended up not implementing logo, but implementing macro processor instead. Can't call it Logo. So I just call it Turtle Graphic with Macros.

    Edit:
    I implemented the repeat command by pulling 3 parameters: number of repetition, and two commands to be repeated. Obviously, sometimes you want more than 2 commands, but that's where having macros (sub func) helps.

    And just a suggestion to avoid the hang up problem: implement wait() and quit() commands.

  3. Dave Briccetti Avatar

    I love this, especially the live execution! Well done. (And I even saw a const.)

  4. Gustavo Cesário Avatar

    14:40
    "Let me just write stroke here…"
    Visual Studio: "DID YOU MEAN MEDIASTREAMTRACKAUDIOSORCENODE???????"

  5. abdeslam karjout Avatar

    awesome person <3 love ur challengs

  6. avi12 Avatar

    Dan, never forget: If you type something to the console, e.g. 5
    Even though you didn't explicitly save it to a variable, Chrome saved it for you
    It temporarily lives in a variable $_
    So if you type: $_ * 2
    The console returns 10

  7. Sergiusz Olszewski Avatar

    Wouldn't it be so much easier to simply do something like this: for(every token; i+=2) eval("token[i]+"("+token[i+1]+")");

  8. Picasso11 Avatar

    19:32 PUT THAT HAND BACK TO THE TABLE !

Leave a Reply

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