Authors
Publication
Pub Details
Date
Pages
BASIC Terms
I mentioned in last month column that I would hope to have VU-Calc +80 all polished up for this month, but no such luck, I could not even find the time to look at it, and rather than publishing something not up to par, I decided to wait.
I modified VU-CALC some years ago, but it has to be fool-proof, not to say that others are fools, it’s just that the program has most likely some peculiar looking chr$ in its display. I know what they mean, but somebody else may have problems with them, so let me clean it up for a future date.
For this month something on the lighter side, Biorhythms for all who believe in it, and for some who dont, but think it’s fun (or funny) anyways. I wrote it originally for the ZX81, modified it for the Timex Sinclair later. Just type it in and run it, follow the prompts as you go.
Naturally make sure you type it in without mistakes, to check for those, the Timex command Free should give you the number 34997. The Sinclair command Print 65536-USR 7962 should display the number 37818. This program will figure the dates correctly to the year 2083, good for your lifetime I’m sure. Printouts probably look better to the 2040 printer, cheaper besides. I have not made any provisions to print to a centronic type printer, maybe someone else would like to tackle that project.
Have some of the functions or features of the Timex or Sinclair Rom given you a fit, things like the scroll after a List, or the fact that when you ask for INT (-65536) it will display the number -1, or the problem with divisions, where the 34th bit of a division is lost.
Aside from the corrections John Oliger recommends, I have made all the corrections needed to make the Roms free of bugs, and added a few features to the Roms. For both Roms I changed the keys that activate the scroll, now one will have to press the ENTER key to activate it, all other keys will break into the program, this of course only works when the “scroll?” message comes up on the bottom of the screen. This is something that realy bothered me especially after listing a program. I also have problems finding the cursor key at times moving from line to line, I would like to make it more visible, using perhaps the “*” chr$ or chr$ 8F perhaps.
Changes to the Spectrum Rom will be as above, but in addition will have the following commands added:
- Print Free. Using the same keystrokes as on the Timex.
- Delete nn,nn. Using the command; Erase nn,nn.
- Renumber nn,nn,nn. Using probably the Sound key which will display an “R” instead of the bracket normally displayed, losing this bracket should not be a great loss I hope (This is not final).
- The following features are only a thought at this time, since I have only 1170 bytes to do this all in. Auto-Numbering? Error-trapping? Open & Close a Disk read and write channel another feature, but! Someone sugested Sound, but my feeling to that is; to play music I would buy a synthesizer.
Ed Haasch wrote a version some time ago that had a routine in the ROM which would change all numbers to VAL"" in a program, this made Spectrum programs fit into Timex space much better, now there is a thought. Too bad the Timex ROM has only about 29 bytes available, would be nice to change the delete function to Erase also, since it certainly does interfere when deleting characters in a basic line.
BASIC Listing — RHYTHMS (Biorhythm Program)
10 REM RHYTHMS (c)1982/1984 R.A.HILSMANN
20 POKE 23658,8: LET G=0: LET Z=0: PAPER 1: INK 9: BORDER 1
30 CLS : PRINT AT 0,7;"P=Physical Cycle"'TAB 7;"E=Emotional Cycle"'TAB 7;"I=Intelectual Cycle"
40 PRINT "Left side = Recuperative Times"''"Right side = Extra Energy Times"''"Crossing center = Critical Days"
50 INVERSE 1: PRINT AT 8,0;" YOUR BIORHYTHMS ": INVERSE 0
60 PRINT AT 12,0;"ENTER YOUR BIRTHDATE"''"ENTER NUMBERS ONLY"'"6/18/47"
70 GO TO 100
80 LET Z=0: PRINT AT 12,0;"ENTER TODAYS DATE",
90 RETURN
100 DIM N(2): LET P2=2*PI: LET W=10: LET K=11: LET L=21
110 FOR T=1 TO 2
120 IF T=2 THEN GO SUB 80
130 INPUT FLASH 1;"ENTER MONTH"; FLASH 0,M
140 PRINT AT 12,22;M
150 INPUT FLASH 1;"ENTER DAY"; FLASH 0,D
160 PRINT AT 12,24;"/";D;"/"
170 INPUT FLASH 1;"ENTER YEAR"; FLASH 0,Y
180 PRINT AT 12,28;Y
190 LET N(T)=INT (365.25*(Y-(M<3)))+INT (30.6001*(M+1+12*(M<3)))+D
200 PAUSE 100: NEXT T
210 IF NOT Z THEN CLS : PRINT AT 10,0;"FOR PRINTOUT PRESS ""P""",''"TO HOLD LISTING PRESS ANY KEY": PAUSE 0: CLS : IF INKEY$="P" OR INKEY$="p" THEN LET Z=1: PRINT AT 12,0;"ENTER NAME": INPUT N$: GO SUB 740: CLS
220 LET B=N(2)-N(1)
230 PRINT AT 20,0;" "
240 DIM K$(9)
250 DIM J$(12,4)
260 FOR S=1 TO 365
270 IF NOT INKEY$="" THEN GO TO 270
280 RESTORE 830: FOR J=1 TO 12
290 READ J$(J,1 TO 4): IF J=M THEN LET K$(1 TO 4)=J$(M,1 TO 4)
300 NEXT J
310 IF D<10 THEN LET K$(5 TO 7)=" "+STR$ D+"/"
320 IF D>9 THEN LET K$(5 TO 7)=STR$ D+"/"
330 LET K$(8 TO )=STR$ Y: POKE 23692,255
340 PRINT K$(1 TO 9);AT L,(W+K);":";AT L,(SIN (P2*B/23)*W+W+K);"P";AT L,(SIN (P2*B/28)*W+W+K);"E";AT L,(SIN (P2*B/33)*W+W+K);"I"
350 IF Z THEN LPRINT AT L,0;K$(1 TO 9);AT L,(W+K);":";AT L,(SIN (P2*B/23)*W+W+K);"P";AT L,(SIN (P2*B/28)*W+W+K);"E";AT L,(SIN (P2*B/33)*W+W+K);"I"
360 LET B=B+1: LET D=D+1: LET X=D
370 GO SUB 390
380 NEXT S: GO TO 260
390 IF M=1 THEN GO TO 520
400 IF M=2 THEN GO TO 610
410 IF M=3 THEN GO TO 530
420 IF M=4 THEN GO TO 690
430 IF M=5 THEN GO TO 540
440 IF M=6 THEN GO TO 700
450 IF M=7 THEN GO TO 550
460 IF M=8 THEN GO TO 560
470 IF M=9 THEN GO TO 710
480 IF M=10 THEN GO TO 570
490 IF M=11 THEN GO TO 720
500 IF M=12 THEN GO TO 580
510 IF M=1 AND D=32 AND Y=100 THEN LET M=1 AND D=1 AND Y=01
520 IF X=32 THEN LET D=1: LET M=2: RETURN
530 IF X=32 THEN LET D=1: LET M=4: RETURN
540 IF X=32 THEN LET D=1: LET M=6: RETURN
550 IF X=32 THEN LET D=1: LET M=8: RETURN
560 IF X=32 THEN LET D=1: LET M=9: RETURN
570 IF X=32 THEN LET D=1: LET M=11: RETURN
580 IF X=32 THEN LET D=1: LET M=1: LET Y=Y+1
590 IF Y=100 THEN LET Y=01
600 RETURN
610 LET G=0: IF D<29 THEN GO TO 660
620 RESTORE 650: FOR C=1 TO 25
630 READ A: IF Y=A THEN LET G=1
640 NEXT C
650 DATA 84,88,92,96,00,04,08,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80
660 IF G=0 AND X=29 THEN LET D=1: LET M=3
670 IF G=1 AND X=30 THEN LET D=1: LET M=3
680 RETURN
690 IF X=31 THEN LET D=1: LET M=5: RETURN
700 IF X=31 THEN LET D=1: LET M=7: RETURN
710 IF X=31 THEN LET D=1: LET M=10: RETURN
720 IF X=31 THEN LET D=1: LET M=12: RETURN
730 RETURN
740 LPRINT "BIORHYTHMS FOR ";N$
750 LPRINT TAB 7;"P=Physical Cycle"
760 LPRINT TAB 7;"E=Emotional Cycle"
770 LPRINT TAB 7;"I=Intelectual Cycle"
780 LPRINT ''"Left side = Recuperative Times"
790 LPRINT "Right side = Extra Energy Times"
800 LPRINT "Crossing center = Critical Days"''
810 INVERSE 1: LPRINT AT 8,0;" YOUR BIORHYTHMS ": INVERSE 0
820 LET Z=1: RETURN
830 DATA "JAN.","FEB.","MAR.","APR.","MAY.","JUN.","JUL.","AUG.","SEP.","OCT.","NOV.","DEC."
Products
Media
Image Gallery
Source Code
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.