Author
| Free your creativity - IOMBCC
| dvik msx master Posts: 1298 | Posted: March 31 2005, 04:33   | I'm terrible sorry for posting yet another listing but I did some improvments to
reduce the flicker in the last version.
So once again, here is the code:
1 DEFINT A-Z:V=14:S$(0)="A18A0CA0FB07C03C01H00A80AE0AF0AFCIFFH00A80AE0AF0AF8AFCBFEAFFP00F3FF7FTFFAF0AF8AFCAFELFFE00A80AC0AE0BF0AF8AFCBFEBFFP00B01B03B07B0FB1FB3FB7FBFFB80BC0BE0BF0BF8BFCBFEBFFP00B01B03B07B0FB1FB3FB7FbFFB80BC0BE0BF0BF8BFCBFE"
2 COLOR15,5,1:X=V:S$(1)="BFFX00A01A07A0FA1FA3FB7FAFFC00A01A07A0FA3FIFFA18A30AF0BE0CC0C80J00A01A03A07B0FA1FA3FB7FBFFA0FA1FA3FA7F\FFFFCFFEDFFG00A1FA20A40A7FBCFA7FB70G00AC0A20A10AF0B98AF0B70J00A0FA10A1FA2FA1FA19K00B80A40B80L00A06A0FA09_00A03"
3 KEYOFF:SCREEN1,3,0:FORI=0TO2:VPOKE8208+I,85:NEXT:LOCATE8,1:PRINT"PLEASE WAIT...":FORI=256TO991:O=VPEEK(I):VPOKEI,(OOR(O/2))/(2-(IAND4)/4):NEXT:FORB=0TO1:FORI=1TO212STEP3:Q=ASC(MID$(S$(B),I,1))-65:Y=VAL("&H"+MID$(S$(B),I+1,2)):FORA=ATOA+Q
4 VPOKE14336+A,Y:NEXT:NEXT:PUTSPRITE8+B,(80+64*B,159),V,6+B:NEXT:FORI=0TO11:FORH=0TO31:VPOKE6528+H+I*32,(I<8ORH<VORH>17)*(-63-ASC(MID$("SRQARBQIARJB",I+1))):NEXT:P(-I*(I<9))=50-15*(I/3AND1):NEXT:FORI=0TO143:TIME=0:VPOKE1024+I,255*(I/8AND1)
5 J=S-J*(J<96-S):H=J/16:IFCTHENFORW=0TO2:VPOKE8208+W,P(H+W):NEXT:Z=Z+S:RETURNELSEVPOKE1311-I,255*(I/4AND1):NEXT:C=10:SOUND3,V:VPOKE8192,V:SOUND8,8:N=12800:FORT=0TON/4:T=T-1+(Z\20):Z=0:GOSUB5:FORQ=0TO1:PUTSPRITE4+Q,(86+F*10+Q*32,95),V,4*B+Q
6 PUTSPRITE6+Q,(96+Q*32,127),V,4*F+2+Q:NEXT:GOSUB5:PUTSPRITE0,(X+80,156),1,12:U=STICK(0):F=B:S=S-(S<18ANDSTRIG(0))*2+(S>0):GOSUB5:C=C-S:IFC<=0THENB=3*RND(1):C=35+99*RND(1)ELSE:M=(X>72)-(X<0):S=S*(D<73ORL<0ORL>30)*(M=0):U=5*((U=7)-(U=3))+3'
7 GOSUB5:X=X+5*M-(U-3*B)*(S>0):S=-S*(S>0):LOCATE0,1:I=55930!/(25+S):SOUND9,-9*(S=0):SOUND1,I/256:GOSUB5:PRINTUSING"SPEED:####mph RANK:###";S*10;(N-75)/128:SOUND0,IAND255:L=X-E/3:N=N+9-S:E=NAND128:D=96-(NAND127):Y=D>0:D=D*D/96:GOSUB5'
8 PUTSPRITE1,(115-(D<34)*((24-D)*(B-1)+(F-1)*10)+(E-64)*D/225,-Y*(98+D)-31),6,16-D/24:NEXT:A=TIME\60:FORJ=0TO999:LOCATE6,4:PRINTMID$(" Game Over Time ="+STR$(A)+"s ",J\6MOD42+1,16):NEXT:SCREEN0' dvik and NYYRIKKI
| | manuel msx guru Posts: 3299 | Posted: March 31 2005, 12:41   | Man, there's still plenty of space left! 
Compacting the data even more should indeed be possible!  As long as the decode routine is short enough
The question is: do you still have inspiration to *do* something with that space?
By the way: doesn't the timer go wrong on 50Hz machines? | | NYYRIKKI msx master Posts: 1474 | Posted: March 31 2005, 13:09   | Just few stupid changes, that makes sound worse and handling of the car "more realistic" Still under development...
1 DEFINT A-Z:V=14:S$(0)="A18A0CA0FB07C03C01H00A80AE0AF0AFCIFFH00A80AE0AF0AF8AFCBFEAFFP00F3FF7FTFFAF0AF8AFCAFELFFE00A80AC0AE0BF0AF8AFCBFEBFFP00B01B03B07B0FB1FB3FB7FBFFB80BC0BE0BF0BF8BFCBFEBFFP00B01B03B07B0FB1FB3FB7FbFFB80BC0BE0BF0BF8BFCBFE"
2 COLOR15,5,1:X=V:S$(1)="BFFX00A01A07A0FA1FA3FB7FAFFC00A01A07A0FA3FIFFA18A30AF0BE0CC0C80J00A01A03A07B0FA1FA3FB7FBFFA0FA1FA3FA7F\FFFFCFFEDFFG00A1FA20A40A7FBCFA7FB70G00AC0A20A10AF0B98AF0B70J00A0FA10A1FA2FA1FA19K00B80A40B80L00A06A0FA09_00A03"
3 KEYOFF:SCREEN1,3,0:FORI=0TO2:VPOKE8208+I,85:NEXT:LOCATE8,1:PRINT"PLEASE WAIT...":FORI=256TO991:O=VPEEK(I):VPOKEI,(OOR(O/2))/(2-(IAND4)/4):NEXT:FORB=0TO1:FORI=1TO212STEP3:Q=ASC(MID$(S$(B),I,1))-65:Y=VAL("&H"+MID$(S$(B),I+1,2)):FORA=ATOA+Q
4 VPOKE14336+A,Y:NEXT:NEXT:PUTSPRITE8+B,(80+64*B,159),V,6+B:NEXT:FORI=0TO11:FORH=0TO31:VPOKE6528+H+I*32,(I<8ORH<VORH>17)*(-63-ASC(MID$("SRQARBQIARJB",I+1))):NEXT:P(-I*(I<9))=50-15*(I/3AND1):NEXT:FORI=0TO143:TIME=0:VPOKE1024+I,255*(I/8AND1)
5 J=S-J*(J<96-S):H=J\16:IFCTHENFORW=0TO2:VPOKE8208+W,P(H+W):NEXT:Z=Z+S:RETURNELSEVPOKE1311-I,255*(I/4AND1):NEXT:C=10:SOUND3,V:VPOKE8192,V:SOUND8,V:N=12800:FORT=0TON/8:T=T-1+(Z\20):Z=0:GOSUB5:FORQ=0TO1:PUTSPRITE4+Q,(86+F*10+Q*32,95),V,4*B+Q
6 PUTSPRITE6+Q,(96+Q*32,127),V,4*F+2+Q:NEXT:GOSUB5:PUTSPRITE0,(X+80,156),1,12:U=STICK(0):F=B:S=S-(S<18ANDSTRIG(0))*2+(S>0):GOSUB5:C=C-S:IFC<=0THENB=3*RND(1):C=35+99*RND(1)ELSE:M=(X>72)-(X<0):S=S*(D<73ORL<0ORL>30)*(M=0):U=5*((U=7)-(U=3))'
7 GOSUB5:S=-S*(S>0):X=X+5*M+U-(S*(B-1)\4):LOCATE1,1:SOUND9,V:SOUND1,83:GOSUB5:PRINTUSING"SPEED:####kmh RANK:###";S*10;(N-75)/128-70:SOUND0,255-S*14:L=X-E/3:N=N+9-S:E=NAND128:D=96-(NAND127):Y=D>0:D=D*D/96:GOSUB5
8 PUTSPRITE1,(115-(D<34)*((24-D)*(B-1)+(F-1)*10)+(E-64)*D/225,-Y*(98+D)-31),6,16-D/24:NEXT:A=TIME\60:BEEP:A$=SPACE$(14):FORJ=0TO999:LOCATE6,4:PRINTMID$(A$+"Game Over Time ="+STR$(A)+"s"+A$,J\6MOD42+1,16):NEXT:SCREEN0' dvik and NYYRIKKI
| | NYYRIKKI msx master Posts: 1474 | Posted: March 31 2005, 13:29   | Quote:
|
Btw, when does your version end?
|
It was meant to end, when you are quite a near first position  that's why it now starts from position 30 instead of 100
Quote:
| Maybe we should add some highscores as well 
|
Maybe... I was also thinking something like Chase HQ type of ending, where camera stops and car drives away...
| | AuroraMSX
 msx master Posts: 1216 | Posted: March 31 2005, 17:30   | How about this one. It's not *really* obfuscated, just a bit hard to read
0 ' MANDEL.BAS -- by AuroraMSX -- MSX2 and up -- for MSX.org's IOMBCC 2005
1 DEFINTA-G:DEFSTRH:DEFSNGI-Z:DIM A[8],AX[8],BX[8],AY[8],BY[8]:COLOR15,0,0:SCREEN7:FORA=1TO15:READB,C,D:COLOR=(A,B,C,D):NEXT:AW=512:AH=212:KX=-1.5:KY=-.8:LX=1.25:LY=.8:FORF2=0TO1STEP0:AX[0]=0:AY[0]=0:BX[0]=AW:BY[0]=AH:F=0:G=0:CLS:GOSUB4:'A
2 A=AW/4:B=AH/4:FORF=0TO1STEP0:LINE(A,B)-(A+AW/2-1,B+AH/2-1),15,B,XOR:G=STRIG(0):IFG<0THEN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X*ZX+ZY*ZY)<25THENNEXT:RETURNELSERETURN
Patience is silver, 7MHz is gold, fast emu is gold-plated latinum 
Quick manual: [ESC] to stop rendering, then use arrows to select new focus, [SPACE] to restart rendering. [CTRL]-[STOP] to quit.
[edit]Updates-R-us! A slight formatting improvement[/edit] | | manuel msx guru Posts: 3299 | Posted: March 31 2005, 18:52   | I'd rather have seen it formatted like this: (written by Martijn Leisink)
float
c,
C ,x,X,k,K=0.5, _=
2;char o,O,Q,l;i()
{k=x+=_;X=C;o=96;while
( 4>(c=k*k)+X*X&&--o){k=
2*k*X+x; X=X*X+C-c;}}main(){char
I[99]="\040,m,`;b|~P#T`:dl\033[H";
98[I]=0;while(3>((_*=K<0.2?1.1:1)>1e-3?_*=
0.970:(K-=_)))for(Q=-11;Q<12;){for
(O=-39;O <40;x=_*2*Q-(_-1)/2*K,C
= (K/2*K-1.3)*(1-_)+O*_,
i(),l=o&3,i(),I[O+++58
]=I[l*4+o%4]);puts
( I+(9<-++Q?16: 19
))
;};};
| | manuel msx guru Posts: 3299 | Posted: March 31 2005, 18:54   | btw: argh, even in my fast emu it's darn slow!
| | manuel msx guru Posts: 3299 | Posted: March 31 2005, 19:42   | Well, it got fnished! Why is there a blinking rectangle at the end?
| | manuel msx guru Posts: 3299 | Posted: March 31 2005, 19:58   | ah, it's the next section! I should have pressed space  | | Edwin msx professional Posts: 587 | Posted: March 31 2005, 21:50   | Although less obfuscated, I love the efficiency of the rally game!
Ever since I played around with Xaos (can zoom fractals in realtime on modern machines) I totally gave up on them. Of course, once we get a one line on msx that does the same, I may change my mind.  | | manuel msx guru Posts: 3299 | Posted: March 31 2005, 22:07   | Hey, it's fooking brilliant! You can also move that rectangle! It's a freaking cursor!
AuroraMSX: It's a great proggy!  | | Arjan msx addict Posts: 448 | Posted: March 31 2005, 23:09   | I felt like coding in BASIC again... Here's the result: A Brainfuck interpreter in 2 BASIC lines!
1 IFGTHENRESUMENEXTELSEDEFINTA-Z:ONERRORGOTO1:G=&H9000:FORD=GTO&H9100:POKED,0:NE
XT:INPUT"File:";H$:OPENH$FORINPUTAS1:P=&HA000:FORA=2TOLOF(1):POKEP,ASC(INPUT$(1,
1)):P=P+1:NEXT:POKEP,43:POKEP+1,91:POKEP+2,93:CLOSE:P=&H9FFF:PRINT"Running..."
2 P=P+1:C=PEEK(P):G=G+(C=60)-(C=62):V=PEEK(G):POKEG,V+(C=45)-(C=43):POKEG,ASC(IN
PUT$(-(C=44))):PRINTCHR$(VAND(-255*(C=46)));:IFC=91ANDV=0ORC=93ANDVTHENL=1:I=92-
C:FORA=0TO1:P=P+I:C=PEEK(P):L=L-(C=91)*I+(C=93)*I:A=-(L=0):NEXT:GOTO2ELSEGOTO2
beware: printing Hello World! takes almost 1 minute!
HELLO.BF
++++++++[>++++[>++>+++>+++>+<<<<-]>+>->+>>+[<]<-]>>.>
>---.+++++++..+++.>.<<-.>.+++.------.--------.>+.>++. | | NYYRIKKI msx master Posts: 1474 | Posted: April 01 2005, 01:42   | Oh, it feels so good to see this much high guality BASIC!
Quote:
| A Brainfuck interpreter in 2 BASIC lines!
|
Thanx Arjan for taking one thing out of my TODO list. It is already big enough
| | AuroraMSX
 msx master Posts: 1216 | Posted: April 01 2005, 09:20   | Quote:
| I'd rather have seen it formatted like this: (written by Martijn Leisink)
|
Won't fit on one screenie then.
Quote:
| btw: argh, even in my fast emu it's darn slow!
|
Ehrm, yeah. Make that: msx is PATIENCE!, 7MHz is Patience, fast emu is still patience :-)
Quote:
| Well, it got fnished! Why is there a blinking rectangle at the end?
ah, it's the next section! I should have pressed space
Hey, it's fooking brilliant! You can also move that rectangle! It's a freaking cursor!
|
Tja, you could have read the mini manual  I admit, it's not brilliant, but it should have given you a clue...
Quote:
| AuroraMSX: It's a great proggy!
|
Thanks
| | Vampier msx addict Posts: 492 | Posted: April 01 2005, 10:19   | Nice mandelbrot  but indeed damn slow... I've seen faster on a MSX... but never the less impressive  | |
| |
| |