Below you will find pages that utilize the taxonomy term “Vintage”
Dragon Curves
10 PRINT in Rust vs C
Introduction
We’ve done 10PRINT on a lot of machines.
But we haven’t done a comparison between Rust and C.
For no particular reason, I thought it would be fun to compare the two languages side by side.
A race? Yes, please.
10 PRINT Quick review
10 PRINT is a one-liner program that generates a maze-like pattern using the characters /
and \
.
The program is based on a one-liner BASIC program from the late 70s and 80s. There’s even been a book written about it called: “10 PRINT CHR$(205.5+RND(1)); : GOTO 10”.
wAx the VIC-20
Wax
Over the years, I’ve looked for an Assembler for the VIC-20. Sure, there are great cross-assemblers like Kick Assembler, but I wanted something that would run on the VIC-20 itself.
Is the VIC-20 a good machine on which to write assembly? Maybe not ON the machine. The 22-column screen is a bit limiting, but after spending so much time in Turbo Macro Pro on the C64, I wanted to see what I could do on the VIC-20 natively.
10 PRINT on the HP-42s
Over the years, I’ve been on a silly quest to do 10PRINT on as many things as I can. They end up on X, here, or sometimes both.
I hadn’t considered it before because I just figured I couldn’t print the "/"
and "\"
characters on the HP-42s.
I was wrong. It’s pretty easy. After a few minutes in the manual, I figured it out.
00 { 45-Byte Prgm }
01▸LBL "TEN"
02 RAN
03 RAN
04 X>Y?
05 GTO "\"
06▸LBL "/"
07 ├"/"
08 AVIEW
09 PSE
10 GTO "TEN"
11▸LBL "\"
12 ├"\"
13 AVIEW
14 PSE
15 GTO "TEN"
16 END
The program is pretty simple. It generates two random numbers and compares them. If the first is greater than the second, it prints a "/"
and goes to the next iteration. If the second is greater than the first, it prints a "\"
and goes to the next iteration.
The McNuggets Problem
My son, now 25, was a McNuggets fan. Can you blame him? They’re delicious. He’s always been into numbers and puzzles, so I introduced him to the McNuggets problem when he was about 10.
This classic puzzle was a fun way to keep him occupied and teach him programming. The problem is simple: McDonald’s used to sell Chicken McNuggets in 6, 9, and 20 packs. What is the largest number of McNuggets you cannot buy using these package sizes?
Back to the basics with BASIC (and Python): Binary Search
Back to the basics with basic
Let’s say for a moment that we’ve got an ordered list of numbers.
1,3,5,7,9,11,13,15,17,19,21,23,25
There are 13 values here and we want to check if the number 25
is in this list.
One way to do this would be to loop over each element in the list and check to see if it matches what we’re looking for.
In BASIC, we’d do something like