Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

10 PRINT CHR$(205.5+RND(1));:GOTO 10

258 views
Skip to first unread message

Vince Weaver

unread,
Apr 10, 2013, 12:13:31 PM4/10/13
to
So I went to a talk by the authors of the
"10 PRINT CHR$(205.5+RND(1));:GOTO 10"
book today ( http://10print.org/ )

They had a C64 there and were going on about its features and it took
some restraint not to shout "Apple II Forever!" at key moments.

Anyway, the aforementioned program they use as an example, which prints
a maze-like pattern on the C64, simply prints
NNNMNMNMNNMNMNMNMNMNMNMNMNMNMNMNMNNM
etc. on an Apple II.

The closest equivelant to the C64 code I could come up with was
10 PRINT CHR$(47+(INT(.5+RND(1))*45));: GOTO 10
which works but isn't as elegant.

So does anyone have any clever, short, one-line BASIC demos that look
cooler than the C64 code? I know various of the Nibble magazine one
liners look cool, but often they are pushing the limits of what you
might consider one-line. What can you do in 80 columns or less?

I find that modifying their code with a POKE makes a nice picture without
changing anything else:
10 POKE -16304,0:PRINT CHR$(205.5+RND(1));:GOTO 10

Vince


Riccardo

unread,
Apr 10, 2013, 1:12:06 PM4/10/13
to
10 WAIT - 16384,128: P=1212: FOR I=0 TO 1 STEP 0: POKE P,214: HTAB 40: VTAB 22:PRINT "**": I=SCRN(P-1192,20)/5-1: IF I=1 OR I=0 THEN PRINT CHR$(7):POKE P,160: HTAB RND (1)*38+1: VTAB 24:PRINT "*": P=P+INT((PEEK(-16384)-142)/6: S=S+1: NEXT: PRINT TAB(14)"POINTS ="S: FOR I=1 TO 2000: NEXT I: HOME

gid...@sasktel.net

unread,
Apr 10, 2013, 1:21:08 PM4/10/13
to

10 PRINT CHR$(95+(INT(RND(1)+.5)*29));: GOTO 10


Riccardo

unread,
Apr 10, 2013, 1:45:28 PM4/10/13
to

10 DEF FN W(Z) = - 100 / ((I * I / 2000) + (E * E / 1800) + 1):S = SIN (2.8):C = COS (2.8): HGR2:HCOLOR= 7: FOR E = - 140 TO 140 STEP 17.5: FOR I = - 140 TO 140: HPLOT (I - E * C) / 2 + 143, FN W(Z) + E * S + 112:NEXT I,E:FOR I = - 140 TO 140 STEP 17.5: FOR E = - 140 TO 140: HPLOT (I - E * C) / 2 + 143, FN W(Z) + E * S + 112: NEXT E,I

Riccardo

unread,
Apr 10, 2013, 2:01:45 PM4/10/13
to
10 PRINT"APPLE ][ FOREVER": GOTO 10

Benoit0123

unread,
Apr 10, 2013, 4:02:13 PM4/10/13
to
A tiny improvement to your first attempt:
0 PRINT CHR$( 47 + ( RND( 1) > .5) * 45);: GOTO
Note the absence of line number for the GOTO, some would say it's not a bug
but a feature (of Applesoft of course).
HTHATS,
Benoît



Riccardo

unread,
Apr 10, 2013, 5:07:11 PM4/10/13
to
10 PRINT CHR$(4);"PR#3":PRINT CHR$ (17):INVERSE
15 PRINT CHR$(27);"T";:GOTO 15

MOUSETEXT BUT NOT ONE LINE

gid...@sasktel.net

unread,
Apr 10, 2013, 9:18:03 PM4/10/13
to
You could do it this way to get one line

10 ? CHR$(4)"PR#3": ?CHR$(17)CHR$(27)CHR$(15);: FORI=0TO1: ?"T";: I=PEEK(-16384)>127: NEXT

Steve Nickolas

unread,
Apr 10, 2013, 9:51:20 PM4/10/13
to
0 POKE 49167,0:FLASH:? "T";:GOTO

Trust me =P

-uso.

Riccardo

unread,
Apr 11, 2013, 5:11:35 AM4/11/13
to
10 POKE 49167,0:FLASH:A=RND(1):IF A>0.05 THEN PRINT "T";
20 PRINT "L";
30 GOTO 10

Yeah!

No one line yet

gid...@sasktel.net

unread,
Apr 11, 2013, 9:10:56 AM4/11/13
to
> 0 POKE 49167,0:FLASH:? "T";:GOTO



This doesn't always work.

Type ?chr$(24) at the prompt, then run this again.

Vince Weaver

unread,
Apr 11, 2013, 4:14:00 PM4/11/13
to
On 2013-04-10, gid...@sasktel.net <gid...@sasktel.net> wrote:
>
> 10 PRINT CHR$(95+(INT(RND(1)+.5)*29));: GOTO 10

I like this one a lot!

The mouse text ones are good too, and only fair, as the Commodore 64
code is using their equivelant of mouse text (and the C64 came out a
lot later than the original Apple ][).

As for graphics ones, I like the look of this one and have had it
running all day:
10 POKE -16304,0: PRINT CHR$((63.5+RND(1));:GOTO 10

Vince

barry...@yahoo.com

unread,
Apr 11, 2013, 5:49:19 PM4/11/13
to
On Thursday, April 11, 2013 1:14:00 PM UTC-7, Vince Weaver wrote:
>
> 10 POKE -16304,0: PRINT CHR$((63.5+RND(1));:GOTO 10
>
>
>
> Vince

Nice! But one too many '('s.

Mike

mmphosis

unread,
Apr 11, 2013, 6:23:00 PM4/11/13
to
I like the mousetext version. Apple II forever!

I wrote a graphics version with scrolling some time ago when 10PRINT first
came out...

0 HIMEM: 8192
1 GOSUB 5
2 FOR X = 0 TO 279 STEP 7
3 DRAW RND (1) + 1.5 AT X,184
4 NEXT : CALL 24576: GOTO 2
5 HGR : POKE 49234,0: READ L$
6 READ H$:B = 24350:A = B
7 FOR I = 1 TO LEN (L$)
8 H = ASC ( MID$ (H$,I,1))
9 L = VAL ( MID$ (L$,I,1))
10 POKE A,(H - 65) * 10 + L
11 A = B + I: NEXT :H = 233
12 POKE H,B / 256:L = 232
13 POKE L,B - PEEK (H) * 256
14 CALL 24411: SCALE= 1
15 HCOLOR= 0: CALL 24384
16 HCOLOR= 3: ROT= 0: RETURN
77DATA206090666666888887068644444033333058170170237085837190658190696339232360027294599225563597225062418320355285295587244591225079222507571086903724185966852852655041728551520820365520011503144442413513141442573000503062836269320029
88DATAAAAABAEEEEEEWCCCCAAOBEEEEEEGCCCCCAQWOHKEMYBHMYAQWHMOHKJQWOHKJQJNZQANZNXQANXQANXQSDSJQXNXQPDSJXXXWTUXQARYJDTJXSYJUYQSNXQODSJXXQODSJXXQXUEUXQANXXWTUWQJHTJDTJDUJQZCKXDTJQZOZUUAXZJQXHBBEDAXNZKHHHHHEAAZNZKECOAKMNZBBAZNZJUEAHAJQVQRAQD

http://mmphosis.a2hq.com/labyrinth/

barry...@yahoo.com

unread,
Apr 11, 2013, 11:34:29 PM4/11/13
to
On Thursday, April 11, 2013 3:23:00 PM UTC-7, mmphosis wrote:
> I like the mousetext version. Apple II forever!
>
>
>
> I wrote a graphics version with scrolling some time ago when 10PRINT first
>
> came out...
>

Cool! I like the way that you almost effortlessly created that 1945-byte speed-optimized scroll routine. Could you explain why you didn't index the clear-line part at the end, and why you chose to alternate the 'sta's and 'stx's? I suppose that it could have made the 'automated' creation of the routine easier, and I could figure it out for myself by carefully dissecting the BASIC, but I'm feeling a little lazy tonight ... it's been a rough day at work :-/

Mike

mmphosis

unread,
Apr 13, 2013, 5:52:22 PM4/13/13
to
> Could you explain why you didn't index the clear-line part at the end, and
> why you chose to alternate the 'sta's and 'stx's?

For speed and color ...

15 HCOLOR= 6: CALL 24384
16 HCOLOR= 7: ROT= 0: RETURN

You can change the background and foreground colors in lines 15 and 16, and
the routine will still work.

BLuRry

unread,
Apr 14, 2013, 9:42:27 PM4/14/13
to
I believe this was discussed a few months ago. You can change the math to flip between / and \ characters and then it works fine -- just requires a little manipulation to make it work on the //.
0 new messages