- ’┌──────────┐”
- ’│SAMPLE5 │”
- ’│ ハ゛イオリス゛ム │”
- ’└──────────┘”
- VISIBLE 1,1,0,0,0,1
- GPAGE 0:GCOLOR 0:GCLS
- COLOR 0:CLS
- CLEAR
- ’---
- DIM MDAY(12)
- DATA 31,28,31,30,31,30
- DATA 31,31,30,31,30,31
- FOR I=0 TO 11
- READ MDAY(I)
- NEXT I
- ’---
- SPC = 8
- BGT = 4
- LINEH = 60
- LINEC = BGT + SPC + LINEH
- DAYW = 8:DRAWD = 30
- BGL = (256 - (DRAWD - 1) * DAYW - SPC * 2) / 2
- BGR = BGL + DAYW * (DRAWD - 1) + SPC * 2
- BGB = BGT + (SPC + LINEH) * 2 + SPC
- DIM DDAY(DRAWD)
- COLOR 0
- ’---
- @START
- CLS
- GCLS 14
- FOR I = 0 TO DRAWD - 1
- DDAY(I) = FALSE
- NEXT
- PRINT”┌────────┐”
- PRINT”│ハ゛イオリス゛ム│”
- PRINT”└────────┘”
- ’---
- @INPUTDAY
- INPUT ”Ж:タンシ゛ョウヒ゛ハ(YYYYMMDD)”; DT$
- IF LEN(DT$) != 8 THEN @ERROR
- BYEAR = VAL(MID$(DT$, 0, 4))
- BMON = VAL(MID$(DT$, 4, 2))
- BDAY = VAL(MID$(DT$, 6, 2))
- IF BYEAR < 1900 THEN @ERROR
- IF BMON < 1 OR BMON > 12 THEN @ERROR
- IF BDAY < 1 THEN @ERROR
- DTREAD(DATE$), NYEAR, NMON, NDAY
- IF BYEAR > NYEAR THEN @ERROR
- YEAR = NYEAR
- MON = NMON
- DAY = NDAY
- GOSUB @CALCDAY
- TOTAL = CDAY
- YEAR = BYEAR
- MON = BMON
- DAY = BDAY
- GOSUB @CALCDAY
- LEAP = 0
- IF MON == 2 THEN GOSUB @CHKLEAP
- IF DAY > MDAY(MON - 1) + LEAP THEN @ERROR
- TOTAL = TOTAL + YEARDAY - CDAY
- IF BYEAR == NYEAR THEN @DRAW
- FOR YEAR = BYEAR TO NYEAR - 1
- TOTAL = TOTAL + 365
- GOSUB @CHKLEAP
- TOTAL = TOTAL + LEAP
- NEXT
- ’---
- @DRAW
- CLS
- GCLS 4
- GFILL BGL, BGT, BGR, BGB, 15
- GCOLOR 14
- GBOX BGL, BGT, BGR, BGB
- X = BGL + SPC
- GLINE X, LINEC, BGR - SPC, LINEC
- Y = BGT + SPC
- X2 = X + DAYW * (DRAWD - 1)
- GLINE X, Y, X2, Y
- Y2 = Y + LINEH * 2
- FOR I = 1 TO DRAWD
- GLINE X, Y, X, Y2
- X = X + DAYW
- NEXT
- GLINE BGL + SPC, Y2, X2, Y2
- TX = 1
- X = BGL + SPC
- Y1 = Y2 + 1
- Y2 = Y1 + 1
- DAY = NDAY
- STEPD = 10
- GCOLOR 2
- COLOR 1
- FOR I = 1 TO DRAWD STEP STEPD
- GLINE X, Y1, X - 1, Y2
- GLINE X, Y1, X + 1, Y2
- GPSET X, Y2
- LOCATE TX, 17
- PRINT DAY
- X = X + STEPD * DAYW
- TX = TX + STEPD
- DAY = DAY + STEPD
- IF DAY > MDAY(NMONTH) THEN NDAY = NDAY - MDAY(NMONTH)
- NEXT
- GCOLOR 14
- TX = 2
- TY = 20
- X1 = TX * 8 - 4
- Y1 = TY * 8 - 4
- X2 = 256 - X1
- Y2 = Y1 + (8 + 4) * 2
- GFILL X1, Y1, X2, Y2, 15
- GBOX X1, Y1, X2, Y2
- ’---
- LOCATE TX, TY
- PRINT ”シンタイ カンシ゛ョウ チセイ”
- Y = TY * 8 + 4
- X = 7 * 8
- GLINE X, Y, X + 8, Y, 4
- X = 16 * 8
- GLINE X, Y, X + 8, Y, 2
- X = 22 * 8
- GLINE X, Y, X + 8, Y, 11
- TY = TY + 1
- LOCATE TX, TY
- PRINT ”チュウイヒ゛”
- X1 = (TX + 7) * 8
- Y1 = TY * 8
- GBOX X1, Y1, X1 + 8, Y1 + 8, 2
- GCOLOR 4
- BDAY = 23
- GOSUB @DRAWLINE
- GCOLOR 2
- BDAY = 28
- GOSUB @DRAWLINE
- GCOLOR 11
- BDAY = 33
- GOSUB @DRAWLINE
- GCOLOR 14
- X = BGL + SPC - DAYW / 2
- Y1 = LINEC - DAYW / 2
- Y2 = Y1 + DAYW
- FOR I = O TO DRAWD - 1
- IF DDAY(I) THEN GBOX X, Y1, X + DAYW, Y2, 2
- X = X + DAYW
- NEXT
- ’---
- COLOR 0
- LOCATE 0,23
- PRINT”А=モウイチト゛”;
- @LOOP
- IF BUTTON()==16 THEN @START
- GOTO @LOOP
- ’---
- @CALCDAY
- CDAY = DAY
- IF MON == 1 THEN @JAN
- FOR I = 1 TO MON - 1
- CDAY = CDAY + MDAY(I - 1)
- NEXT
- ’---
- @JAN
- LEAP = 0
- IF MON > 2 THEN GOSUB @CHKLEAP
- CDAY = CDAY + LEAP
- RETURN
- ’---
- @CHKLEAP
- LEAP = 0
- IF ((YEAR % 4) == 0) THEN LEAP = 1
- IF (YEAR % 400) == 0 THEN RETURN
- IF (YEAR % 100) == 0 THEN LEAP = 0
- RETURN
- ’---
- @DRAWLINE
- DAY = TOTAL
- YEAR = NYEAR
- MON = NMON
- X2 = BGL + SPC
- LEAP = 0
- GOSUB @CALCBIO
- FOR I = 0 TO DRAWD - 2
- X1 = X2
- Y1 = Y2
- DAY = DAY + 1
- X2 = X2 + DAYW
- GOSUB @CALCBIO
- GLINE X1, Y1, X2, Y2
- GOSUB @CHKDDAY
- NEXT
- Y1 = Y2
- DAY = DAY + 1
- GOSUB @CALCBIO
- I = DRAWD - 1
- GOSUB @CHKDDAY
- RETURN
- ’---
- @CALCBIO
- Y2 = LINEC - SIN(DAY * 2 * PI() / BDAY) * LINEH
- RETURN
- ’---
- @CHKDDAY
- IF Y1 <= LINEC AND LINEC < Y2 THEN DDAY(I) = TRUE
- IF Y1 >= LINEC AND LINEC > Y2 THEN DDAY(I) = TRUE
- RETURN
- ’---
- @ERROR
- BEEP
- PRINT ”エラ-!”
- GOTO @INPUTDAY