Day of the week: Difference between revisions

m
→‎{{header|BASIC}}: corrected formatting error, I hope
m (→‎{{header|AppleScript}}: (light refactor))
m (→‎{{header|BASIC}}: corrected formatting error, I hope)
Line 689:
AUTO 100,10
DEFine PROC Iso(S,O)
REM - inputting starting year& ending years as integerintegers S and ending year as integer O
LOCal y$,m%,d%,i$,n%,w%
LET m%=12 : d%=25
REM - as m% & d% are constants, avoid recalculating that n% (=48) each iteration
LET i$=m%*256+ 19300 : n%=i$(2TO 3)+ d%
REM - skipping unnecessary years below
FOR count=S TO O
LET y$=count : w%=(y$(1TO 2)&"32"DIV 16+ count DIV 4+ count+ n%)MOD 7
REM or even further optimised by using w%=(y$(1TO 2)&"16"DIV 16+ count DIV 4+ count)MOD 7 as further optimisation
IF w%=0 THEN PRINT count : count = count+ 4
END FOR count
END DEFine
 
{{keypress|ctrl|space}}
</lang>
 
=={{header|Batch File}}==
<lang dos>
:: Day of the Week task from Rosetta Code WikiSimi
 
:: Batch File Implementation
::