How to create random YouTube URLs in Commodore BASIC v2

Published: March 27, 2018, 1:51 p.m.

b'
\\nIn this episode I’ll demonstrate how to create those seemingly random YouTube Video IDs using a Commodore 64.
\\nHere’s the code I’m writing – works in BASIC v2 and above:
\\n10 print chr$(14)
\\n20 gosub 100:x=rnd(-ti):cn=1
\\n30 a$="https://youtu.be/"
\\n40 for i=1 to 11
\\n50 rn=int(rnd(0)*62)+1
\\n60 a$=a$+yt$(rn)
\\n70 next
\\n80 print:print cn;" : ";a$
\\n85 cn=cn+1
\\n90 goto 30
\\n85 cn=cn+1
\\n90 goto 30
\\n
\\n100 rem populate array
\\n110 dim yt$(62)
\\n120 i=1
\\n130 for j=65 to 90
\\n140 yt$(i)=chr$(j)
\\n150 i=i+1
\\n160 next j
\\n170 for j=193 to 218
\\n180 yt$(i)=chr$(j)
\\n190 i=i+1
\\n200 next j
\\n210 for j=48 to 57
\\n220 yt$(i)=chr$(j)
\\n230 i=i+1
\\n240 next j
\\n299 return
\\nThe first line switches to lower case letters (I forgot to show that in the video).
\\nNOTE: In addition to the upper case and lower case alphabet, and the numbers 0-9, YouTube also use two special characters that I forgot to mention in the video. One is the standard minus sign (-), and the other one is the underscore (_). The Commodore machines cannot produce the latter. For simplicity’s sake, I’ve left both of those out (just though I’d mention it here).
\\nInspired by Tom Scott’s video “Will YouTube ever run out of Video IDs” – watch it here: https://www.youtube.com/watch?v=gocwRvLhDf8
'