--- title: "The Day You Were Born" id: 63164 type: "computer_media" slug: "the-day-you-were-born" url: "http://localhost/computer_media/the-day-you-were-born/" markdown_url: "http://localhost/computer_media/the-day-you-were-born.md" published_at: "2026-01-30T17:36:44+00:00" modified_at: "2026-04-03T07:57:59+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/01/day-you-were-born.png" excerpt: "A BASIC program uses Zeller's congruence and a computed GO TO trick across 1,300+ line numbers to find your birthday and star sign instantly." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Kristian Boisvert" slug: "boisvert-kristian" taxonomy: "indiv" url: "http://localhost/indiv/boisvert-kristian/" genre: - name: "Entertainment" slug: "entertainment" taxonomy: "genre" url: "http://localhost/type/entertainment/" media_contents: - id: 63045 title: "Byte Power September 1986" type: "computer_media" url: "http://localhost/computer_media/byte-power-september-1986/" media_type: "Program" programmers: - name: "Kristian Boisvert" slug: "boisvert-kristian" taxonomy: "indiv" url: "http://localhost/indiv/boisvert-kristian/" mediadate: "1986" producer_company: - id: 25181 title: "Byte Power" type: "company" url: "http://localhost/company/byte-power/" images: - url: "http://localhost/wp-content/uploads/2026/01/day-you-were-born.png" article_media: - id: 63044 title: "The Day You Were Born" type: "article" url: "http://localhost/article/the-day-you-were-born/" media_type_tags: "Entertainment" --- # The Day You Were Born This program calculates the day of the week and astrological sign for any user-supplied date of birth, using Zeller’s congruence adapted for BASIC. The zodiac sign is determined by a computed GO TO branching directly to line numbers constructed as month×100+day, with dedicated lines for each sign boundary. January and February births require a year-minus-one adjustment (line 2000), splitting year input across two branches before rejoining at line 3000. The century and year-within-century are extracted separately from a four-character string input to feed Zeller’s formula. *** ## Program Structure The program is divided into several logical phases: 1. **Splash screen and safety check** (lines 2–3): Displays the title and authorship, then PEEKs a system variable to decide whether to proceed or auto-save. 2. **Input collection** (lines 10–16): Gathers day, month, and year with basic range validation. January/February births are diverted to line 2000 for the Zeller adjustment. 3. **Zodiac dispatch** (lines 20–1299): A computed `GO TO ms*100+j` jumps to one of thirteen labelled lines that PRINT the sign name. 4. **Day-of-week output** (lines 1300–1326): Clears part of the screen and prints the day name from a cascade of `IF z=n` tests. 5. **Zeller’s calculation** (lines 3000–3060): Extracts century and year from the string, applies the formula, and branches to line 18 — which does not exist (see Bugs). 6. **Save/verify** (line 9999): Stores the program to tape with `LINE 1` autostart. ## Key BASIC Idioms - **Computed GO TO**: `GO TO ms*100+j` at line 30 is the central dispatch mechanism. Line numbers encode the month-start boundary of each zodiac sign (e.g., line 1121 = 11th month, 21st day = Scorpio starts 21 November). - **LINE input for year**: Using `INPUT … LINE a$` accepts the year as a string, allowing it to be sliced with `a$(1 TO 2)` and `a$(3 TO 4)` at lines 3010–3020 to separate century from year without string-to-number conversion ambiguity. - **Cascade of IF statements** for day names (lines 1320–1326) rather than an array or DATA block — typical of early hobbyist BASIC where string arrays were cumbersome. - **VAL on substrings**: `VAL a$(1 TO 2)` is a compact way to convert a two-digit slice to a number. ## Zeller’s Congruence Lines 3030–3040 implement Zeller’s congruence for the Gregorian calendar: - `c` = century (first two digits of year) - `a` = year within century (last two digits) - `m` = adjusted month (March = 1 … February = 12; January/February treated as months 11/12 of the previous year) - Formula: `x = INT(2.6*m - 0.199) + j + a + INT(a/4) + INT(c/4) - 2*c` - `z = INT x - 7*INT(x/7)` extracts the remainder mod 7 without the `MOD` operator (not available in standard Spectrum BASIC). The January/February diversion at line 2000 sets `m = ms + 10` (so January → 11, February → 12) and prompts for “Year of birth −1”, correctly decrementing the year for these months as Zeller’s algorithm requires. ## Notable Techniques | Technique | Location | Purpose | | --- | --- | --- | | PEEK 23681 | Line 3 | Reads FLAGS2 system variable; bit 1 signals 64-column mode. If zero (normal mode), triggers auto-save and stop. | | Computed GO TO | Line 30 | Dispatches to zodiac-sign lines using arithmetic on month and day. | | Mod-7 without MOD | Line 3040 | `INT x - 7*INT(x/7)` computes x mod 7 for the day-of-week index. | | SAVE … LINE 1 | Line 9999 | Saves with autostart at line 1, followed immediately by VERIFY for data integrity. | | Erasing zone with PRINT spaces in loop | Line 1300 | Wipes lines 6–17 with blank strings before printing results. | ## Source Code ``` 2 CLS : PRINT AT 8,5;"The Day You Were Born";AT 10,2;"Written by KRISTIAN BOISVERT";AT 12,8;"©1986 BYTE POWER" 3 IF PEEK 23681=0 THEN PRINT AT 15,0;: LIST 9999: STOP 10 INPUT "Day of birth:";j: IF j>31 OR j<1 THEN GO TO 10 11 INPUT "Month of birth:";ms: IF ms<1 OR ms>12 THEN GO TO 11 12 LET m=ms-2: IF ms<=2 THEN GO TO 2000 15 INPUT "Year of birth:"; LINE a$: IF LEN a$<>4 THEN GO TO 15 16 GO TO 3000 20 CLS 30 PRINT AT 5,0;"Your sign is:";: GO TO ms*100+j 119 PRINT TAB 13;"Capricorn" 217 PRINT TAB 13;"Aquarius" 320 PRINT TAB 13;"Pisces" 419 PRINT TAB 13;"Aries" 520 PRINT TAB 13;"Taurus" 620 PRINT TAB 13;"Gemini" 722 PRINT TAB 13;"Cancer" 822 PRINT TAB 13;"Leo" 922 PRINT TAB 13;"Virgo" 1022 PRINT TAB 13;"Libra" 1121 PRINT TAB 13;"Scorpio" 1221 PRINT TAB 13;"Sagittarius" 1250 PRINT TAB 13;"Capricorn" 1300 FOR x=6 TO 17: PRINT AT x,13;" ": PAUSE 10: NEXT x 1310 PRINT AT 7,0;"And you were born on a "; 1320 IF z=0 THEN PRINT "SUNDAY" 1321 IF z=1 THEN PRINT "MONDAY" 1322 IF z=2 THEN PRINT "TUESDAY" 1323 IF z=3 THEN PRINT "WEDNESDAY" 1324 IF z=4 THEN PRINT "THURSDAY" 1325 IF z=5 THEN PRINT "FRIDAY" 1326 IF z=6 THEN PRINT "SATURDAY" 1330 INPUT "Another? "; LINE q$: IF q$="n" OR q$="N" THEN STOP 1340 RUN 2000 LET m=ms+10 2010 INPUT "Year of birth -1:"; LINE a$: IF LEN a$<>4 THEN GO TO 2010 3000 CLS 3010 LET c=VAL a$(1 TO 2) 3020 LET a=VAL a$(3 TO 4) 3030 LET x=INT (2.6*m-.199)+j+a+INT (a/4)+INT (c/4)-2*c 3040 LET z=INT x-7*INT (x/7) 3060 GO TO 18 9999 SAVE "THE DAY" LINE 1: VERIFY "THE DAY" ```