Enter the Dragon – BASIC10 Entry by Bazzargh Converted to the CPC by Muckypaws
I may have mentioned the BASIC10 competition http://basic10liner.com/ and I made a conscious decision to enter this year, given someone entered me last year without knowing about it.
As I was browsing through the list of entries for 2026, I stumbled upon this remarkable entry by bazzargh
https://bunsen.itch.io/dragon-bbc-micro-by-bazzargh
In just 10 lines of code on a 1980s BBC Model B, a dragon is drawn on screen using procedural maths and some very clever plotting.
The image was so striking, I felt this needed converting to the Amstrad CPC.
The Original BBC Micro Code
bazzarghs original entry is shown below, and frankly it’s quite clever, though running on real hardware will take a lot of patience…
1MODE1:S=SIN.03:C=COS.03:X=260:Y=20:U=0:V=1:FORA=80TO1200
2X=X+U:Y=Y+V:K=SGN(COS(A/45)*COS(A*.0138)):T=U:U=U*C-K*V*S:V=V*C+K*T*S
3Z=24-A MOD10:FORB=-Z TOZ:R=1-80/A
4GCOL0,1+(INT(3*ABS(COS(B*.3+(A DIV4MOD2)*PI/2+.4)))=A MOD4)-(ABSB>16)
5PLOT69,4*INT(X+R*B*V),4*INT(Y-R*B*U):NEXT,
6VDU29,640;700;:K=190:FORJ=0TOK
7R=(200-80*COS(J*3*PI/K))*(.8+.5*COS(J*13*PI/K)*COS(J*13*PI/K)):FORI=0TOR STEP5.8
8GCOL0,1.3+(I/R)-(J DIV20=4)*(2*(I DIV15=3)+1)-(J DIV12=14)*(I DIV30=3)
9S=SIN(J*PI/K):C=COS(J*PI/K):V=8*SIN(I/16)
10PLOT69,I*S+V*C,I*C+V*S:PLOT69,-(I*S+V*C),I*C+V*S:NEXT,
The first five lines generate the long twisting body and tail, while the final five lines create the head using a separate mirrored plotting routine. That split alone is a lovely example of how much thought went into the design.
At its core, the body is generated by moving a point forward while continuously rotating its direction using sine and cosine, occasionally flipping the direction of the turn. That simple idea creates the long, snaking motion that gives the dragon its form.
What makes this so clever is that it is not drawing a dragon in the traditional sense. There is no sprite, no stored image, and no list of dragon-shaped coordinates. Instead, the code uses trigonometric functions and repeated plotting to build up a twisting body, scale-like textures, spikes, and finally a mirrored head shape. In other words, the dragon emerges from the maths rather than being explicitly drawn.

Amstrad CPC Version
The BBC Micro’s Mode 1 uses a very different graphics coordinate system to the Amstrad CPC, so this wasn’t a straight copy-and-paste job.
The BBC Mode 1 graphics environment works with a much larger logical coordinate space, whereas the CPC has a 640 × 400 logical plotting area in Mode 1, mapped onto a 320 × 200 pixel display. In real terms, that means some adjustment and compromise is needed when converting plotting-heavy code like this.
I tweaked the coordinates to better fit the CPC screen and converted the more bespoke BBC BASIC commands into Amstrad CPC equivalents.
The result?

Although there’s clipping at the top of the dragon due to differences in screen resolutions, I still think this looks striking, though on real CPC hardware this would take hours to produce… with the power of modern emulators and turbo mode this was sped up considerably, and the video below shows the dragon being drawn.
Want to see it for yourself?
You can type the following in on your favourite emulator, or real Amstrad CPC.
1 MODE 1:S=SIN(0.03):C=COS(0.03):X=260:Y=0:U=0:V=1::INK 0,0:INK 1,6:INK 2,24
2 INK 3,26:FOR A=80 TO 1200:X=X+U:Y=Y+V:K=SGN(COS(A/45)*COS(A*0.0138))
3 T=U:U=U*C-K*V*S:V=V*C+K*T*S:Z=24-A MOD 10:FOR B=-Z TO Z:R=1-80/A
4 P=1+(INT(3*ABS(COS(B*0.3+((A\4) MOD 2)*PI/2+0.4)))=A MOD 4)-(ABS(B)>16)
5 PLOT 2*INT(X+R*B*V),2*INT(Y-R*B*U),P AND 3:NEXT B:NEXT A:ORIGIN 320,253:K=190
6 FOR J=0 TO K:R=(200-80*COS(J*3*PI/K))*(0.8+0.5*COS(J*13*PI/K)*COS(J*13*PI/K))
7 FOR I=0 TO R STEP 5.8
8 P=INT(1.3+(I/R)-((J\20)=4)*(2*((I\15)=3)+1)-((J\12)=14)*((I\30)=3))
9 S=SIN(J*PI/K):C=COS(J*PI/K):V=8*SIN(I/16):PLOT(I*S+V*C)/2,(I*C+V*S)/2,P AND 3
10 PLOT (-I*S-V*C)/2,(I*C+V*S)/2,P AND 3:NEXT I:NEXT J
What do you think?
If you loved this, please support the original author, you can find the entry page https://bunsen.itch.io/dragon-bbc-micro-by-bazzargh

