Calendar: Difference between revisions
Content added Content deleted
m (BaCon moved to the BASIC section.) |
(add RPL) |
||
Line 7,377: | Line 7,377: | ||
[https://www.dropbox.com/s/sj37yypiq45o5cd/CalmoSoftCalendar.jpg?dl=0 Calendar] |
[https://www.dropbox.com/s/sj37yypiq45o5cd/CalmoSoftCalendar.jpg?dl=0 Calendar] |
||
=={{header|RPL}}== |
|||
Screens of calculators running RPL have 7 lines and 22 columns only, so we can display only one month at a time. |
|||
<code>WKDAY</code> is defined at [[Last Friday of each month#RPL|Last Friday of each month]] |
|||
{{works with|HP|48}} |
|||
« FP DUP 2 TRNC 1 → m li |
|||
« CLLCD "Mo Tu We Th Fr Sa Su" 1 DISP |
|||
1 + DUP <span style="color:blue">WKDAY</span> 1 - NEG DATE+ |
|||
'''DO''' "" |
|||
1 7 '''START''' |
|||
OVER FP 2 TRNC m == |
|||
" " 4 PICK IP →STR + |
|||
DUP SIZE DUP 1 - SWAP SUB " " IFTE + " " + |
|||
SWAP 1 DATE+ SWAP |
|||
'''NEXT''' |
|||
'li' INCR DISP |
|||
'''UNTIL''' DUP FP 2 TRNC m ≠ '''END''' |
|||
7 FREEZE |
|||
» » ‘<span style="color:blue">CAL</span>’ STO |
|||
1.072023 <span style="color:blue">CAL</span> |
|||
=={{header|Ruby}}== |
=={{header|Ruby}}== |
||
<code>Date</code> class, from the standard library, knows how many days in a month, and which day is Sunday, for both Julian and Gregorian calendars. This program uses <code>Date</code> class, plus its own assumptions, to create the calendar. This program assumes that every year has 12 months and starts with January 1, and every month fits in 6 weeks starting with Sunday. |
<code>Date</code> class, from the standard library, knows how many days in a month, and which day is Sunday, for both Julian and Gregorian calendars. This program uses <code>Date</code> class, plus its own assumptions, to create the calendar. This program assumes that every year has 12 months and starts with January 1, and every month fits in 6 weeks starting with Sunday. |
||
Line 7,509: | Line 7,531: | ||
31 |
31 |
||
</pre> |
</pre> |
||
=={{header|Rust}}== |
=={{header|Rust}}== |
||
<syntaxhighlight lang="rust">// Assume your binary name is 'calendar'. |
<syntaxhighlight lang="rust">// Assume your binary name is 'calendar'. |