0

10 PRINT CHR$(205.5+RND+(1));:GOTO 10 I seem to be the only person ever to not be able to do this. i have written all kinds of BASIC but I can't do anything with this. What am i missing? I get "SYNTAX ERROR IN 10" i can't get it to work And really, why would it? 205 is a memory address and so the value of 5 in and we have random number thing going but where does the pattern come from. Don't we need? "/" "\ ". 205.5 produces these/??? that doesn't make any sense. I must have an extreme misunderstanding of computers and BASIC that curiously doesn't prevent me from creating functioning programs. I also program in C and I am still completely clueless. never seen anything like this work seems like there is a hidden line 1,2,3,4,5,6,7,8,9, that wasn't listed so I don't know what the rest of the code is???
I've tried on the 64mini and several emulators and they all give the same error. Did I have a stroke and need to goto the hospital? maybe I can no longer discern what I see on the screen Lol.

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

Mo Catz
  • 1
  • 2

1 Answers1

4

As pointed out by teapot418, you have a typo in your code. The exact code is:

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

CHR$ creates the ASCII character for the given number. (What you wrote about reading from address is PEEK.)

CHR$(205) gives you the "\" and CHR$(206) the "/". The floating part of the number gets ignored. Because of the randomness, you get random sequences of CHR$(205) and CHR$(206) which creates the maze. The ; at the end of PRINT avoids a newline.

Sep Roland
  • 33,889
  • 7
  • 43
  • 76
Peter Kofler
  • 9,252
  • 8
  • 51
  • 79