Autor
| Small Basic code.
|
Yukio msx professional Mensajes: 814 | Publicado: Junio 10 2004, 00:04   |
Do you know any program that only use one or two lines of BASIC code?
There was some sample programs and a old contest for this type of program.
|
|
[D-Tail]
 msx guru Mensajes: 3013 | Publicado: Junio 10 2004, 00:31   |
It's easy, isn't it?
10 goto 20
20 goto 10
or even shorter (result remains the same (nihil)):
10 goto 10
 But I guess this isn't what you're looking for... 
I think you probably aiming at the one-liner compo like thing in for example MCCM. Although it was called 'Kort & Krachtig' there. It meant as much as this: you could send in your program (be it coded in ASM, BASIC, PASCAL, C, ...) and the recensor wrote a nice quote for it.
But if this isn't what you're trying to say, please explain yourself more closely...  |
|
Yukio msx professional Mensajes: 814 | Publicado: Junio 10 2004, 02:19   |
TRON
Tron
Ok
10 goto 20
20 goto 10
Run
[10][20][10][20][10][20][10][20][10][20]
[10][20][10][20][10][20][10][20][10][20]
[10][20][10][20][10][20][10][20][10][20]
[10][20][10][20][10][20][10][20][10][20]
Break in 20
Ok
Troff
Ok
Quote:
| or even shorter (result remains the same (nihil)):
|
Tron
Ok
10 goto 10
Run
[10][10][10][10][10][10][10][10][10][10]
[10][10][10][10][10][10][10][10][10][10]
Break in 10
Ok
Quote:
|  But I guess this isn't what you're looking for... 
I think you probably aiming at the one-liner compo like thing in for example MCCM. Although it was called 'Kort & Krachtig' there. It meant as much as this: you could send in your program (be it coded in ASM, BASIC, PASCAL, C, ...) and the recensor wrote a nice quote for it.
But if this isn't what you're trying to say, please explain yourself more closely... 
|
I think that it's it.
There was the same thing over here.
Do you have something good?
I still have some of my old things.
|
|
Yukio msx professional Mensajes: 814 | Publicado: Junio 10 2004, 13:22   |
Some examples.
|
|
wolf_
 msx legend Mensajes: 4700 | Publicado: Junio 10 2004, 13:32   |
1 RUN
 |
|
Sonic_aka_T
 msx guru Mensajes: 2266 | Publicado: Junio 10 2004, 13:46   |
I think there was a 'oneliner' in the MRC Snowfall Challenge as well. I think it used one line of normal BASIC to achieve a snowfall efftect. Check the downloads database. Also the Dutch MSX magazine MCM had a lot of oneliners in the earlier editions. Perhaps somesone could send you a few, unfortunately I don't have any... |
|
Yukio msx professional Mensajes: 814 | Publicado: Junio 10 2004, 13:49   |
I remember about the oneliner in the Snowfall challenge.
A working e-mail would help a lot!
|
|
Yukio msx professional Mensajes: 814 | Publicado: Junio 10 2004, 13:53   |
Quote:
| Anyway, I kinda forgot my point now ... just don't be offended that easily, and as I said before USE AN ABUNDANT AMOUNT OF SMILEYS!! even when you mean something
|
How do you use smiles on MSX Resource Center Foundation?
I was trying to use some of them. |
|
wolf_
 msx legend Mensajes: 4700 | Publicado: Junio 10 2004, 14:06   |
: ) ; ) : D etc. without spaces ...
|
|
pitpan msx master Mensajes: 1377 | Publicado: Junio 10 2004, 15:18   |
There are some collection of two-liners out there. I think that Ricardo Bittencourt has his own collection on-line. And you could find some others at Marat Fayzullin's home page.
|
|
NYYRIKKI msx master Mensajes: 1509 | Publicado: Junio 10 2004, 15:51   |
Here are some examples of small BASIC codes, that I've done:
FEELINGS.BAS (Saturday morning feelings description in 256 colors) :
10 SCREEN8,3:VDP(6)=1:VDP(2)=3:FORI=0TO300:I=IAND255:CIRCLE(8,8),IAND7,I:COPY(0,0)-(255,15)TO(16,0),,XOR:CIRCLE(248,24),IAND7,255-I:COPY(255,16)-(15,31)TO(240,16),,XOR:VDP(24)=(SIN(I/12)*100+I)AND255:PUTSPRITEIAND31,(RND(5)*240,RND(4)*255),IAND15,4:NEXTI
NONELINE.BAS (Something weird moving on screen)
10 SCREEN8,2:VDP(2)=0:VDP(6)=0:FORI=0TO300:I=IAND255:K=(K+1)AND255:R=SIN(I/7)*128+128:LINE(0,0)-(15,3),R:COPY(254,0)-(0,3)TO(255,0):LINE(255,4)-(240,7),R:COPY(1,4)-STEP(255,3)TO(0,4):PUTSPRITEIAND31,(R*.93,COS(I/20)*240),IAND15:VDP(24)=-I*9AND255:NEXTI
DORKA2.BAS (Second version of Dorkanoid, that is a Arcanoid clone)
1 O=1:P=1:K=4:CLS:FORI=0TO0:S=STICK(0):X=X+(S=7)-(S=3):X=X-(X<0)+(X>11):Y=X*2+2:K=K+O:O=O+O*(K>30ORK<4)*2:L=L+P:P=P+P*(L>7ORL<1)*2:LOCATEK,L:PRINT"o":LOCATEA,B:PRINT" ":A=K:B=L:I=L<8ORY<KANDY+6>K:LOCATEY,9:PRINT" --- ":H=H-(L=0):PRINT"Score:";H:NEXT
|
|
Yukio msx professional Mensajes: 814 | Publicado: Junio 10 2004, 17:10   |
Cool !
Quote:
| 1 RUN

|
1 Print"Run ! ";:Run
 |
|
wolf_
 msx legend Mensajes: 4700 | Publicado: Junio 10 2004, 17:14   |
1 ?"run!";:run
shorter  |
|
[D-Tail]
 msx guru Mensajes: 3013 | Publicado: Junio 10 2004, 20:01   |
Quote:
| 1 ?"run!";:run
shorter 
|
That doesn't count, wolf_. The '?' will be extended to 'PRINT' nonetheless... I also recall a quote in MCCM which said that oneliners contained such statements shouldn't be considered true oneliners.
True, you can type them in 1 single line (<= 255 characters), but when you list it again, the compressed stuff like '?' will be expanded to 'PRINT', the line will overflow, and it isn't valid BASIC anymore. A thing which actually does the trick is " ' " instead of " REM ", because that statement won't be expanded. But I guess you don't use such statements in your proud oneliner...  |
|
[D-Tail]
 msx guru Mensajes: 3013 | Publicado: Junio 10 2004, 20:06   |
Oh, and what you could do, is change the '1' into '0' (the first line number becoming 0). Don't use ON ERROR GOTO 0 then ^^;. This will save you ~some~ memory (about 1 byte, I guess). Please take note of the fact that your program will be executed faster as well  |
|
|
|
|