The program:
DATA aries,taurus,gemini,cancer,leo,virgo,libra,scorpio,sagittarius,capricorn,aquarius,pisces,"unknown to this astrologer."
DIM sign$(13)
MAT READ sign$
INPUT prompt "What is your birthday? (MM-DD,eg.1-9 for Jan. 9) ":reply$
CALL month (m,reply$)
CALL day (d,reply$)
CALL astrologer(d,m,i)
SET COLOR "red"
PRINT "Your sign is ";sign$(i)
SET COLOR "green"
PRINT "Cross my palm with silver for your horoscope."
END
SUB month (m,a$)
LET b$=a$[1:pos(a$,"-")-1]
LET m=val(b$)
END SUB
SUB day (d,c$)
LET d$=c$[posr(c$,"-")+1:len(c$)]
LET d=val(d$)
END SUB
SUB astrologer (d,m,i)
IF (d>=23 and m=9) or (d<=22 and m=10) then
LET i=7
ELSEIF (d>=22 and m=11) or (d<=21 and m=12) then
LET i=9
ELSEIF (d>=21 and m=3) or (d<=19 and m=4) then
LET i=1
ELSEIF (d>=20 and m=4) or (d<=20 and m=5) then
LET i=2
ELSEIF (d>=21 and m=5) or (d<=21 and m=6) then
LET i=3
ELSEIF (d>=22 and m=6) or (d<=22 and m=7) then
LET i=4
ELSEIF (d>=23 and m=7) or (d<=22 and m=8) then
LET i=5
ELSEIF (d>=23 and m=8) or (d<=22 and m=9) then
LET i=6
ELSEIF (d>=24 and m=10) or (d<=21 and m=11) then
LET i=8
ELSEIF (d>=22 and m=12) or (d<=19 and m=1) then
LET i=10
ELSE
LET i=13
SET COLOR "brown"
PRINT "You cannot be guided by local stars. "
END IF
END SUB
The output for reply$ 9-26:
Your sign is libra
The output for reply$ 12-12:
Your sign is sagittarius
The output for any other birthday:
You cannot be guided by local stars
Your sign is unknown to this astrologer