Grandson of Big Characters (Jul.82)
Here is a shorter version of Grandson of Big Characters which allows 27 4x-size characters on a 1K machine. Input them one at a time.
Paul Ezra, San Diego, CA
2 LET G=43
4 INPUT A$
6 FOR B=1 TO LEN A$
8 FOR C=0 TO 7
20 LET D=PEEK (7680+CODE A$(B)*8+C)
25 FOR F=0 TO 7
30 LET E=2**(7-F)
35 IF D>=E THEN PLOT 8*(B-1)+F,G-C
40 IF D>=E THEN LET D=D-E
45 NEXT F
50 NEXT C
55 NEXT B
60 LET G=G-8
65 GOTO 4
SYNTACTIC SUM: 14634, 8K
BASIC Line Renumbering (Jun.82)
This modification provides more flexibility and often negates the need to change GOSUBs and GOTOs. Because it lets you specify the last program line to renumber, you can retain subroutine starting addresses.
Use this program the same way as the original: type it in, SAVE it, then reload before typing in a new program. Call the renumber program by entering GOTO 9980 in the immediate mode. To exit early, enter DELETE then STOP.
You can learn a lot about how the computer handles programs by manipulating program lines or giving several lines the same number (increment by 0). Try this:
50 SLOW
40 PRINT AT 21,11;"GOODBYE"
30 FOR X=1 TO 22
20 SCROLL
10 NEXT X
It runs fine if entered using normal (low to high) line numbers and renumbered with increment -10. (Editing or adding new lines can be a little tricky, though).
William Bosley, Valparaiso, FL
9970 STOP
9971 LET A=16509
9972 INPUT S
9973 PRINT S
9974 LET L=256*PEEK A+PEEK (A+1)
9975 IF L=S THEN RETURN
9976 IF L>=9970 THEN GOTO 9979
9977 LET A=A+4+PEEK (A+2)+256*PEEK (A+3)
9978 GOTO 9974
9979 PRINT S;"NOT FOUND"
9980 PRINT "LAST LINE TO BE RENUMBERED=";
9981 GOSUB 9971
9982 LET AE=A+3
9983 PRINT "1ST LINE TO BE RENUMBERED=";
9984 GOSUB 9971
9985 PRINT "1ST NEW LINE NUMBER=";
9986 INPUT N
9987 PRINT N,"INCREMENT LINES BY:";
9988 INPUT I
9989 PRINT I
9990 IF A>AE THEN GOTO 9997
9991 IF N>9969 THEN GOTO 9999
9992 POKE A,INT (N/256)
9993 POKE (A+1),N-256*INT (N/256)
9994 LET A=A+4+PEEK (A+2)+256*PEEK (A+3)
9995 LET N=N+I
9996 GOTO 9990
9997 PRINT ,,"RENUMBER COMPLETE"
9998 STOP
9999 PRINT ,,"CANT COMPLETE. LINE NR>9969."
SYNTACTIC SUM: 39756, 8K
Powers of Negative Numbers
The formula for powers of negative numbers that William Tracy attributes to Sinclair (Jun.82 p.12) contains three mistakes. Line 10 of the program following corrects these. The program also shows some powers of -2. I have checked the formula for positive numbers and zero also. Zero to a negative power overflows, as it should.
Frank O’Hara, Surbiton, Surrey, UK
2 LET A=-2
5 FOR B=-5 TO 16
10 PRINT ABS A**B*(1-(B-2*INT (B/2))*(1-SGN A)),
20 NEXT B
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.