Display Code and Run It
June 6, 2022
Hello! My goal for this blog post to get experiment with showing the text of some code and then the output of that code. My note to self as I start this blog post is BE UNAMBITIOUS! I have lots of ambitious ideas for blog posts and things about my art I want to describe but today I just want to put up maybe a single line of code and display the output. Let's see how that goes!
Try Using code tag
echo Hello World!Notes
Well that's pretty but I'm not sure how to run it.Try Using iframe of p5 Editor
Thoughts
First thought: yay consistent headings. This makes me dependent on the p5 editor for storing my code and I don't think I fully want that but maybe that's ok for code used in my blog.Write a Quine
If I could figure out how to write a Quine in some combination of html and p5.js, then surely I could figure out how to do what I actually want to do.Thoughts
What was that thing about not being overly ambitious. As fun as that sounds, there are definitely easier and simpler ways to move forward.Write a sketch locally
I'm thinking maybe I could write the sketch locally and then write some scripts to dump the code in one place and run it somewhere else. I am going to set a timer for 15 minutes and explore this idea. I'll report back shortly.Version 1
Thoughts
This is really close but the sketch is at the bottom of the page and I want to control where the sketch is so I experimented and now have version 2 of this plan.Version 2
Conclusion
Woohoo! I figured out what I want to do. However, this is not precisely that. There are elements of it on here. The real test will be in whatever code heavy blog post I write next. Also I gave up figuring out how to display the content of this html file that does what I want. Y'all can use inspect element if you're curious.
Below is the sketch from Version 1 above. This where the sketch wants to live so here it is. Sometimes. It's tempermental so no promises it will be there.