[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 10 PRINT CHR$(205.5+RND(1));:GOTO 10
Vince Weaver wrote:
> 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
>
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