To get quick answers to math problems on your ZX81 just ask it to PRINT whatever the problem is. For example, PRINT 6+2 gives you 8 at the top of the screen. PRINT is only one keystroke, but there is a more efficient way.
This short program will convert the ZX81 into a sophisticated calculator with chaining capabilities.
100 INPUT L
110 SCROLL
120 PRINT L
130 GOTO 100
To start the program, RUN or GOTO 100. The computer waits for you to enter a math problem. Because the ZX/TS accepts any expression, no matter how complicated, for L all you have to do is key in the desired expression and push ENTER. Thus, SQR 2 (square root) gives you 1.4142136 at the bottom of the screen.
Line 110 has two purposes. One is to insure that a long calculating session does not end with an error report of 5 (no more room on the screen). The break key does not affect the program while it is waiting for input. To exit–hit any number, ENTER and BREAK.
To use the previous answer in further calculations remember that the computer has identified it with L. Thus to divide by 2, just enter L/2 and 0.70710678 appears.
This short program places the ZX81 in the true calculator mode and makes it easier to get answers to nonrepetitive problems.
If you want your input recorded on the screen, use this program:
100 INPUT L$
110 LET L=VAL L$
120 SCROLL
130 PRINT L$
140 SCROLL
150 PRINT " ";L
160 GOTO 100
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.