Login
Back to forumSee the full topicGo to last reply

Posted By

Csabo
on 2004-07-04
11:50:20
 Re: The <3KB Adventure game (for the unexpanded Vic-20 and 264 series)

It's far from optimized.

35 l(n)=99:if n=10 then 37
36 goto 4
37 print "you won!


could simply be

35 l(n)=99:if n<>10 then 4
37 print "you won!


Line 45 does not have to be in a separate basic line. Starting a new line (instead of appending it to the previous one with a colon) is 3 bytes extra.

You seem to be changing the color for VIC 20 and C64 (but not the Plus/4). The most obvious change could be not to do this at all. But even if you do, the VIC 20's poke is probably harmless on the C64 and the Plus/4, so you could just perform it without the costly PEEK.

Some of the subroutines are that only called once (lines 43, 46, 49) do not have to be a subroutine at all. You are wasting a gosub and a return.

Don't know about the VIC 20 or the C64, but for the Plus/4 it's useless to perform the CLR at the beginning.

There are probably a lot more things, but these are the most obvious ones I can see just by looking at it once.



Back to top


Copyright © Plus/4 World Team, 2001-2024