I intend to make a video on this, but I’ve not played with screen recording, things to learn. But I will need some kind of chronology so a rough write-up before I forget.
Code is over here. If you can do me a better version – any language – I will be made happy.
I watch so many YouTube videos these days, can’t help wanting to have a go myself. I’m not exactly new to video, have been playing with it since way back when, but really good tech is within easy reach, and online video being a thing, would be remiss of me not to have a proper go.
In a vaguely Marshall McLuhan kind of way, the form of a channel is a major part of it’s content. Identity/branding is a subtle but significant factor in the enjoyment of media. Long story short, I want to do the whole fancy intro thing.
While pondering this I remembered years back, when every band had a logo (think Crass, Motorhead…), I designed one for myself. Nigel tells me I used it for Fear of Thought. Is more or less a geometric-ish line drawing. I had a go at recreating it in LibreOffice Draw not long ago, but have since changed computers a bit, when I came to look for it again, no idea where to look. Then I remembered the Logo language…
Logo the Language
Regrettably it’s been pretty much been forgotten. Wikipedia has some history. In short, originating in 1967, it’s kind-of a bastard lovechild of Lisp and BASIC. While it is very capable, a lot of the emphasis was on it being a language to learn languages. A key part being turtle graphics, where you tell a pointer how to move around on screen, leaving a trail (should’ve been called Slug).
There’s a lovely idea mentioned on Wikipedia:
[[…”body-syntonic reasoning”, where students could understand, predict, and reason about the turtle’s motion by imagining what they would do if they were the turtle…]]
So if you do:
PENDOWN FORWARD 10 RIGHT 90 FORWARD 10 RIGHT 90 FORWARD 10 RIGHT 90 FORWARD 10 PENUP
You get a square.
There are lots of different versions of Logo, the de facto standard being Berkeley (UCB) Logo. Source is on GitHub. There are builds for Linux, Mac OS & MS Windows. Conveniently for me, it only took a :
sudo apt install ucblogo
Although it feels very dated, it works fine for me.
There is a CLI but I would up just using a text editor, reloading every revision.
So, my logo, first pass :
repeat 135 [
Something wrong with the shape, but obvious problem if I want to use this anywhere, need a thicker line.
I’d read that Logo was sort-of functional, very good for drawing fractals. So I thought a recursive version had to be tried.
This is when the time started getting eaten.
Functions in Logo look like this:
to logo :line1 :line2 :line3 :line4 :line5 :curveStep :line6 :line7 :line8
repeat 135 [
Syntax for variables looks horrid to modern eyes:
make "x :x+ 1
Some of the documentation is very dated, hardly readable in style.
But with trial and error, I could be wrong, it seems you can’t pass functions to functions.
So I swapped out the fd lines, swapped in a a call to function squares :
to square fd 3 rt 90 fd 3 rt 90 fd 3 rt 90 fd 3 rt 90 end to squares :nsquares repeat :nsquares [ fd 1 square ] end
I also separated the bits of code above that defined the shape into one function, another function to scale the lengths of line segments.
By now I was tiring of it, gave up on recursion. But still wanted to draw the logo.
The squares thing produced ugly corners. So I reworked it to draw circles instead.
There followed a long period of trying to get the logo how I remembered/wanted it.
I only had a very brief period when the interpreter misbehaved. As a test I whacked one of the variables in circles way beyond sense. Got a lovely pattern:
Source. It draws really slowly, quite charming.