Calendar: Difference between revisions

Content added Content deleted
(→‎{{header|Ruby}}: Use `tput co` to avoid escape sequences from curses. Copy the output in 132 columns and describe the output in 80 columns.)
(Edit task: Allow output in 132 columns. (The task allowed such output before 12 June 2011.) Remove reference to IBM 1403; the CALENDAR task only requires uppercase code, not uppercase output.)
Line 1: Line 1:
{{task|Date and time}}
{{task|Date and time}}
Create a routine that will generate an text calendar for any date. Test the calendar by generating a calendar for the year 1969 on a [[wp:IBM_3270#Displays|IBM 3278 model 4 terminal]] (80×43 display with accented characters) of the time.
Create a routine that will generate a text calendar for any year. Test the calendar by generating a calendar for the year 1969, on a device of the time. Choose one of the following devices:


* A line printer with a width of 132 characters.
As a test case, target formatting the months of the year to fit nicely across the 80 character width page. Restrict number of lines in test output to 43.
* An [[wp:IBM_3270#Displays|IBM 3278 model 4 terminal]] (80×43 display with accented characters). Target formatting the months of the year to fit nicely across the 80 character width screen. Restrict number of lines in test output to 43.


(Ideally the program will generate well formatted calendars for any page width from 20 characters up)
(Ideally, the program will generate well-formatted calendars for any page width from 20 characters up.)


Kudos (κῦδος) for routines that also correctly transition from Julian to Gregorian calendar in September 1752.
Kudos (κῦδος) for routines that also correctly transition from Julian to Gregorian calendar in September 1752.
Line 11: Line 12:
THE REAL PROGRAMMER'S NATURAL HABITAT
THE REAL PROGRAMMER'S NATURAL HABITAT
"Taped to the wall is a line-printer Snoopy calender for the year 1969."
"Taped to the wall is a line-printer Snoopy calender for the year 1969."
For further Kudos see task [[Calendar - for "real" programmers|CALENDAR]], for printing on a 132 character width [[wp:IBM 1403|IBM 1403]] printer. Where all code and output is to be in UPPERCASE.
For further Kudos see task [[Calendar - for "real" programmers|CALENDAR]], where all code is to be in UPPERCASE.


For economy of size, do not actually include Snoopy generation in either the code or the output, instead just output a place-holder.
For economy of size, do not actually include Snoopy generation in either the code or the output, instead just output a place-holder.

=={{header|ALGOL 68}}==
=={{header|ALGOL 68}}==
{{works with|ALGOL 68|Revision 1 - no extensions to language used}}
{{works with|ALGOL 68|Revision 1 - no extensions to language used}}
Line 401: Line 403:


=={{header|PicoLisp}}==
=={{header|PicoLisp}}==
This "calendar" is nicely formatted, and fits into 20 columns ;-)
{{Template:Needs-review}}
This "calendar" is nicely formated, and fits into 20 columns ;-)
<lang PicoLisp>(de cal (Year)
<lang PicoLisp>(de cal (Year)
(prinl "====== " Year " ======")
(prinl "====== " Year " ======")