RosettaCodeData/Task/Long-year/Chipmunk-Basic/long-year.basic

15 lines
399 B
Plaintext

10 cls
20 rem WD(Y) = WEEKDAY OF Y-12-31, 0 = SUNDAY
30 def fnwd(Y) = (Y + INT(Y / 4) - INT(Y / 100) + INT(Y / 400)) mod 7
40 rem LY(Y) = NONZERO IF Y IS LONG
50 def fnly(Y) = (4 = FNWD(Y)) OR (3 = FNWD(Y-1))
60 print "**** LIST OF ISO LONG YEARS ****"
70 input "START YEAR? ",s
80 input "END YEAR? ",e
90 print
100 for y = s to e
110 if fn ly(y) then print y,
120 next y
130 print
140 end