A BASIC Valentine
You turn my heart upside down
I’ve been reading through some issues of Family Computing recently. It’s not really my favorite magazine as the content is rather lightweight. But the February 1985 issue had a nice interview with Jack Tramiel which I enjoyed. It also had some BASIC programs to create a Valentine which I thought was appropriate for today.
There are versions in BASIC for a variety of computers, including the Coleco Adam, Apple II, Atari, Commodore 64, IBM PC, TRS-80 CoCo, TRS-80 Model III, TI 99/4a, Timex Sinclair 1000 (ZX 81) and Commodore VIC-20. That’s a lot of systems, but this is a pretty simple program so it was a good candidate to convert. They are all about the same length and it’s interesting to see how different each version of BASIC is. Without a doubt, the ugliest versions are the Commodore 64 and VIC-20 which have to use obscure POKEs to get anything on the screen. The Sinclair version is nasty as well.
Of course, I typed in the Atari version. Here’s the resulting Valentine it creates:
Not sure why the heart is purple instead of red, but probably something to do with the emulator I used to capture the image.
And here’s the BASIC code:
5 REM COMPUTER VALENTINE
6 REM FAMILY COMPUTING, FEB 1985
10 DIM N$(20),F$(20),D$(41),M$(225)
20 OPEN #1,4,0,"K:"
30 GRAPHICS 0
40 POSITION 10,0:PRINT "-COMPUTER VALENTINE-"
50 PRINT
60 PRINT "PRESS <RETURN> AFTER EACH REPLY."
70 PRINT
80 PRINT "WHO IS THIS VALENTINE FOR";
90 INPUT N$
100 PRINT
110 PRINT "WHO IS IT FROM";
120 INPUT F$
130 PRINT CHR$(125);"PRESS ANY KEY, THEN GO GET ";N$;".";
140 GET #1,K
150 GRAPHICS 3
160 SETCOLOR 0,5,6
170 SETCOLOR 1,0,0
180 SETCOLOR 2,0,15
190 SETCOLOR 4,0,15
200 COLOR 1
210 FOR CO=7 TO 17
220 READ A,B
230 PLOT CO,A
240 DRAWTO CO,B
250 PLOT 35-CO,A
260 DRAWTO 35-CO,B
270 NEXT CO
280 COLOR 2
290 PLOT 1,8
300 DRAWTO 15,8
310 PLOT 26,8
320 DRAWTO 35,8
330 COLOR 1
340 FOR CO=1 TO 3
350 PLOT CO,9-CO
360 DRAWTO CO,7+CO
370 NEXT CO
380 COLOR 2
390 FOR CO=31 TO 35 STEP 2
400 PLOT CO,7
410 PLOT CO,9
420 PLOT CO+1,6
430 PLOT CO+1,10
440 NEXT CO
450 D$=CHR$(0)
460 FOR X=1 TO 20
470 D$(LEN(D$)+1)="-"
480 D$(LEN(D$)+1)=CHR$(0)
490 NEXT X
500 M$=D$
510 M$(LEN(M$)+1)=" "
520 M$(LEN(M$)+1)=N$
530 M$(LEN(M$)+1)=", YOU TURN MY HEART UPSIDE DOWN! WILL YOU BE MY VALENTINE? LOVE, "
540 M$(LEN(M$)+1)=F$
550 M$(LEN(M$)+1)=" "
560 M$(LEN(M$)+1)=D$
570 POKE 752,1
580 PRINT CHR$(125)
590 FOR X=1 TO LEN(M$)-40
600 POKE 656,1
610 POKE 657,0
620 PRINT M$(X,X+39);
630 FOR D=1 TO 20:NEXT D
640 NEXT X
650 GOTO 590
1000 DATA 13,16,11,18,9,19,7,19,6,19,5,19,4,19
1010 DATA 3,19,2,18,1,17,0,16
Happy Valentine’s Day, everyone (but especially Julie)!
Lovely BASIC program. Special thanks for sharing that Tramiel article. I have never read that one before!