Day of the week: Difference between revisions
Content added Content deleted
(Added Algol W) |
Simple9371 (talk | contribs) (→{{header|Batch File}}: shortened code (this section is among my first contributions here huhuhu)) |
||
Line 754: | Line 754: | ||
=={{header|Batch File}}== |
=={{header|Batch File}}== |
||
⚫ | |||
<lang dos> |
|||
⚫ | |||
:: Batch File Implementation |
:: Batch File Implementation |
||
⚫ | |||
:: |
|||
:: Method: Zeller's Rule |
|||
⚫ | |||
:: |
|||
:: This implementation uses Zeller's Rule... |
|||
@echo off |
@echo off |
||
⚫ | |||
⚫ | |||
set mon=33 |
set mon=33 |
||
⚫ | |||
⚫ | |||
set day=25 |
set day=25 |
||
for /L %% |
for /L %%y in (2008,1,2121) do ( |
||
setlocal enabledelayedexpansion |
|||
call :check_day %%w |
|||
⚫ | |||
) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
exit /b |
|||
⚫ | |||
endlocal |
|||
:check_day |
|||
set yr=%1 |
|||
⚫ | |||
⚫ | |||
⚫ | |||
if %weekday%==1 ( |
|||
⚫ | |||
) |
) |
||
⚫ | |||
goto :EOF |
|||
</lang> |
exit /b 0</lang> |
||
{{out}} |
{{out}} |
||
⚫ | |||
<pre> |
|||
⚫ | |||
Dec 25, 2016 is a Sunday. |
Dec 25, 2016 is a Sunday. |
||
Dec 25, 2022 is a Sunday. |
Dec 25, 2022 is a Sunday. |
||
Line 806: | Line 793: | ||
Dec 25, 2112 is a Sunday. |
Dec 25, 2112 is a Sunday. |
||
Dec 25, 2118 is a Sunday. |
Dec 25, 2118 is a Sunday. |
||
Press any key to continue . . .</pre> |
|||
</pre> |
|||
=={{header|BBC BASIC}}== |
=={{header|BBC BASIC}}== |