26 October 2022

Pentagram - as a 64-bit scalable vector

Following on from the "Pentagram - as an 8-bit scalable vector" post. This updated version works in a similar way but as a 64-bit executable (.EXE) that runs on an actual PC this time 😉

Written in QB64 and with more precise measurements, the vectors are stored in an array and the LINE command is used (as opposed to DRAW in Sinclair BASIC).

Given the massively increased processing speed and memory available since the previous 8-bit program, this allows for a lot more experimentation with loops and colour to create intricate patterns.

The main code that draws the pentagram is relatively short (less than 20 lines of code), when excluding the declaration and initialisation of variables and other additional functions / debug code.

The pentagrams on the screen shown (right) is created with the below code. The listing shows the main program and subroutine that draws the pentagram (I have omitted the additional debug code). 

The highlighted code below at line 32 to 41 does the heavy lifting. 


Below is the output showing some debug info (click to enlarge).