Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
43
Task/Long-year/ASIC/long-year.asic
Normal file
43
Task/Long-year/ASIC/long-year.asic
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
REM Long year
|
||||
CLS
|
||||
PRINT "**** List of ISO long years ****"
|
||||
PRINT "Start year";
|
||||
INPUT S
|
||||
PRINT "End year";
|
||||
INPUT E
|
||||
PRINT
|
||||
FOR Y = S TO E
|
||||
GOSUB CALCLY:
|
||||
IF LY <> 0 THEN
|
||||
PRINT Y;
|
||||
ENDIF
|
||||
NEXT Y
|
||||
PRINT
|
||||
END
|
||||
|
||||
CALCLY:
|
||||
REM Nonzero if Y is long
|
||||
LY = 0
|
||||
AY = Y
|
||||
GOSUB CALCWD:
|
||||
IF WD = 4 THEN
|
||||
LY = -1
|
||||
ENDIF
|
||||
AY = Y - 1
|
||||
GOSUB CALCWD:
|
||||
IF WD = 3 THEN
|
||||
LY = -1
|
||||
ENDIF
|
||||
RETURN
|
||||
|
||||
CALCWD:
|
||||
REM Weekday of AY-12-31, 0 = Sunday
|
||||
WD = AY
|
||||
TMP = AY / 4
|
||||
WD = WD + TMP
|
||||
TMP = AY / 100
|
||||
WD = WD - TMP
|
||||
TMP = AY / 400
|
||||
WD = WD + TMP
|
||||
WD = WD MOD 7
|
||||
RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue