True Love and Binary

I found myself thinking of my favorite person quite a bit while getting back into BASIC coding - and so this program is heart themed.

Rather than just PRINT-ing a bunch of CHR$(211) together, I set MA to a number that represents the desired pattern or hearts (1's) and blanks (0's) in binary. Then I GOSUB to a sub-routine that left shifts then gets the remainder of division by 2 (see line 2090) and then prints the correct value based on the remainder (RE).


10 PRINT ""
15 PRINT "  ";
20 LET MA=10
25 GOSUB 3000
50 PRINT ""
65 REM LINE 2
71 PRINT " ";
75 LET MA=63
80 GOSUB 3000
85 PRINT ""
86 REM LINE 3
87 PRINT "  ";
90 LET MA=15
95 GOSUB 3000
205 PRINT ""
210 REM LINE 4
220 PRINT "   ";
230 PRINT CHR$(211)
900 GOTO 9000
2080 REM DRAW HEARTS
2090 LET RE = MA - (INT(MA/2)*2)
2100 IF RE = 1 THEN PRINT CHR$(211);
2115 IF RE = 0 THEN PRINT " ";
3000 REM PRINT BINARY HEARTS
3050 IF MA<1 THEN GOTO 3080
3055 MA = MA / 2
3060 MA = INT(MA)
3070 GOTO 2090
3080 RETURN
9000 REM END

BASIC program