Efficient BASIC coding for the ZX Spectrum

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
+3code

Efficient BASIC coding for the ZX Spectrum

Post by +3code »

I've found this interesting text (in spanish and english):
http://blog.jafma.net/2020/02/24/effici ... -spectrum/
User avatar
uglifruit
Manic Miner
Posts: 703
Joined: Thu Jan 17, 2019 12:41 pm
Location: Leicester
Contact:

Re: Efficient BASIC coding for the ZX Spectrum

Post by uglifruit »

This is really good - some excellent ideas/tricks in there.

My next Crap Game might not be so crap!
CLEAR 23855
User avatar
RWAC
Manic Miner
Posts: 700
Joined: Sun Aug 18, 2019 9:59 pm

Re: Efficient BASIC coding for the ZX Spectrum

Post by RWAC »

That would be a real shame.
User avatar
Morkin
Bugaboo
Posts: 3266
Joined: Mon Nov 13, 2017 8:50 am
Location: Bristol, UK

Re: Efficient BASIC coding for the ZX Spectrum

Post by Morkin »

Plenty of ideas for the crap game compo..!

Image

Image
My Speccy site: thirdharmoniser.com
User avatar
DouglasReynholm
Manic Miner
Posts: 349
Joined: Wed Feb 20, 2019 8:38 pm

Re: Efficient BASIC coding for the ZX Spectrum

Post by DouglasReynholm »

Fascinating stuff, makes so much sense, but would never have drawn those conclusions myself.
User avatar
patters
Manic Miner
Posts: 470
Joined: Thu Apr 11, 2019 1:06 am

Re: Efficient BASIC coding for the ZX Spectrum

Post by patters »

I found out about all of these optimisations in large part from IvanBasic when I wrote Artillery. He suggested I pursue them and initially I considered them perhaps marginal improvements not really worth reducing the legibility of my listing for (particularly the single letter variable names). Then when I finished the game I decided to scratch the itch and gradually profiled in BasinC and incredibly I pretty much doubled the speed of the game.

It is a bit of a pain having to have a variable lookup spreadsheet while you're coding though. And when you reorder those variables when you need another fast one but you only have 26 letters is a major ball ache.
Post Reply