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

Discuss anything related to the VIC
Empa Kendo
Vic 20 Amateur
Posts: 54
Joined: Sat May 20, 2006 12:11 pm
Website: https://www.youtube.com/watch?v=NX1bTh8DqNQ

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

Post by Empa Kendo »

I am not sure who of you had noticed this book "10 PRINT CHR$(205.5+RND(1)); : GOTO 10", which is roughly 300 pages about a single (!) line of code..

You can download it here: http://10print.org/

Whilst the book is primarily about the Commodore 64 and has an ostentatiously academic overtone, some of the sections are fun to browse through:

- the code (which also nicely runs on the VIC-20) and its variations in other 8bit BASIC dialects
- a lengthy section on BASIC and its background
- why the code is hard to write for an Atari VCS
- some 6502 machine code


What do you make of it?
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

The output looks a lot prettier on a Vic-20.
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
Witzo
Vic 20 Afficionado
Posts: 381
Joined: Thu Dec 01, 2011 9:14 am
Location: The Hague

Post by Witzo »

Haha, I accidentally ran it first in lower case mode, thinking "so what's up with all the letters M and N?".
Then I shifted to upper case. Mind blown.
adric22
Vic 20 Hobbyist
Posts: 143
Joined: Fri Mar 11, 2005 6:54 pm

Post by adric22 »

I laughed when I saw this a few days ago.

The code is only slightly modified version of a 3 or 4 line program right out of the VIC-20 user manual.

As memory serves the program was called "Random Maze" and it actually used a random statement to generate a 0 or a 1. Then it used two IF statements to decide which CHR$ to print. At least, that is how I remember it. And yes, it looks better on the VIC-20 than the C64 due to the differences in the font.
User avatar
orion70
VICtalian
Posts: 4342
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

I wonder why the diagonal characters in C64 do not merge - 3D mazes look awful!
User avatar
Jeff-20
Denial Founder
Posts: 5761
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

adric22 wrote:The code is only slightly modified version of a 3 or 4 line program right out of the VIC-20 user manual.
Page 102. It actually precedes the C64 program. And looks much better on the vic.
High Scores, Links, and Jeff's Basic Games page.
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

orion70 wrote:I wonder why the diagonal characters in C64 do not merge - 3D mazes look awful!
They made the whole character set thicker on the c64. Probably to "hide" some of the artifacts from using higher resolution. (As discussed here: http://sleepingelephant.com/ipw-web/bul ... 7&start=15 ). There are actually duplicate characters in the c64 character set because of this. Lines on different positions on the vic-20/pet ends up as same position thicker line on the c64.
Last edited by Boray on Wed Dec 05, 2012 2:06 pm, edited 1 time in total.
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
Jeff-20
Denial Founder
Posts: 5761
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

The effect is that the c64 lines do not seem to connect with this program. Vic looks better to me.
High Scores, Links, and Jeff's Basic Games page.
Empa Kendo
Vic 20 Amateur
Posts: 54
Joined: Sat May 20, 2006 12:11 pm
Website: https://www.youtube.com/watch?v=NX1bTh8DqNQ

Post by Empa Kendo »

I also prefer the VIC20 version. I am still amazed at putting out 300 pages about a single line of simple code. The book is sold out on Amazon at the moment.
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

Someone could probably write a 600 page book about a single dot as well.
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Post by Kweepa »

Well, the code is just a kicking off point for a bunch of discussions about programming, mazes, etc.
It goes off the rails a bit in my opinion when discussing the 2600 port of the line - although I appreciate that they were geeky enough to do a 2600 port, I feel that it's there mostly because they like the 2600 and not because it's relevant to the discussion.

600 pages about a dot? No problem. A discussion of displaying a dot on various computers and display devices. There you go.
adric22
Vic 20 Hobbyist
Posts: 143
Joined: Fri Mar 11, 2005 6:54 pm

Post by adric22 »

I created a somewhat faster routine and actually creates more interesting patterns.

Code: Select all

10 A=162
20 PRINT CHR$(205+PEEK(A)AND1));:GOTO 20
User avatar
buzbard
Vic 20 Devotee
Posts: 213
Joined: Sun Jul 03, 2005 9:10 am

Post by buzbard »

adric22 wrote:I created a somewhat faster routine and actually creates more interesting patterns.

Code: Select all

10 A=162
20 PRINT CHR$(205+PEEK(A)AND1));:GOTO 20
?SYNTAX
ERROR IN 20
READY.
Ray..
User avatar
Mayhem
High Bidder
Posts: 3028
Joined: Mon May 24, 2004 7:03 am
Website: http://www.mayhem64.co.uk
Location: London

Post by Mayhem »

Yeah, there's an extra close bracket ) that needs pairing up.
Lie with passion and be forever damned...
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

How about this one then?

Code: Select all

0 print"{clr}M";:fort=1to126:print"MNMM";:next
1 goto1
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
Post Reply