Long year: Difference between revisions

Long year in Chipmunk Basic
(→‎{{header|PL/0}}: Added a solution.)
(Long year in Chipmunk Basic)
Line 499:
The long years between 2100 and 2200 are 2105 2111 2116 2122 2128 2133 2139 2144 2150 2156 2161 2167 2172 2178 2184 2189 2195
</pre>
 
==={{header|Chipmunk Basic}}===
{{works with|Chipmunk Basic|3.6.4}}
{{trans| Commodore BASIC}}
<syntaxhighlight lang="qbasic">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</syntaxhighlight>
{{out}}
<pre>Similar as Commodore BASIC entry.</pre>
 
==={{header|Commodore BASIC}}===
2,148

edits