How to print Numbers as Columns in Commodore BASIC
In this video 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...
read moreSorting an Array on the Commodore 64
In this video 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 one is larger than the right one, the values are swapped around. This loop continues until all items in the array have been compared and sorted (hence the smallest items “bubble” to the front of the array, much...
read moreHow to generate Lottery Numbers on the Commodore 64
In this video 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 for i=1 to 6 30 rn=int(rnd(1)*49)+1 40 for j=1 to i 50 if n(j)=rn then 30 60 next j 70 n(i)=rn 80 next i 100 print 110 for i=1 to 6 120 print n(i); 130 next 140 print 199 end To adapt this listing to match your local...
read moreHow to build a Word Splitter on the C64 in Commodore BASIC
In this video 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 a$ 30 gosub 100 40 print:print wd;" words:" 50 for i=1 to wd 60 print wd$(i) 70 next 99 end 100 rem word splitter 110 lt$="":wd=1 120 for i=1 to len(a$) 130 lt$=mid$(a$,i,1) 140 if lt$=" " then...
read moreHow 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 input "qwhat is the current time (hhmm ss) ";ti$ 10 print chr$(147):print chr$(5) 20 a$ = left$(ti$,2) 25 a$ = a$ +":" 30 a$ = a$ + mid$(ti$,3,2) 35 a$ = a$ +":" 40 a$ = a$...
read moreHow 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 cn=cn+1 90 goto 30 85 cn=cn+1 90 goto 30 100 rem populate array 110 dim yt$(62) 120 i=1 130 for j=65 to 90 140 yt$(i)=chr$(j) 150 i=i+1 160 next j 170 for j=193 to 218...
read moreMy honest Logitech C920 Review (2018)
In this video I’m taking a closer look at the Logitech C920 webcam. I’m testing it on my Mac running Sierra, as well as under Windows 10 Pro. I wanted a 1080p capable webcam for use with Camtasia, mainly for my Windows system which currently doesn’t have a webcam. Let’s find out if it does what I wanted it to do.
read moreWhat is my YouTube Channel URL
In this video I’ll show you four ways of finding your YouTube Channel’s URL. I’ll also explain why there are three types of YouTube Channel URLs, and what the query parameters are that you can append. Just in case watching videos isn’t your thing, or you’re in a hurry, I thought I’d include some written instructions as well Method 1: YouTube Homepage, right after login Right after you login to YouTube, you’ll find a menu on the top right corner. There should be a link to Your Channel – if...
read moreHow to retrieve the total word count from all posts in WordPress
Most of my own WordPress sites have been up for longer than a decade at the time of writing, and I was wondering how much I had written in that time. Post count notwithstanding, I was interested in the total word count of my output in that period of time. Here’s a small function that retrieves just that. Word Count in Posts Comments But word count from posts is not all that a website adds up to: I have answered several thousand comments since then, and my answers may fill a whole book just by itself. Here’s how to retrieve the...
read moreHow to shutdown Windows 10 without applying updates
Although most of Windows 10 keeps getting better with every iteration, some things just never change. Windows Updates are one of those. They always want to download and install when we really don’t have the time or the battery power. What’s worst, Microsoft have removed the graphical option to simply shutdown the system – and all we’re left with are two choices: “Update and shutdown”, or “Update and restart”. What if all we want to do is to shutdown or restart WITHOUT applying those updates?...
read more