- 8 (bit) Days of Christmas: Day 0 (Go Tell It On the CoCo!)—Thursday, December 24th, 2020
-
Arron W. Branigan did some pretty cool art for his Christmas program. On Day 110 I used his snowman image from the December, 1986 Rainbow article “Go Tell It On the CoCo”, and I chose his nativity scene from the same program for today. It’s Christmas Eve, and the cattle are lowing.
Would you like to know what cattle look like in Extended Color BASIC?
- 1270 REM ***COW***
- 1280 LINE (24,156)-(0,156),PSET
- 1290 LINE -(0,140),PSET
- 1300 CIRCLE (8,141),8,8,1,.50,.75
- 1310 LINE (8,134)-(28,130),PSET
- 1320 LINE -(36,132),PSET
- 1330 LINE (40,144)-(36,130),PSET
- 1340 LINE -(48,130),PSET:LINE -(44,144),PSET:LINE -(40,144),PSET
- 1350 LINE (46,141)-(44,156),PSET
- 1360 LINE -(28,152),PSET
- 1370 LINE -(16,152),PSET
- 1380 LINE (24,156)-(24,152),PSET
- 1390 LINE (36,140)-(40,153),PSET
- 1400 LINE -(28,152),PSET
- 1410 CIRCLE (42,116),25,2,.5,.15,.38
- 1420 PSET (39,133,2):PSET (45,133,2)
- 1430 PAINT (20,144),8,8
- 1440 CIRCLE (8,152),15,3,1,.75,1
- 1450 CIRCLE (36,150),15,3,1,.50,.25
- 1460 COLOR 2,1
- 1470 LINE (42,132)-(42,138),PSET
The LINE statement acted a little like the turtle in the old LOGO programming language. There’s a pencil position, and LINE remembers it. If you leave out the starting position, as Branigan does several times here, ECB assumes that the line starts where the previous line left off. If there was no previous line, it starts in the middle, location (128, 96). And remember that locations are mode independent in Extended Color BASIC. It doesn’t matter if you’re in high resolution, medium resolution, or low resolution, the location numbers will be the same.
If you want to see just the cow, add a line 1269 and a line 1471:
- 1269 PMODE 3,1:SCREEN 1,0:PCLS 3:COLOR 4,1
- 1471 GOTO 1471
Then, type GOTO 1269.
- 8 (bit) Days of Christmas: Day 1 (Do You Hear What I Hear?)—Wednesday, December 23rd, 2020
-
By the end of 1987, most of the cool programs in the Rainbow were for the Color Computer 3. The CoCo 3 was a giant leap forward, both in its innate capabilities—better graphics, better text manipulation on graphics displays, better text output if you had a good monitor—and in the software available for it. OS-9 Level 2 was a phenomenal operating system. All for only $129.95!1
But there was still life left in the old system, too, as John Mosley showed us in “Do You Hear What I Hear?” in the December 1987 issue of The Rainbow. What we heard was some of the best music to come out of the Color Computer 1 and 2. “Your ears do not deceive—it’s CoCo singing in four voices!”
That music didn’t come without some work on the part of the reader. If you didn’t subscribe to the tape or disk version of the magazine, you had to first type in a program that asked you for a starting memory address to POKE the code into, and then the program asked you, one `INPUT` at a time, for the hexadecimal values of the code:
Enter Listing 3 one hexadecimal value at a time… When you are through entering Listing 3, or when you have to stop entering, type S and press ENTER… If you are just stopping temporarily and plan to resume entering later, write down the number to the left of the ‘S’ you typed before you press ENTER… When you are ready to resume entering, use that number as your start address. You will have to load the old file you saved before you can resume entering Listing 3.
He doesn’t mention what to do if the music doesn’t play—if you made a mistake entering those four thousand hexadecimal values. I probably would have provided another short program to PEEK the values in memory, displaying them twelve to a line for verification against the printed text. But perhaps it was assumed that people would know how to do this. I’ll show how I entered those hex values in a week or two.
Long-time readers of this blog will not be surprised to learn that I did not type them in to an `INPUT` prompt one at a time.
Like Eugene Vasconi’s Holiday Hearth, Mosley’s program uses multiple files. In his case, however, one file is the combined machine language program/musical notes and the other is a simple 42-line BASIC program to wish us Merry Christmas while the music plays. The relevant code for that loop is:
- 350 EXEC&H3F00
- 360 FORT=1TO3000:NEXTT:GOTO350
- 8 (bit) Days of Christmas: Day 10 (Up on the Rooftop)—Tuesday, December 22nd, 2020
-
So far all of the Christmas images I’ve chosen have been drawings for display while music is playing. This image from J.D. German’s “Up on the Rooftop” from the December 1986 Rainbow is an image from a video game.
Actually, it’s not a game in the usual sense, since there is no scoring or clock to play against. But it is fun—so much fun that you may have trouble getting the kids to give up the computer when it’s your turn.
This is a genre of “game” that I saw several examples of in both The Rainbow and 80-Micro, the game for younger children that involved manipulating things on the screen but not in opposition to anything—unless the child created that opposition in their own mind, which of course they probably did.
Richard Ramella, in his 80 microcomputing column Fun House, made a lot of games like this for us to type in. And many were fun even for adults. His very short text adventures were a great way to relax in a very short amount of time. If you’re interested in games like this, look for Ramella’s “Fun House”, from his column in the September 1982 issue of 80 Micro. Ramella also wrote the occasional program for The Rainbow, such as Bubble War in the February, 1986 issue.
In German’s “Here Comes Santa Claus”, the player controls the reindeer on Santa’s sleigh.
…the reindeer and sleigh behave according to the laws of physics, having to overcome momentum to change their flight path.
The player can make the reindeer pull up and pull down, while the buildings glide by below. If all of the reindeer are on the ground, and the player presses the down arrow again, Santa stops; the up arrow resumes his flight. The reindeers’ hooves beat against the ground while they’re moving against it.
And that’s it. This is an extraordinarily simple game, but it’s also fun, especially for young children who (at least back then) got a great thrill simply by making the images on the computer respond to their own actions on the keyboard or joystick.
It’s also a great lesson for beginners on how to animate graphics in BASIC on the Color Computer. He uses multiple screens to create a (somewhat, given the limitations of the time) seamless animation—he prepares each scene on a hidden screen and then displays it, hiding the current screen, which then gets changed to be the next scene, and so on.
The animation is achieved by paging back and forth between two screens. While one screen is being displayed, the other is having the figures cleared and set to a new position.
To do this and still get four colors, he uses PMODE 3; that uses four pages per screen, and since Extended Color BASIC supported 8 pages, this gave him two screens to work with: one visible and one invisible.
Santa is added last, so that he appears to be in front of the objects on the ground.
- 8 (bit) Days of Christmas: Day 11 (O Christmas Tree)—Monday, December 21st, 2020
-
Robert T. Rogers’s article, “Holly Jolly Holidays”, from the December 1984 Rainbow presented seven images and melodies:
- A snowman to the tune of Frosty the Snowman;
- A Christmas tree to Oh Christmas Tree;
- A star to Silent Night;
- A computer to Holly Jolly Christmas;
- A house in winter, to White Christmas;
- A sing-along with lyrics, for Jingle Bells;
- Flags of various countries to Joy to the World.
Item four is a bit self-referential.
If you want more songs,
Anyone can add or change the scenes and add new songs easily; just tack them at the end and change the line with RUN in it.
This is a lot of stuff for a single program. “It should fit in 16K, even though it was written on a 32K machine. If necessary, remove one picture and its music.”
Rogers also includes some tips to save memory:
When typing the listing you can omit the semicolons in the PLAY statements… Also, many of the LINE and CIRCLE statements are on separate lines for clarity; however, they can be put together on the same lines to save memory/time, just watch out for a few GOSUBs. The different segments of the programs most usually end with PLAY statements and begin with PMODEs, so if you need to eliminate routines to conserve memory, look at these areas for hacking.
I am always amused by BASIC how-to books from the era that extolled the necessity of commenting your code. As I wrote in my review of John M. Nevison’s Little Book of BASIC Style,
By the time the book came out, the audience was mostly people to whom that advice made little sense. In the penultimate chapter, he writes that “bad reasons” for code brevity “includes every argument about machine storage… Machine storage is cheap.” For him it was cheap, because someone else was paying for it. For someone with a Timex Sinclair and 2 kilobytes of RAM, space for program code was very dear. Some of his very, very short programs include more comments than code, easily using a quarter to half or more of the memory available on personal computers.
Comments were used sparingly for a reason: they took precious space away from making the computer do something useful. Rogers, in this program, uses one of the very useful tricks of the era: rather than waste a lot of space on comments, waste a little space on making the code itself more readable, and then let the reader know what to do to save memory. Tim Hartnell often had similar advice in his books.