Biorythm

This file is part of Byte Power September 1986 . Download the collection to get this file.
Developer(s): Eric Boisvert
Date: 1986
Type: Program
Platform(s): TS 2068

This program plots a 30-day biorhythm chart for a user-supplied birth date and target month, displaying three sinusoidal cycles — physical (23-day, red), emotional (28-day, blue), and intellectual (33-day, green) — as UDG-character curves on a text-mode grid. The cycle positions are pre-computed as lookup tables stored in DATA statements at lines 2100–2130, with each table holding the screen row values for one full cycle period. A UDG “a” is defined at lines 110–130 as a filled circle (0x3C, 0x7E pattern) used as the plot marker. The program calculates the number of days elapsed since birth using month-offset constants and an approximation of 365.25 days per year. Line 5 uses a PEEK of address 23681 (the CAPS LOCK flag area) as a copy-protection check, triggering a LIST and STOP if the condition fails.


Program Structure

The program is organised into clearly separated phases:

  1. Lines 1–6: Title screen, copy-protection check, and pause.
  2. Lines 110–130: UDG “a” definition (filled circle marker).
  3. Lines 1000–1210: Main entry point — initialises arrays, calls subroutines in sequence.
  4. Lines 1220–1310: DATA loader — reads lookup tables into arrays m(23), y(28), z(33).
  5. Lines 1320–2090: Date arithmetic — determines days elapsed and cycle positions.
  6. Lines 2100–2130: DATA statements for the three cycle waveforms (screen row values).
  7. Lines 2150–2590: Display routines — draws axes, plots graphs sequentially, waits for keypress between each.
  8. Lines 2600–3080: Input/instruction subroutine.
  9. Line 9999: SAVE/VERIFY bootstrap.

UDG Definition

Lines 110–130 define UDG “a” as a filled circle using POKE USR "a". The pixel pattern is:

OffsetBinaryHex
0001111000x3C
1–6011111100x7E
7001111000x3C

This produces a solid oval/circle, used as the plot marker for all three biorhythm curves at different INK colours.

Lookup-Table Waveform Approach

Rather than computing SIN at runtime, the program pre-stores screen-row coordinates for one complete cycle of each biorhythm in DATA arrays. The physical cycle has 23 entries in m(), the emotional 28 entries in y(), and the intellectual 33 entries in z(). Values range roughly from 14 to 24, encoding the vertical position on the text grid. This avoids floating-point trigonometry entirely.

Day-Count Arithmetic

The subroutine at lines 1320–2090 converts birth date and target month into a total day count n. It uses two sets of month-offset constants: n2 for the birth month (days remaining in the year from that month) and n3 for the target month (days elapsed into the year). The year difference is multiplied by 365.25 and truncated with INT to approximate leap-year correction. The cycle position index is then extracted with the fractional-part idiom:

r = INT((r1 - INT(r1)) * 23) + 1

This maps the total day count modulo the cycle period to a 1-based index into the lookup array, and is repeated for all three cycles.

Input Handling and Display

The input subroutine (lines 2600–3080) uses POKE 23658,8 to enable CAPS LOCK, ensuring uppercase entry for the month names that are later compared with string literals. Month matching throughout lines 1320–1730 uses a chain of IF b$="MONTHNAME" THEN GO TO — a straightforward but verbose dispatch method. The graph display loops (lines 2320–2550) each wait for INKEY$="1" before proceeding to the next curve.

Content

Appears On

Tape-based magazine.

Related Products

Related Articles

Biorythm will graph your personal biorhythm, just enter your date of birth and the month desired and the computer will...

Related Content

Image Gallery

Biorythm

Source Code

1 REM BIORYTHM
    2 BORDER 0: PAPER 0: INK 7: CLS : PRINT AT 8,8;"B I O R Y T H M";AT 10,3;"WRITTEN BY  ERIC BOISVERT"
    4 PRINT AT 15,3;"COPYRIGHT BYTE POWER 1986"
    5 IF PEEK 23681=0 THEN PRINT '': LIST 9999: STOP 
    6 PAUSE 180
  110 POKE USR "a",BIN 00111100
  120 FOR x=USR "a"+1 TO USR "a"+6: POKE x,BIN 01111110: NEXT x
  130 POKE USR "a"+7,BIN 00111100
 1000 BORDER 0: INK 7: PAPER 0: CLS 
 1120 DIM m(23)
 1130 DIM y(28)
 1140 DIM z(33)
 1150 GO SUB 1220
 1160 GO SUB 2600
 1170 GO SUB 1320
 1190 GO SUB 2150
 1200 GO SUB 2600
 1210 REM life days
 1220 FOR i=1 TO 23
 1230 READ m(i)
 1240 NEXT i
 1250 FOR i=1 TO 28
 1260 READ y(i)
 1270 NEXT i
 1280 FOR i=1 TO 33
 1290 READ z(i)
 1300 NEXT i
 1310 RETURN 
 1320 IF b$="JANUARY" THEN GO TO 1440
 1330 IF b$="FEBRUARY" THEN GO TO 1460
 1340 IF b$="MARCH" THEN GO TO 1440
 1350 IF b$="APRIL" THEN GO TO 1480
 1360 IF b$="MAY" THEN GO TO 1440
 1370 IF b$="JUNE" THEN GO TO 1480
 1380 IF b$="JULY" THEN GO TO 1440
 1390 IF b$="AUGUST" THEN GO TO 1440
 1400 IF b$="SEPTEMBER" THEN GO TO 1480
 1410 IF b$="OCTOBER" THEN GO TO 1440
 1420 IF b$="NOVEMBER" THEN GO TO 1480
 1430 IF b$="DECEMBER" THEN GO TO 1440
 1440 LET b=31
 1450 GO TO 1490
 1460 LET b=28
 1470 GO TO 1490
 1480 LET b=30
 1490 LET n1=b-(a-1)
 1500 LET N3=0: LET N2=0: IF b$<>"JANUARY" THEN GO TO 1520
 1510 LET n2=334
 1520 IF b$<>"FEBRUARY" THEN GO TO 1540
 1530 LET n2=306
 1540 IF b$="MARCH" THEN LET n2=275
 1560 IF b$="APRIL" THEN LET n2=245
 1580 IF b$="MAY" THEN LET n2=214
 1600 IF b$="JUNE" THEN LET n2=184
 1620 IF b$="JULY" THEN LET n2=153
 1640 IF b$="AUGUST" THEN LET n2=122
 1660 IF b$="SEPTEMBER" THEN LET n2=91
 1680 IF b$="OCTOBER" THEN LET n2=60
 1700 IF b$="NOVEMBER" THEN LET n2=30
 1720 IF b$="DECEMBER" THEN LET n2=0
 1740 IF d$="DECEMBER" THEN LET n3=334
 1760 IF d$="NOVEMBER" THEN LET n3=304
 1780 IF d$="OCTOBER" THEN LET n3=273
 1800 IF d$="SEPTEMBER" THEN LET n3=243
 1820 IF d$="AUGUST" THEN LET n3=212
 1840 IF d$="JULY" THEN LET n3=181
 1860 IF d$="JUNE" THEN LET n3=151
 1880 IF d$="MAY" THEN LET n3=120
 1900 IF d$="APRIL" THEN LET n3=90
 1920 IF d$="MARCH" THEN LET n3=59
 1940 IF d$="FEBRUARY" THEN LET n3=31
 1960 IF d$="JANUARY" THEN LET n3=0
 1980 LET n4=(e-c-1)*365.25
 1990 LET n4=INT (n4)
 2000 IF N2=0 OR N3=0 THEN CLS : PRINT AT 10,9;"ERROR IN INPUT": PAUSE 180: RUN 1110
 2005 LET n=n1+n2+n3+n4
 2010 IF n>=0 THEN GO TO 2030
 2020 LET n=0
 2030 LET r1=n/23
 2040 LET r=INT ((r1-INT (r1))*23)+1
 2050 LET b1=n/28
 2060 LET b=INT ((b1-INT (b1))*28)+1
 2070 LET v1=n/33
 2080 LET v=INT ((v1-INT (v1))*33)+1
 2090 RETURN 
 2100 DATA 18,17,16,15,14,14,15,15,16,17,19,20,21,22,23,23,24,24,23,22,21,20,19
 2110 DATA 18,17,16,15,15,14,14,14,15,15,16,17,18,19,20,21,22,23,23,24,24,24,23,23,22,21,20,19
 2120 DATA 18,17,16,16,15,15,14,14,14,15,15,16,16,17,18
 2130 DATA 19,20,21,22,22,23,23,24,24,24,23,23,22,22,21,20,20,19
 2160 FOR x=10 TO 21: PRINT AT x,0;"█": NEXT x
 2190 PRINT AT 15,1;"_______________________________"
 2210 PRINT AT 9,4;5;TAB 9;10;TAB 14;15;TAB 19;20;TAB 24;25;TAB 30;30
 2320 FOR n=1 TO 30
 2330 PRINT AT m(r)-3,n; INK 2;"a"
 2340 LET r=r+1
 2350 IF r<>24 THEN GO TO 2370
 2360 LET r=1
 2370 NEXT n
 2380 IF INKEY$<>"1" THEN GO TO 2380
 2410 FOR n=1 TO 30
 2420 PRINT AT y(b)-3,n; INK 1;"a"
 2430 LET b=b+1
 2440 IF b<>29 THEN GO TO 2460
 2450 LET b=1
 2460 NEXT n
 2470 IF INKEY$<>"1" THEN GO TO 2470
 2500 FOR n=1 TO 30
 2510 PRINT AT z(v)-3,n; INK 4;"a"
 2520 LET v=v+1
 2530 IF v<>34 THEN GO TO 2550
 2540 LET v=1
 2550 NEXT n
 2560 PRINT AT 7,4;" PRESS ANY KEY FOR MENU ": IF INKEY$="" THEN GO TO 2560
 2590 RUN 1110
 2600 CLS : POKE 23658,8
 2601 PRINT "QUESTIONNAIRE"
 2602 PRINT "_____________"
 2603 PRINT 
 2604 PRINT 
 2605 PRINT 
 2620 INPUT "YOUR NAME PLEASE:"; LINE a$
 2630 PRINT 'A$
 2650 INPUT "EXAMPLE:OCTOBER 23 1978"''"MONTH OF BIRTH:"; LINE B$'"DAY:";A'"YEAR:";c
 2660 PRINT '"DATE OF BIRTH:";B$;" ";A;" ";C
 2680 INPUT "EXAMPLE:NOVEMBER 1999"''"ENTER DESIRED MONTH:"; LINE d$;'"YEAR:";e
 2690 CLS 
 2700 PRINT "INSTRUCTIONS..."
 2710 PRINT '''
 2740 PRINT "  RED GRAPH:-Health"
 2750 PRINT "            -Endurence                      -Energy"
 2770 PRINT 
 2780 PRINT " BLUE GRAPH:-Nervosity                      -Sensibility                    -Temper"
 2810 PRINT 
 2820 PRINT "GREEN GRAPH:-Intelligence                   -Memory                         -Reasoning                      -Logic"
 2860 PRINT '''
 2890 PRINT "   PRESS [1] FOR YOUR GRAPH"
 2900 IF INKEY$<>"1" THEN GO TO 2900
 2930 CLS 
 2940 PRINT a$;TAB 18;"a:PHYSICAL"
 2950 PRINT 
 2960 PRINT d$;" ";e;TAB 18;"a:EMOTIONAL"
 2970 PRINT 
 2980 PRINT TAB 18;"a:LOGICAL"
 2990 PRINT 
 3000 PRINT 
 3010 PRINT "    PRESS [1] FOR NEXT GRAPH"
 3080 RETURN 
 9999 SAVE "BIORYTHM" LINE 1: VERIFY "BIORYTHM"

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

Scroll to Top