I wrote a few months back about resources for kids who want to get into programming and mentioned a resource called YOUSRC. I tweet the man behind the curtain, Paul Clarke (@YOUSRC) on a fairly regular basis and after a conversation about Bresenham’s Incremental Line Algorithm (a fast way to plot any line without using floating point arithmetic) in response to a game he’d written on the site (Missile Command), I thought I’d have a crack at it myself.
The first demo I wrote is an implementation of Bresenham’s Incremental Line Algorithm in ELC (the BASIC-like programming language YOUSRC implements). Impressed by the language itself and up for a challenge, I then wrote some code to spin a 3D cube with hidden face removal and wireframe or filled polygon faces. This was a bit tricky as ELC at time of writing does not have polygon drawing routines so I had to write a routine to scan-convert the triangles (draw each filled triangle as a series of horizontal lines) and draw two triangles for a square.
My friends and ex-colleagues will recognise the 3D cube trick as my signature Hello World, with knobs on. It was originally written on the Spectrum (code to follow) and has been ported to the Amstrad CPC, Atari ST and original Gameboy, to name but three. The Gameboy version was the trickiest; no bitmap you see.
I’d highly recommend this site for would-be programmers; for a seasoned programmer the language has it’s quirks but I found the whole experience to be painless and the site has plenty of good examples and excellent language documentation.
I understand that Paul is currently porting the ELC runtime for the Rapsberry PI. Mine is due for delivery in the next couple of weeks, so I’m going to look forward to that!
Update: Did I not mention that Paul’s written a version of Atic Atac in ELC in homage to the Sinclair Spectrum and all those who programmed her?