Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tevion5

macrumors 68000
Original poster
Jul 12, 2011
1,966
1,600
Ireland
So I've been messing with my new Commodore 64 and Apple II, trying to learn a bit of BASIC for fun. I already do C so BASIC is much simpler by comparison. My uncle gave me his C64 with a bunch of peripherals recently including great manuals, documentation and a great BASIC book. I even got a free 1701 from my college they were throwing out!

I have been making some basic programs and saving them to Cassette. However, I tried to follow one tutorial where they ask you to make a ball bounce around the screen and I can't see where I've gone wrong, but I know I have because I get flying text instead of a ball. :p

Don't suppose anybody here has an eagle eye for BASIC bugs? :)


Code:

Photo 13-01-2015 15 23 42.jpg


Result:

Photo 12-01-2015 19 33 08.jpg
 

David Schmidt

macrumors 6502
Aug 22, 2006
319
11
Southeastern USA
Don't suppose anybody here has an eagle eye for BASIC bugs? :)
I see the bug... but it's particular to the C64, not an Apple. You typed in all their little hints as to how to get cursor movement characters within quotes, but you didn't actually follow their instructions.

You have to hit the quote character, hit the requested cursor movement key (i.e. see a goofy character appear instead of actually producing cursor movement), then close the quote. It takes some getting used to...
 

tevion5

macrumors 68000
Original poster
Jul 12, 2011
1,966
1,600
Ireland
I see the bug... but it's particular to the C64, not an Apple. You typed in all their little hints as to how to get cursor movement characters within quotes, but you didn't actually follow their instructions.

You have to hit the quote character, hit the requested cursor movement character (i.e. see a goofy character appear instead of actually producing cursor movement), then close the quote. It takes some getting used to...

Oh, so you mean inserting the arrow symbol in place of all the CRSR LEFT and such?

So would it be like:

40 PRINT" *(<-)...

or

40 PRINT" *<-...

?
 

David Schmidt

macrumors 6502
Aug 22, 2006
319
11
Southeastern USA
Cursor manipulation characters

No good way to represent PETSCII with an ASCII character set. Which is why you have all those typing conventions... you have to learn to parse them in your head not as literals but as commands to do something on the keyboard when in quote mode.
 

Attachments

  • ball.png
    ball.png
    20.2 KB · Views: 139

tevion5

macrumors 68000
Original poster
Jul 12, 2011
1,966
1,600
Ireland
No good way to represent PETSCII with an ASCII character set. Which is why you have all those typing conventions... you have to learn to parse them in your head not as literals but as commands to do something on the keyboard when in quote mode.

That's a great response! Thanks very much. I'll have to get back and try again with this in mind tomorrow.
 

ApplemanY

macrumors newbie
Jan 27, 2015
9
0
Cambs UK
I remember trying to write an AppleSoft Basic programme to write data to disks.

We lived in Berkshire, England in thoise days and I tried without success to store town names.... the two largest were Reading and Newbury.

Unfortunately when we stored Reading it only saw the first four letters and the drive started to run and had to be halted.

Even worse when we stiored Newbury it wiped the disk and memory!

We sorted it eventually but it was a pain not knowing basicstuff like that and from then on I left programming to the programmers!

ApplemanY
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.