Schrijver
| Free your creativity - IOMBCC
| Grauw msx professional Berichten: 997 | Geplaatst: 16 Maart 2005, 23:32   | dvik: because he already uses for i=0 to 0 step 0 in his previous version, so it was a bit stupid remark  . | | NYYRIKKI msx master Berichten: 1463 | Geplaatst: 19 Maart 2005, 11:05   | dvik: That worm game is really good looking! It's so small, hard to read and yet so well working. Congratulations! That prime number search routine is also weird!
| | dvik msx master Berichten: 1262 | Geplaatst: 19 Maart 2005, 11:18   | Thanks nyyrikki. The worm game can be done a little bit shorter but I wanted to keep the quite ugly for loops (look at how the loop variables are used and also when the next statements are called). If I manage to get it down to six lines instad of seven I'll post a new version but it may be a bit tricky
Your entries are very cool too. I like that you use a wider range of calls. It shows that you know msx basic really well.
| | NYYRIKKI msx master Berichten: 1463 | Geplaatst: 20 Maart 2005, 23:24   | Quote:
| (anyone have any ideas on how to get rid of this one. I tried run but that clears the variables?)
|
I have a little idea... Thanx to your great explanation, I also took a liberty to make some minor changes in order to obfuscate it a bit more.
1 ONERRORGOTO1:POKE-2373,0:PRINTCHR$(-30*(D<>0OR(X(1)-X(0))<>2))A:A=A-2*(D=0)-(A=0):X(0)=(D=0)-(D<>0)*X(0):X(1)=NOT(D<>0)*(X(1)+1):D=D-A*(D=0):X(-(D>0))=X(-(D>0))+2:D=D-SGN(D)*X(-(D>0)) IOMBCC ENTRY BY DVIK!
| | dvik msx master Berichten: 1262 | Geplaatst: 21 Maart 2005, 07:24   | Nice enhancment NYYRIIKI  Using an array for the two square number iterators was a good idea which made the last calculation much more intersting. | | dvik msx master Berichten: 1262 | Geplaatst: 21 Maart 2005, 07:25   | I also have an update to the snake game. I finally manage to shrink it to 6 lines instead of 7:
1 SCREEN1:KEYOFF:FORR=0TO9:COLOR5,1,1:LOCATE8,11:PRINT" s to start":M=32:S=-10
2 IFINKEY$<>"s"THEN2ELSECLS:FORD=0TO737::D=D+(D+1AND2ANDD>MANDD<704)*15:F=6176
3 VPOKED+F,7:NEXT:H=6480:T=H-D:FORC=ATOF:S=S+10:L=F+RND(1)*D:IFVPEEK(L)-MTHEN3
4 Y=Y-10*(S>Y):R=3ANDASC(INKEY$+"C")+R+1:VPOKEL,15:U=M^(RAND1)*(1-(RAND2)):C=0
5 VPOKE2^13,6:VPOKEH-D,U+M:H=H+U:O=VPEEK(H):VPOKEH,9:IFO-MANDO-15THENR=0:NEXTR
6 LOCATE1,0:PRINT"SCORE"S,"HI"Y:IFO=15THEN3ELSEVPOKET+D,M:T=T+VPEEK(T)-M:GOTO4
| | NYYRIKKI msx master Berichten: 1463 | Geplaatst: 21 Maart 2005, 08:18   | Just wondering... Does ASCII still need some BASIC listings to their magazine? We might have few suitable...
| | dvik msx master Berichten: 1262 | Geplaatst: 21 Maart 2005, 08:28   | Just one little mistake on line 5. This is correct. Sorry
1 SCREEN1:KEYOFF:FORR=0TO9:COLOR5,1,1:LOCATE8,11:PRINT" s to start":M=32:S=-10
2 IFINKEY$<>"s"THEN2ELSECLS:FORD=0TO737::D=D+(D+1AND2ANDD>MANDD<704)*15:F=6176
3 VPOKED+F,7:NEXT:H=6480:T=H-D:FORC=ATOF:S=S+10:L=F+RND(1)*D:IFVPEEK(L)-MTHEN3
4 Y=Y-10*(S>Y):R=3ANDASC(INKEY$+"C")+R+1:VPOKEL,15:U=M^(RAND1)*(1-(RAND2)):C=0
5 VPOKE2^13,6:VPOKEH-D,U+M:H=H+U:O=VPEEK(H):VPOKEH,9:IFO-MANDO-15THENR=3:NEXTR
6 LOCATE1,0:PRINT"SCORE"S,"HI"Y:IFO=15THEN3ELSEVPOKET+D,M:T=T+VPEEK(T)-M:GOTO4
| | dvik msx master Berichten: 1262 | Geplaatst: 23 Maart 2005, 06:12   | If anyone has some creativity left or maybe got inspired, the 2005 version of the International Obfuscated C Code Contest IOCCC just opened. So if you want to participate you can send in your obfuscated c code entries to www.ioccc.org before May22. | | dvik msx master Berichten: 1262 | Geplaatst: 28 Maart 2005, 02:28   | Entry: Rally-X
System: MSX1
I tried to make an MSX1 basic version of a rally game I did for IOCCC last year. I had to cut off a few features such as oponent cars in order to fit the size limits and I also had to prioritize code size in favor of speed but the result is quite decent anyway. You control the car with the joystick.
Let me know what you think.
1 DATA18,C,F,7,7,3,3,3,1,1,1,,,,,,,,,80,E0,F0,FC,5,5,5,5,5,5,5,5,5,,,,,,,,,80,E0,F0,F8,FC,9,9,5,,,,,,,,,,,,,,,,,3F,3F,3F,3F,3F,3F,B,B,B,B,B,B,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,F0,F8,FC,9,5,5,5,5,5,5,5,5,5,5,5,5,,,,,,80,C0,E0,F0,F0,F8
2 DATAFC,9,9,5,5,,,,,,,,,,,,,,,,,1,1,3,3,7,7,F,F,1F,1F,3F,3F,B,B,5,5,80,80,C0,C0,E0,E0,F0,F0,F8,F8,FC,FC,9,9,5,5,,,,,,,,,,,,,,,,,1,1,3,3,7,7,F,F,1F,1F,3F,3F,B,B,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,80,80,C0
3 DATAC0,E0,E0,F0,F0,F8,F8,FC,FC,9,9,5,5,,,,,,,,,,,,,,,,,,,,,,,,,1,7,F,1F,3F,B,B,5,,,,1,7,F,3F,5,5,5,5,5,5,5,5,5,18,30,F0,E0,E0,C0,C0,C0,80,80,80,,,,,,,,,,,1,3,7,F,F,1F,3F,B,B,5,5,F,1F,3F,B,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
4 DATA5,5,5,FC,FC,FC,FC,FC,FC,9,9,9,9,9,9,5,5,5,5,,,,,,,,1F,20,40,B,CF,CF,B,30,30,,,,,,,,C0,20,10,F0,98,98,F0,60,60,18,17,16,0,17,1,16,8,0,17,9,1:DEFINTA-Z:SCREEN1,3:KEYOFF:FORI=0TO415:READS$:Y=VAL("&H"+S$):X=112:V=14:COLOR,5,1:VPOKE8192,V
5 VPOKE14336+I,Y-250*(Y=5)-245*(Y=9)-116*(Y=11):NEXT:FORI=0TO11:READF:FORH=0TO31:VPOKE6528+H+I*32,(I<8ORH<VORH>17)*(-128-F):NEXT:P(-I*(I<9))=50-15*(I/3AND1):NEXT:PUTSPRITE8,(80,159),V,6:PUTSPRITE9,(144,159),V,7:C=10:Z(0)=-10:Z(2)=10:B=1
6 FORI=0TO143:VPOKE1024+I,255*(I/8AND1):VPOKE1311-I,255*(I/4AND1):NEXT:A=8208
7 GOSUB9:PUTSPRITE4,(96+Z(F),95),V,4*B:PUTSPRITE5,(128+Z(F),95),V,4*B+1:GOSUB9:PUTSPRITE6,(96,127),V,4*F+2:PUTSPRITE7,(128,127),V,4*F+3:GOSUB9:PUTSPRITE0,(X,156),1,12:U=STICK(0):F=B:C=C-1:S=S-(S<9):GOSUB9:IFC=0THENB=3*RND(1):C=3+9*RND(1)
8 X=X+4*((U=7)-(U=3))-3*(B-1):S=-S*(X>80ANDX<152):X=X+6*((X>152)-(X<80)):GOTO7
9 J=1-J*(J<6):FORI=STO9:VPOKEA,P(J):VPOKEA+1,P(J+1):VPOKEA+2,P(J+2):NEXT:RETURN
| | Vampier msx addict Berichten: 481 | Geplaatst: 28 Maart 2005, 02:57   | you damn basic maniac this is one of the coolest basic things I've seen until now  | | NYYRIKKI msx master Berichten: 1463 | Geplaatst: 28 Maart 2005, 11:29   | You still have 3 lines left to expand your program. (If you bend the rules a bit)
This is more than just IOMBCC entry, this is really professional looking MSX1 game!
| | dvik msx master Berichten: 1262 | Geplaatst: 28 Maart 2005, 20:22   | Yes there are indeed three more lines if you don't count the 'Ok', cursor and function key line when you do list.
With three more lines its possible to add at least one or two more features. Unfortunately I don't think it is enough to do opponent cars which is probably the most important missing feature but I'll give it a try.
| | wolf_
 msx legend Berichten: 4441 | Geplaatst: 28 Maart 2005, 21:06   | forum=rottentooth+10:?"brush! ";:next
o_O | | dvik msx master Berichten: 1262 | Geplaatst: 29 Maart 2005, 08:06   | Nice oneliner wolf_ | |
| |
| |