You are a wizard! BTW do you typically sleep at all?
Its amazing what you can squeze into 8 lines of code. I'm supprised that its still
possible to find characters to save. But it is getting harder and harder.
If we didn't have the size limit I have some ideas that would be nice, for
example scrolling mountains in the horizon and arrows showing upcoming
curves. But these features are impossible to squeze into this one (although
I've thought that about almost all features we added since the first version )
Unless you find something I think this version is close to the final one. I don't
really have anymore good ideas of character saving or new features that
doesn't require too much code.
So here is the latest code:
1 DEFINTA-Y:V=14:S$(O1)="A18A0CA0FB07C03C01H00A80AE0AF0AFCIFFH00A80AE0AF0AF8AFCBFEAFFP00F3FF7FTFFAF0AF8AFCAFELFFE00A80AC0AE0BF0AF8AFCBFEBFFP00B01B03B07B0FB1FB3FB7FBFFB80BC0BE0BF0BF8BFCBFEBFFP00B01B03B07B0FB1FB3FB7FbFFB80BC0BE0BF0BF8BFCBFE" 2 COLOR15,5,1:X=V:S$(1)="BFFX00A01A07A0FA1FA3FB7FAFFC00A01A07A0FA3FIFFA18A30AF0BE0CC0C80J00A01A03A07B0FA1FA3FB7FBFFA0FA1FA3FA7F\FFFFCFFEDFFG00A1FA20A40A7FBCFA7FB70G00AC0A20A10AF0B98AF0B70J00A0FA10A1FA2FA1FA19K00B80A40B80L00A06A0FA09_00A03" 3 J=S-J*(J<96-S):K=J\16:FORW=0TO2:VPOKE8208+W,P(W+K):NEXT:IFTTHENRESUMENEXTELSEKEYOFF:SCREEN1,3,0:LOCATE8,1:PRINT"PLEASE WAIT!":FORI=256TO1023:VPOKE7952+I,85:O=VPEEK(I):VPOKEI,(OORO\2)\(2-(IAND4)\4):NEXT:SOUND3,V:FORW=0TO1:FORO=1TO212STEP3 4 Q=ASC(MID$(S$(W),O,1))-65:Y=VAL("&H"+MID$(S$(W),O+1,2)):N=14336:FORA=ATOA+Q:VPOKEA+N,Y:NEXT:NEXT:PUTSPRITE8+W,(80+64*W,159),V,6+W:NEXT:ONERRORGOTO3:FORR=1TO12:FORH=0TO31:VPOKE6496+H+R*32,(R<9ORH0:D=D*D\96:U=STICK(0):*:PRINTUSING"SPEED:###kmh RANK:###";S*10;N\128-82:NEXT:Z$=SPACE$(V):S=15:Z=TIME\(6-PEEK(43)\128) 8 FORN=0TO244:D=88-3*N:U=Y*(N\6-V):Y=D>0:SOUND8,U:SOUND9,U:D/2:PUTSPRITE0,(116-(D<58)*((21-D*D\96)*B+F*10)+(X-36)*D\126,-Y*(98+D)-31),1,15+Y*D\24:LOCATE6,4:PRINTMID$(Z$+"Race Over Time ="+STR$(Z/10)+"s"+Z$,NMOD42+1,S):NEXTI:NEXT:SCREENUP
What about using NYYRIKKI's trick to replace basic statements with single letters? PUT SPRITE is quite a long text....
how about using the catapult type tab to let catapult/openMSX do the typing? or simply copy/paste the code in a file?
life can be so easy sometimes when you know you can do it in other ways than just typing
I'm sure manuel knows that, BiFi
The purpose is to reduce code size to be able to add extra features
Indeed. What do you think about it, dvik and/or NYYRIKKI?
In order to do that we also need to add an ONSTOPGOSUB.... to catch a break
so that we can get the regular basic syntax back. But I think that it still would
save some space and it would for sure make it look more obfuscated.
Doing the one character commands would probably increase the speed a little
bit as well since the parsing will be quicker but maybe it won't be noticable.
I guess the biggest problem is to develop using the one character commands.
A lot of work is actually to just move code arround to make the lines 239 characters
long. And since there are dependencies between different statements it will
be a bit tricky to do.
dvik, tricky is where obfuscation is all about!
I'm sure you can manage it
BTW: you can also disable CTRL-STOP with one poke and let Q exit the game e.g. (and restore basic).
Also, the speed is incredibly much higher on turboR as snout already mentioned...
Indeed. What do you think about it, dvik and/or NYYRIKKI?
I think, that there are people who don't know anything about ML, but they still have good BASIC ideas to implement. Although I made the rules and even later found a way to redefine part of MSX-BASIC code, I think it is not fair to redefine whole MSX-BASIC just because it is possible. I think, that if you come up with something original it is more than welcome, but redefine of code just because it is possible just don't make sense to me... The code will be totally unreadable.
BTW poke-1103,1 will disable CTRL+STOP
NYYRIKKI: ehm, totally unreadable... Wasn't that the idea of obfuscation? ANyway, it will get you guys loads of extra space, that was the idea. Not just because it is possible.