Long year: Difference between revisions

Content deleted Content added
BASICs to the BASIC section
Line 566: Line 566:
170 NEXT
170 NEXT
180 PRINT</lang>
180 PRINT</lang>

==={{header|Nascom BASIC}}===
{{trans|Commodore BASIC}}
{{works with|Nascom ROM BASIC|4.7}}
<lang basic>
10 REM Long year
20 REM FNM7(N)=MOD(N,7)
30 DEF FNM7(N)=N-7*INT(N/7)
40 REM FNWD(Y)=Weekday of Y-12-31, 0 Sunday
50 DEF FND(Y)=Y+INT(Y/4)-INT(Y/100)+INT(Y/400)
60 DEF FNWD(Y)=FNM7(FND(Y))
70 REM FNLY(Y)=Nonzero if Y is long
80 DEF FNLY(Y)=(4=FNWD(Y))OR(3=FNWD(Y-1))
90 CLS
100 PRINT "**** ";
110 PRINT "List of ISO long years";
120 PRINT " ****"
130 INPUT "Start year";S
140 INPUT "End year";E
150 PRINT
160 FOR Y=S TO E
170 IF FNLY(Y) THEN PRINT Y;
180 NEXT Y
190 PRINT
200 END
</lang>
{{out}}
<pre>
**** List of ISO long years ****
Start year? 1995
End year? 2045

1998 2004 2009 2015 2020 2026 2032 2037 2043
</pre>


==={{header|PureBasic}}===
==={{header|PureBasic}}===