C64 Archives

Everything about the Commodore 64, or C64 or CBM 64. Some even called him the VIC-64. I got mine in the mid eighties, used from a neighbour – complete with monitor and 1541 disk drive (vintage 1982/1983), and even a needle printer. I later got hold of a C16 Datasette (the dark grey one) which connected to my C64 via an adaptor. I used it until 1992/1993.

Working with Keyboard Input in Commodore BASIC

In this episode I’ll show you three ways to take user input from the keyboard in Commodore BASIC. The INPUT and GET commands work on all systems, while the GETKEY command only works on the Plus/4 and C128. I’ll demonstrate how to use all of them. This will come in handy for our little lottery … Read more

Thoughts about the C64 Mini by Retro Games Ltd

In Europe, the brand new C64 Mini has just been released. Although I don’t have one myself, I’ve been following the Indiegogo campaign and have watched several “unboxing reviews” on YouTube. I must admit it’s a neat little machine, and I like the idea of somebody making the Commodore days available to a new generation … Read more

How to print numbers as columns in Commodore BASIC

In this episode I’m demonstrating how to print numbers in evenly spaced columns in Commodore BASIC.

On the C128 and the Plus/4 we can use a nifty little function called PRINT USING for this, with which we can format the output of any printed text or variable.

On the C64 and VIC-20 that function doesn’t exist, so we’ll have to convert a numeric value into a string (using the STR$ function), and then determine how long our string is. Following that we’ll have to manually pad our string value with as many spaces as are required.

Read more

Sorting an Array on the Commodore 64

In this episode I’ll demonstrate how to sort a numeric array on the Commodore 64. The same principle works for string arrays, and of course on all other Commodore BASIC computers. The technique I’m using here is called Bubble Sort: in effect we’re comparing the first two items in the array, and if the left … Read more

How to generate Lottery Numbers on the Commodore 64

In this episode I’ll demonstrate how to draw random lottery numbers on a Commodore 64. The secret sauce here is not only the RND function to generate random numbers, but also two loops inside each other that prevent the same number from coming up more than once. Here’s the lottery generator code: 10 x=rnd(-ti) 20 … Read more

How to build a Word Splitter on the C64 in Commodore BASIC

In this episode I’m demonstrating how to build a word splitter on the Commodore 64. We’ll use string functions to parse a sentence and split each word off into an array of words so that they can be analysed later (for example, as part of an adventure game). Here’s the code I’m building: 20 input … Read more

How to build a time of day clock on the Commodore 64

In this video I’ll demonstrate how to build a simple clock on the C64. We’ll go through this process step by step, including the built-in TI and TI$ variables, string formatting with LEFT$, RIGHT$ and MID$, as well as screen formatting. Here’s the code I’m writing – works in Commodore BASIC v2 and above: 5 … Read more

How to create random YouTube URLs in Commodore BASIC v2

In this episode I’ll demonstrate how to create those seemingly random YouTube Video IDs using a Commodore 64. Here’s the code I’m writing – works in BASIC v2 and above: 10 print chr$(14) 20 gosub 100:x=rnd(-ti):cn=1 30 a$=”https://youtu.be/” 40 for i=1 to 11 50 rn=int(rnd(0)*62)+1 60 a$=a$+yt$(rn) 70 next 80 print:print cn;” : “;a$ 85 … Read more