[tw5] TiddlyWiki is so awesome as a macro/scripting tool for BASIC

I needed to do a sanity check to understand why the CIRCLE statement is so slow compared to a custom subroutine (creating circles with triangles) to create circles filled in with color.

The interpreter I’m using does not allow variables in the screen statement, and I couldn’t be bothered setting up that ability.

To the rescue: TiddlyWiki scripting to generate the code at runtime.

screen _newimage(200,200,<<thisScreen>>)
locate 1,1 : print "screen mode: " + <<thisScreen>>
circle (100,100), 75
_delay 2
</$list>

Oops. The sanity check was to see that circles are proper circles for all screen modes despite various screen aspect ratios.

Sure enough, the circles are proper circles regardless of screen aspect ratio.

Which means the CIRCLE command does some fancy math to make sure that circles don’t turn into ovals when screen aspect ratios are not 1 to 1 (i.e. 1 pixel wide to 1 pixel tall, as opposed to a 2.4 pixels wide to 1 pixel tall, for example.)

So the fancy and super-speedy subroutine somebody gave me to create filled-in circles via creation of triangles, fine when in a 1:1 screen ratio, but creates ovals otherwise.

Anyway, that’s the details of what I was investigating, just in case you also geek out on this kind of stuff.

Talk is not showing the first line of code. Missing first line in Google Groups post.