Calendar - for "REAL" programmers: Difference between revisions
m
→{{header|Phix}}: use pygments
m (→{{header|REXX}}: replaced the OUT template that replaced the original OUT with text. Also, reduced the output font size.) |
m (→{{header|Phix}}: use pygments) |
||
(29 intermediate revisions by 18 users not shown) | |||
Line 1:
[[Category:Handicap]]
{{task|Date and time}}
Line 30 ⟶ 31:
FYI: a nice ASCII art file of Snoopy can be found at [http://www.textfiles.com/artscene/asciiart/cursepic.art textfiles.com]. Save with a .txt extension.
'''Trivia:''' The terms uppercase and lowercase date back to the early days of the mechanical printing press. Individual metal alloy casts of each needed letter, or punctuation symbol, were meticulously added to a press block, by hand, before rolling out copies of a page. These metal casts were stored and organized in wooden cases. The more often needed ''
<br><br>
=={{header|360 Assembly}}==
<!-- Calendar for real programmers -->
This is for real programmers who code only in assembler :). The code could have been run in april 1964, punched on
80-column cards, read on a card reader, and printed with a 132-column line printer on fan-folded paper with perforated edges.
<
CALENDAR CSECT
USING CALENDAR,R13 BASE REGISTER
Line 217:
DA DS 12CL144
YREGS
END CALENDAR</
{{out}}
<pre> INSERT SNOOPY HERE
Line 237:
28 29 30 31 25 26 27 28 29 30 31 29 30 27 28 29 30 31 24 25 26 27 28 29 30 29 30 31
</pre>
=={{header|Ada}}==
Line 243 ⟶ 242:
Instead of doing that, the implementation below reuses the package "PRINTABLE_CALENDAR" (same as "Printable_Calendar" or "printable_calendar") from [[Calendar#Ada|the calendar task]]:
<
PROCEDURE REAL_CAL IS
Line 263 ⟶ 262:
C.NEW_LINE;
C.PRINT(1969, "NINETEEN-SIXTY-NINE");
END REAL_CAL;</
{{out}}
Line 288 ⟶ 287:
To change the output to 80-character devices, replace "INIT_132" by "INIT_80".
=={{header|ALGOL 68}}==
{{works with|ALGOL 68|Revision 1 - no extensions to language used}}
Line 296 ⟶ 294:
Note: to run this code with [[ALGOL 68G]] you need to use the '''--quote-stropping''' option.
<
'PROC' PRINT CALENDAR = ('INT' YEAR, PAGE WIDTH)'VOID': 'BEGIN'
Line 403 ⟶ 401:
LINE PRINTER WIDTH = 132; # AS AT 1969! #
PRINT CALENDAR(MANKIND STEPPED ON THE MOON, LINE PRINTER WIDTH)
'END'</
{{out}}
<pre>
Line 426 ⟶ 424:
31 30
</pre>
=={{header|AutoHotkey}}==
<
LASTDAY := [], DAY := []
TITLES =
Line 466 ⟶ 463:
STRINGREPLACE, RES, RES,%A_SPACE%0,%A_SPACE%%A_SPACE%, ALL
RETURN RES
}</
Examples:<
GUI, FONT,S8, COURIER
GUI, ADD, EDIT, VYR W40 R1 LIMIT4 NUMBER, 1969
Line 482 ⟶ 479:
GUICLOSE:
EXITAPP
RETURN</
{{out}}
<pre> 1969
Line 522 ⟶ 519:
30
</pre>
=={{header|BASIC}}==
==={{header|BaCon}}===
Choosing 132 character output. Same as the "Calendar" from [[Calendar#BaCon|the calendar task]] but using all capitals:
<
DECLARE MON[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
Y$ = "1969"
Line 557 ⟶ 554:
PRINT D;
NEXT
NEXT</
{{out}}
Line 580 ⟶ 577:
</pre>
==={{header|BBC BASIC}}===
{{works with|BBC BASIC for Windows}}
<
YEAR = 1969
Line 625 ⟶ 622:
DEF FNDIM(M%,Y%)
CASE M% OF
WHEN 2: = 28
WHEN 4,6,9,11: = 30
OTHERWISE = 31
ENDCASE</
{{out}}
<pre>
Line 651 ⟶ 648:
27 28 29 30 31 24 25 26 27 28 29 30 28 29 30 26 27 28 29 30 31 23 24 25 26 27 28 29 28 29 30 31
31 30</pre>
=={{header|C}}==
<b>Note:</b> Historically, some UNIX systems were connected to upper-case only terminals, and users of those systems needed to write C programs. One could configure the terminal using the "stty" command, setting the olcuc and iuclc options to translate uppercase to lowercase on input, and convert lowercase to uppercase on output (although typically the setting was applied by the "getty" program so that logging in would be possible).
So the text that was actually saved in the C source code would be lowercase, but it would appear on the terminal as uppercase.
<br>
This would also apply to any other language source or document.
<br>
<br>
Modern versions of Linux and MacOS have preserved this feature.
<br>
<br>
However, the following is an actual upper-case only version of the C Calendar task.
It relies on the ability of most C compilers to allow #defines to be specified on the command line and also declares the putchar function to avoid needing any #includes (neither #define nor #include could be specified in upper-case without a non-standard pre-processor).
<br>
The program can be compiled with the following (substitute the name of your compiler for tcc):
<pre>
tcc -DSTRUCT=struct -DCONST=const -DINT=int -DCHAR=char -DVOID=void -DMAIN=main -DIF=if -DELSE=else -DWHILE=while -DFOR=for -DDO=do -DBREAK=break -DRETURN=return -DPUTCHAR=putchar UCCALENDAR.c
</pre>
<
/* ERROR MESSAGES GO TO STDOUT TO SLIGHTLY SIMPLIFY THE I/O HANDLING */
/* WHEN COMPILING THIS, THE COMMAND LINE SHOULD SPECIFY -D OPTIONS FOR THE FOLLOWING WORDS: */
Line 822 ⟶ 831:
}
RETURN RESULT;
}</
=={{header|COBOL}}==
Although it seems to be missing the pinup of Snoopy, see [[Calendar#COBOL|COBOL Calendar task entry]]
where the code, and output, is already an example of a "REAL programmer" calendar; even down to the 6 character, all uppercase, program name ''CALEND''.
=={{header|Common Lisp}}==
<
(DEFPARAMETER *DAY-ROW* "SU MO TU WE TH FR SA")
Line 903 ⟶ 910:
(LAMBDA (&REST HEADS)
(FORMAT T FORMAT-STRING HEADS))
ROW))))</
{{out}}
<pre>CL-USER> (PRINT-CALENDAR 1969)
Line 942 ⟶ 949:
30
NIL</pre>
=={{header|D}}==
D keywords are lower case, so this silly solution uses the whole Calendar Task code, with small changes and all in upper case, in a text file named "CALENDAR":
Line 999 ⟶ 1,005:
Then in another source code file there is a little loader, that imports it and mixes-in it (for safety this program must be compiled with <code>-Jsomepath</code>):
<
{{out}}
<pre> [Snoopy Picture]
Line 1,039 ⟶ 1,045:
26 27 28 29 30 31 23 24 25 26 27 28 29 28 29 30 31
30 </pre>
=={{header|Elena}}==
ELENA
<
import system'routines;
import system'calendar;
Line 1,054 ⟶ 1,053:
import extensions'routines;
const MonthNames = new string[]
const DayNames = new string[]
class CalendarMonthPrinter
{
writeTitle()
{
_row.Value := 0;
_date := Date.new(_year, _month, 1);
DayNames.forEach::(name)
{ _line.print(" ",name) }
}
var dw
_line.writeCopies("
do
_line.writePaddingLeft(_date.Day.toPrintable(), $32, 3);
}
int length :=
if
{ _line.writeCopies(" ", 21 - length) };
_row.append(1)
}
int Index
{
get() = _row.Value;
set(int index)
{
if (index <= _row)
{ self.writeTitle() };
while (index > _row)
{ self.writeLine() }
}
}
this self.Index :=
}
get int
get
set
}
class Calendar
{
Array.allocate(
.populate::(j =>
new CalendarMonthPrinter(
{
line.forEach::(printer)
{
}
public program()
{
}</
{{out}}
<pre>
Line 1,238 ⟶ 1,246:
27 28 29 30 31 24 25 26 27 28 29 30 29 30 31
</pre>
=={{header|Forth}}==
<syntaxhighlight lang="forth">
: WEEKDAY ( D M Y -- U )
OVER 3 < IF SWAP 12 + SWAP 1- THEN
DUP 4 / OVER 100 / - OVER 400 / + + SWAP 1+ 13 * 5 / + + 2 - 7 MOD ;
: MDAYS ( M Y -- MSIZE MDAY )
OVER 12 = IF 31 1 2SWAP WEEKDAY NEGATE EXIT THEN
2>R 1 2R@ WEEKDAY 1 2R> SWAP 1+ SWAP WEEKDAY OVER -
7 + 7 MOD 28 + SWAP NEGATE ;
: .WEEK ( MSIZE MDAY -- MSIZE MDAY' )
7 0 DO DUP 0< IF 1+ 3 SPACES ELSE
2DUP > IF 1+ DUP 2 .R SPACE ELSE 3 SPACES THEN THEN LOOP ;
: .3MONTHS ( Y M -- )
3 0 DO ." MO TU WE TH FR SA SU " LOOP CR
3 OVER + SWAP DO I OVER MDAYS ROT LOOP DROP
6 0 DO 2ROT .WEEK 2 SPACES 2ROT .WEEK 2 SPACES 2ROT .WEEK CR LOOP
2DROP 2DROP 2DROP ;
: CAL ( Y -- )
30 SPACES ." [SNOOPY]" CR
32 SPACES DUP . CR
." JANUARY FEBRUARY MARCH" CR
DUP 1 .3MONTHS
." APRIL MAY JUNE" CR
DUP 4 .3MONTHS
." JULY AUGUST SEPTEMBER" CR
DUP 7 .3MONTHS
." OCTOBER NOVEMBER DECEMBER" CR
10 .3MONTHS ;
1969 CAL
</syntaxhighlight>
{{out}}
<pre>
[SNOOPY]
1969
JANUARY FEBRUARY MARCH
MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU
1 2 3 4 5 1 2 1 2
6 7 8 9 10 11 12 3 4 5 6 7 8 9 3 4 5 6 7 8 9
13 14 15 16 17 18 19 10 11 12 13 14 15 16 10 11 12 13 14 15 16
20 21 22 23 24 25 26 17 18 19 20 21 22 23 17 18 19 20 21 22 23
27 28 29 30 31 24 25 26 27 28 24 25 26 27 28 29 30
31
APRIL MAY JUNE
MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU
1 2 3 4 5 6 1 2 3 4 1
7 8 9 10 11 12 13 5 6 7 8 9 10 11 2 3 4 5 6 7 8
14 15 16 17 18 19 20 12 13 14 15 16 17 18 9 10 11 12 13 14 15
21 22 23 24 25 26 27 19 20 21 22 23 24 25 16 17 18 19 20 21 22
28 29 30 26 27 28 29 30 31 23 24 25 26 27 28 29
30
JULY AUGUST SEPTEMBER
MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU
1 2 3 4 5 6 1 2 3 1 2 3 4 5 6 7
7 8 9 10 11 12 13 4 5 6 7 8 9 10 8 9 10 11 12 13 14
14 15 16 17 18 19 20 11 12 13 14 15 16 17 15 16 17 18 19 20 21
21 22 23 24 25 26 27 18 19 20 21 22 23 24 22 23 24 25 26 27 28
28 29 30 31 25 26 27 28 29 30 31 29 30
OCTOBER NOVEMBER DECEMBER
MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU
1 2 3 4 5 1 2 1 2 3 4 5 6 7
6 7 8 9 10 11 12 3 4 5 6 7 8 9 8 9 10 11 12 13 14
13 14 15 16 17 18 19 10 11 12 13 14 15 16 15 16 17 18 19 20 21
20 21 22 23 24 25 26 17 18 19 20 21 22 23 22 23 24 25 26 27 28
27 28 29 30 31 24 25 26 27 28 29 30 29 30 31
</pre>
=={{header|Fortran}}==
Alas, the header "FORTRAN" is not recognised - REAL programmers were absent that day? Even upon the apperance of lower case, I have preferred to use shouting for programme source, and normal upper/lower case for commentary. Aside from petty details such as 1 and l being nowhere as distinct as 1 and L, this allows the two sorts of blather to be identifiably different without ratiocination as the hours drag past. Further, the names of variables can easily be distinguished from the same word in discussion, as in ... the text in TEXT will be printed as the subtitle to the text in TITLE ... Anyway, in the spirit of old, herewith the source without tedious commentary:
<syntaxhighlight lang="fortran">
MODULE DATEGNASH
Line 1,417 ⟶ 1,495:
END DO
END
</syntaxhighlight>
And for output, the wide form:
Line 1,440 ⟶ 1,518:
</pre>
Actual lineprinters offer the opportunity of overprinting lines so double (or triple) printing of the same text gave a '''bold''' effect if with some blurring due to wobble. Further decoration was possible: via underlines (and for overlines, an underline on the previous line) the appearance can be improved. Vertical bars can also be used, and more advanced lineprinters (IBM1403 etc. using the "TN" chain) or dot-matrix printers also supplied "corner" glyphs so that boxes would not have leaks.
=={{header|FreeBASIC}}==
<
' COMPILE WITH: FBC -S CONSOLE
Line 1,538 ⟶ 1,617:
PRINT : PRINT "HIT ANY KEY TO END PROGRAM"
SLEEP
END</
{{out}}
<pre> INSERT YOUR SNOOPY PICTURE HERE
Line 1,559 ⟶ 1,638:
21 22 23 24 25 26 27 18 19 20 21 22 23 24 22 23 24 25 26 27 28 20 21 22 23 24 25 26 17 18 19 20 21 22 23 22 23 24 25 26 27 28
28 29 30 31 25 26 27 28 29 30 31 29 30 27 28 29 30 31 24 25 26 27 28 29 30 29 30 31 </pre>
=={{header|FutureBasic}}==
REAL PROGRAMMERS USE THE COMMAND LINE. (ALL UPPERCASE...UGH! =:^0 )
<syntaxhighlight lang="futurebasic">
INCLUDE "NSLOG.INCL"
LOCAL FN RUNTERMINALCOMMAND( CMD AS CFSTRINGREF ) AS CFSTRINGREF
CFSTRINGREF OUTPUTSTR = NULL
TASKREF TASK = FN TASKINIT
TASKSETEXECUTABLEURL( TASK, FN URLFILEURLWITHPATH( FN STRINGLOWERCASESTRING( @"/BIN/ZSH" ) ) )
CFSTRINGREF CMDSTR = FN STRINGWITHFORMAT( @"%@", FN STRINGLOWERCASESTRING( CMD ) )
CFARRAYREF ARGS = FN ARRAYWITHOBJECTS( FN STRINGLOWERCASESTRING( @"-C" ), CMDSTR, NULL )
TASKSETARGUMENTS( TASK, ARGS )
PIPEREF P = FN PIPEINIT
TASKSETSTANDARDOUTPUT( TASK, P )
TASKSETSTANDARDERROR( TASK, P )
FILEHANDLEREF FH = FN PIPEFILEHANDLEFORREADING( P )
FN TASKLAUNCH( TASK, NULL )
TASKWAITUNTILEXIT( TASK )
ERRORREF ERR
CFDATAREF DTA = FN FILEHANDLEREADDATATOENDOFFILE( FH, @ERR )
IF ERR THEN NSLOG( @"%@", FN ERRORLOCALIZEDDESCRIPTION( ERR ) ) : EXIT FN
OUTPUTSTR = FN STRINGWITHDATA( DTA, NSUTF8STRINGENCODING )
OUTPUTSTR = FN STRINGUPPERCASESTRING( OUTPUTSTR )
END FN = OUTPUTSTR
VOID LOCAL FN BUILDSNOOPYCALENDAR
CFSTRINGREF CALSTR = FN STRINGWITHFORMAT( FN STRINGLOWERCASESTRING( @"\n%37S\n\n%@" ), FN STRINGUTF8STRING( @"[SNOOPY HERE]" ), FN RUNTERMINALCOMMAND( FN STRINGLOWERCASESTRING( @"CAL 1969" ) ) )
NSLOG( @"%@", CALSTR )
END FN
FN BUILDSNOOPYCALENDAR
HANDLEEVENTS
</syntaxhighlight>
{{output}}
<pre style="font-size: 12px">
[SNOOPY HERE]
1969
JANUARY FEBRUARY MARCH
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 1 1
5 6 7 8 9 10 11 2 3 4 5 6 7 8 2 3 4 5 6 7 8
12 13 14 15 16 17 18 9 10 11 12 13 14 15 9 10 11 12 13 14 15
19 20 21 22 23 24 25 16 17 18 19 20 21 22 16 17 18 19 20 21 22
26 27 28 29 30 31 23 24 25 26 27 28 23 24 25 26 27 28 29
30 31
APRIL MAY JUNE
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 5 1 2 3 1 2 3 4 5 6 7
6 7 8 9 10 11 12 4 5 6 7 8 9 10 8 9 10 11 12 13 14
13 14 15 16 17 18 19 11 12 13 14 15 16 17 15 16 17 18 19 20 21
20 21 22 23 24 25 26 18 19 20 21 22 23 24 22 23 24 25 26 27 28
27 28 29 30 25 26 27 28 29 30 31 29 30
JULY AUGUST SEPTEMBER
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 5 1 2 1 2 3 4 5 6
6 7 8 9 10 11 12 3 4 5 6 7 8 9 7 8 9 10 11 12 13
13 14 15 16 17 18 19 10 11 12 13 14 15 16 14 15 16 17 18 19 20
20 21 22 23 24 25 26 17 18 19 20 21 22 23 21 22 23 24 25 26 27
27 28 29 30 31 24 25 26 27 28 29 30 28 29 30
31
OCTOBER NOVEMBER DECEMBER
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 1 1 2 3 4 5 6
5 6 7 8 9 10 11 2 3 4 5 6 7 8 7 8 9 10 11 12 13
12 13 14 15 16 17 18 9 10 11 12 13 14 15 14 15 16 17 18 19 20
19 20 21 22 23 24 25 16 17 18 19 20 21 22 21 22 23 24 25 26 27
26 27 28 29 30 31 23 24 25 26 27 28 29 28 29 30 31
30
</pre>
=={{header|Go}}==
Line 1,568 ⟶ 1,729:
This is realcal_UC.txt:
<
IMPORT (
Line 1,638 ⟶ 1,799:
FMT.PRINTLN()
}
}</
and this is realcal.go:
<
import (
Line 1,680 ⟶ 1,841:
cmd.Stderr = os.Stderr
check(cmd.Run())
}</
which produces (as expected) this output:
Line 1,724 ⟶ 1,885:
30
</pre>
=={{header|GUISS}}==
In Graphical User Interface Support Script, we utilize applications that are already written. So for this task, we shall just display the calendar that sets the system clock.
<syntaxhighlight lang="guiss">RIGHTCLICK:CLOCK,ADJUST DATE AND TIME,BUTTON:CANCEL</syntaxhighlight>
=={{header|Icon}} and {{header|Unicon}}==
Icon and Unicon don't lend themselves to ''REAL'' programming in the sense of this task easily. And initially this task was marked ''omit'' because the primary declarations, reserved words, and the name of the ''main'' procedure are all in lowercase. However, getting in the spirit of the task real programmers do not give up and a number of solutions are possible:
Line 1,746 ⟶ 1,911:
Also it makes me go all nostalgic for my old [[WATFIVE]] compiler. And an IBM 129 keypunch. And 5 hole paper tape.
<
LINK DATETIME
Line 1,794 ⟶ 1,959:
IF M = 2 & ISLEAPYEAR(YEAR) THEN SUSPEND (DAY +:= 1, 29)
EVERY DAY TO (6*7) DO SUSPEND ""
END</
Where REALIZE.ICN would be something like this (this example is incomplete but sufficient for this program):
<
$define END end
$define WRITE write
Line 1,824 ⟶ 1,989:
$define BY by
$define DATETIME datetime
$define RETURN return</
{{libheader|Icon Programming Library}}
[http://www.cs.arizona.edu/icon/library/src/procs/DATETIME.ICN DATETIME.ICN provides IsLeapYear and julian]
=={{header|J}}==
For added "real"ness, we also only use 1 character names:
<
M=: 28+ 3, (10$5$3 2),~ 0 ~:/@:= 4 100 400 | ]
R=: (7 -@| B+ 0, +/\@}:@M) |."0 1 (0,#\#~41) (]&:>: *"1 >/)~ M
Line 1,841 ⟶ 2,005:
L=: |."0 1~ +/ .(*./\@:=)"1&' '
E=: (|."0 1~ _2 <.@%~ +/ .(*./\.@:=)"1&' ')@:({."1) L
F=: 0 _1 }. 0 1 }. (2+[) E '[INSERT SNOOPY HERE]', ":@], D</
B: given a year returns a number which when added to numeric values indexing days that year, mod 7, index the proper day names within a week. (In other words 7 | 0 + B 1969 gives the day of week index for the first day of 1969.)
Line 1,863 ⟶ 2,027:
Here's an example calendar (the first line <code>132 F 1969</code> being the command that build this calendar):
<syntaxhighlight lang="text"> 132 F 1969
[INSERT SNOOPY HERE]
1969
Line 1,885 ⟶ 2,049:
│ │31 │ │ │30 │ │
└────────────────────┴────────────────────┴────────────────────┴────────────────────┴────────────────────┴────────────────────┘
</syntaxhighlight>
Note that this version of F will work fine with a left argument of 20 (why anyone felt that this was important to mention is perhaps best thought of as an issue lost in history).
=={{header|Julia}}==
Julia code is a valid data type in Julia. Executable code can be created from a String with Meta.parse() and run with eval.
This example does require a small function with Julia's lowercase keywords, perhaps loaded on startup from a separate file.
<
# IF THIS SMALL FUNCTION IS PLACED IN THE STARTUP.JL
# FILE, IT WILL BE LOADED ON STARTUP. THE REST OF
Line 1,950 ⟶ 2,113:
RUNUPPERCASECODE(CODE)
</
1969
JANUARY FEBRUARY MARCH APRIL MAY JUNE
Line 1,972 ⟶ 2,135:
</pre>
=={{header|Kotlin}}==
Kotlin is case-sensitive: all its keywords and packages are lower case, all its library classes are mixed case and its library functions are either lower case or mixed case. Consequently, it is impossible to run an upper case version of the Calendar task program as it stands. So what I've done instead (and similar to what several other languages in the same boat have done) is:
Line 1,982 ⟶ 2,144:
This is calendar_UC.txt:
<
IMPORT JAVA.UTIL.*
IMPORT JAVA.IO.PRINTSTREAM
Line 2,033 ⟶ 2,195:
FUN MAIN(ARGS: ARRAY<STRING>) {
SYSTEM.OUT.PRINTCALENDAR(1969, 3, LOCALE.US)
}</
and this is real_calendar.kt:
<
import java.io.File
Line 2,120 ⟶ 2,282:
br.close()
println(out.toString())
}</
which generates (on disk) calendar_NC.kt:
<
import java.util.*
import java.io.PrintStream
Line 2,175 ⟶ 2,337:
fun main(args: Array<String>) {
System.out.PRINTCALENDAR(1969, 3, Locale.US)
}</
which when compiled and run produces output of:
Line 2,219 ⟶ 2,381:
30
</pre>
=={{header|Lua}}==
Tested with Lua 5.3.2
Line 2,227 ⟶ 2,388:
The upper case Lua source - stored in a file called UCCALENDAR.LUU:
<br>
<
LOCAL MONTHS={"JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE",
"JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER"}
Line 2,290 ⟶ 2,451:
PRINT_CAL(1969)
</syntaxhighlight>
The following "one-liner" standard Lua source will down-case and run the program in the source file specified as it's parameter (file luu.lua):
<
</syntaxhighlight>
The following command will execute the UCCALENDAR.LUU source (replace lua532 with the appropriate command for your system):
<br>
Line 2,345 ⟶ 2,506:
Console 132 characters by 43 lines. Six columns for months.
<syntaxhighlight lang="m2000 interpreter">
\\ Calendar - for "REAL" programmers
\\ All statements in UPPERCASE
\\ Output to 132 characters console - as a line printer
\\ USE COURIER NEW (FONT "COURIER NEW")
\\ CHANGE THE VALUE OF PRINT_IT TO TRUE FOR PRINTING
GLOBAL CONST PRINT_IT AS BOOLEAN=FALSE
MODULE GLOBAL SNOOPY {
Line 2,427 ⟶ 2,593:
FOR I=1 TO 6 {
MONTH=I+J*6
PRINT PART @((I-1)*22+1), $(2,21), UCASE$(LOCALE$(55+MONTH))
}
PRINT
Line 2,438 ⟶ 2,604:
COUNT(I)=GETMAX(YEAR, MONTH)
}
PRINT
IF PRINT_IT ELSE REFRESH 1000
FOR I=1 TO 6 {
IF I>1 THEN PRINT " ";
Line 2,450 ⟶ 2,617:
}
PRINT
IF PRINT_IT ELSE REFRESH 1000
PRINT @(0)
FOR M=1 TO 5 {
Line 2,461 ⟶ 2,629:
}
}
PRINT
IF PRINT_IT ELSE REFRESH 1000
}
}
}
WHILE INKEY$<>"" : END WHILE
IF PRINT_IT THEN PRINTING ON ELSE REFRESH 1000
FONT "COURIER NEW"
PEN 0
Line 2,473 ⟶ 2,642:
CALENDAR 1966, 1032 ' GREEK
GOSUB WAITKEY_OR_MOUSE
FOR I=
CALENDAR I, 1033 ' ENGLISH
GOSUB WAITKEY_OR_MOUSE
NEXT I
IF PRINT_IT THEN PRINTING OFF ELSE REFRESH 50
CLEAR ' CLEAR VARIABLES FROM THIS MODULE
END
WAITKEY_OR_MOUSE:
Line 2,486 ⟶ 2,654:
END WHILE
RETURN
</syntaxhighlight>
=={{header|Nim}}==
Nim is a peculiar language regarding case sensitivity. First, keywords are all in lowercase. Second, Nim is case sensitive regarding the first character only. That means that ''Thing'' is different of ''thing'' but identical to ''THING''. There are several conventions regarding the style. For instance, the first character of a type should be in uppercase while the first character of a procedure or a variable should be in lowercase. Nim is also style-insensitive which means that "myvar", "myVar" and "my_var" are equivalent identifiers.
This makes impossible to write a valid program with only uppercase characters. So, we have built a program which reads the text written in uppercase, transforms it to valid Nim code, writes it into a file and includes this file. That means that in only one step, the uppercase text is read, transformed and compiled.
Instead of using the command <code>nim c file.txt</code> which would not work, we use the command <code>nim c file.nim</code> which, in fact, compiles “nim.txt” after is has been transformed.
Here is the helper program:
<syntaxhighlight lang="text">import strutils
const progUpper = staticRead("calendar_upper.txt")
proc transformed(s: string): string {.compileTime.} =
## Return a transformed version (which can compile) of a program in uppercase.
let upper = s.toLower() # Convert all to lowercase.
var inString = false # Text in string should be in uppercase…
var inBraces = false # … except if this is in an expression to interpolate.
for ch in upper:
case ch
of '"':
inString = not inString
of '{':
if inString: inBraces = true
of '}':
if inString: inBraces = false
of 'a'..'z':
if inString and not inBraces:
result.add(ch.toUpperAscii()) # Restore content of strings to uppercase.
continue
else:
discard
result.add(ch)
const prog = progUpper.transformed()
static: writeFile("calendar_transformed.nim", prog)
include "calendar_transformed.nim"</syntaxhighlight>
Here is the actual program in uppercase.
<syntaxhighlight lang="text">IMPORT TIMES
IMPORT STRFORMAT
PROC PRINTCALENDAR(YEAR, NCOLS: INT) =
VAR ROWS = 12 DIV NCOLS
VAR DATE = INITDATETIME(1, MJAN, YEAR, 0, 0, 0, UTC())
IF ROWS MOD NCOLS != 0:
INC ROWS
VAR OFFS = GETDAYOFWEEK(DATE.MONTHDAY, DATE.MONTH, DATE.YEAR).INT
VAR MONS: ARRAY[12, ARRAY[8, STRING]]
FOR M IN 0..11:
MONS[M][0] = &"{$DATE.MONTH:^21}"
MONS[M][1] = " SU MO TU WE TH FR SA"
VAR DIM = GETDAYSINMONTH(DATE.MONTH, DATE.YEAR)
FOR D IN 1..42:
VAR DAY = D > OFFS AND D <= OFFS + DIM
VAR STR = IF DAY: &" {D-OFFS:2}" ELSE: " "
MONS[M][2 + (D - 1) DIV 7] &= STR
OFFS = (OFFS + DIM) MOD 7
DATE = DATE + MONTHS(1)
VAR SNOOPYSTRING, YEARSTRING: STRING
FORMATVALUE(SNOOPYSTRING, "[SNOOPY PICTURE]", "^" & $(NCOLS * 24 + 4))
FORMATVALUE(YEARSTRING, $YEAR, "^" & $(NCOLS * 24 + 4))
ECHO SNOOPYSTRING, "\N" , YEARSTRING, "\N"
FOR R IN 0..<ROWS:
VAR S: ARRAY[8, STRING]
FOR C IN 0..<NCOLS:
IF R * NCOLS + C > 11:
BREAK
FOR I, LINE IN MONS[R * NCOLS + C]:
S[I] &= &" {LINE}"
FOR LINE IN S:
IF LINE == "":
BREAK
ECHO LINE
ECHO ""
PRINTCALENDAR(1969, 5)</syntaxhighlight>
{{out}}
The program allows to choose the number of columns. Five is the maximum which can fit with 132 columns.
<pre> [SNOOPY PICTURE]
1969
January February March April May
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 5 1 2 1 2 1 2 3 4 5 6 1 2 3 4
6 7 8 9 10 11 12 3 4 5 6 7 8 9 3 4 5 6 7 8 9 7 8 9 10 11 12 13 5 6 7 8 9 10 11
13 14 15 16 17 18 19 10 11 12 13 14 15 16 10 11 12 13 14 15 16 14 15 16 17 18 19 20 12 13 14 15 16 17 18
20 21 22 23 24 25 26 17 18 19 20 21 22 23 17 18 19 20 21 22 23 21 22 23 24 25 26 27 19 20 21 22 23 24 25
27 28 29 30 31 24 25 26 27 28 24 25 26 27 28 29 30 28 29 30 26 27 28 29 30 31
31
June July August September October
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 1 2 3 4 5 6 1 2 3 1 2 3 4 5 6 7 1 2 3 4 5
2 3 4 5 6 7 8 7 8 9 10 11 12 13 4 5 6 7 8 9 10 8 9 10 11 12 13 14 6 7 8 9 10 11 12
9 10 11 12 13 14 15 14 15 16 17 18 19 20 11 12 13 14 15 16 17 15 16 17 18 19 20 21 13 14 15 16 17 18 19
16 17 18 19 20 21 22 21 22 23 24 25 26 27 18 19 20 21 22 23 24 22 23 24 25 26 27 28 20 21 22 23 24 25 26
23 24 25 26 27 28 29 28 29 30 31 25 26 27 28 29 30 31 29 30 27 28 29 30 31
30
November December
SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 1 2 3 4 5 6 7
3 4 5 6 7 8 9 8 9 10 11 12 13 14
10 11 12 13 14 15 16 15 16 17 18 19 20 21
17 18 19 20 21 22 23 22 23 24 25 26 27 28
24 25 26 27 28 29 30 29 30 31
</pre>
=={{header|Perl}}==
Since we can't use <code>eval</code> or <code>print</code> (or any other keywords)
at the top level, we need to abuse backticks in order to print anything, as in [http://www.perlmonks.org/?node_id=43797 the infamous JAPH with no letters or numbers]. Consequently, the calendar is printed to standard error instead of standard output.
<
MY @START_DOW = (3, 6, 6, 2, 4, 0,
Line 2,537 ⟶ 2,816:
$L = ',' | '@';
`${E}${C}${H}${O} $PROGRAM | ${T}${R} A-Z ${A}-${Z} | ${P}${E}${R}${L}`;</
Although, if we are abusing the backticks and other innocent programs, why not just: <
=={{header|Phix}}==
<syntaxhighlight lang="phix">
--return repeat(' ',left)&s&repeat(' ',right)
</syntaxhighlight>
(That's that done.) Now, Phix is case-sensitive, and many of the keywords and builtins are in lower case, which presents a bit of a challenge - but we can cope. It is too tedious and not particularly helpful to present a completed solution, instead I shall outline the (relatively simple) steps this would require. I have limited my tests to INCLUDE and INTEGER. In psym.e you can find the line
<syntaxhighlight lang="phix">
initialSymEntry("integer", S_Type,"TI",opInt, E_none) -- #01 / 0b0001 integer
</syntaxhighlight>
Immediately after that (it should now be there commented out) add:
<syntaxhighlight lang="phix">
Alias("INTEGER",symlimit)
</syntaxhighlight>
Add similar lines for length, floor, repeat, upper, day_of_week, sequence, string, sprintf, append, printf, join, at the appropriate places. Keywords are handled slightly differently: In pttree.e we need a new alias routine (you should find this one commented out, from when I was testing all this):
<syntaxhighlight lang="phix">
tt_string(text,-2)
tt[pcurr] = alias
end procedure
</syntaxhighlight>
and you can find the line
<syntaxhighlight lang="phix">
global constant T_include = 596 tt_stringF("include",T_include)
</syntaxhighlight>
Sometime after that, in fact after the very last use of tt_stringF, add (likewise you should find this one commented out):
<syntaxhighlight lang="phix">
tt_stringA("INCLUDE",T_include)
</syntaxhighlight>
Add similar lines for function, end, iff, for, to, do, if, or, then, else, return, procedure, but this time all some ways away from the originals. Quickly run "p p" and make sure you get a normal prompt, without any "T_include should be 624(not 596)" or suchlike (which would happen <i>alot</i> if you put the aliases anywhere other than last).
Currently ptok.e recognises <code>\n</code> but not <code>\N</code>. Search for all references to <code>escchar</code> (there should be one definition and two references) and make sure the character being
checked is mapped to lower case, ie change (twice)
<syntaxhighlight lang="phix">
--Ch = find(Ch,escchar)
</syntaxhighlight>
Lastly, the calendar example includes builtins\timedate.e, which contains some lower-case definitions. So copy it to (say) TIMEDATEUPPER.E and change adjust_timedate, timedelta, days (the 2nd param to timedelta), and format_timedate to their uppercase equivalents, and of course change that include to <code>INCLUDE BUILTINS\TIMEDATEUPPER.E</code>.
There
You don't actually have to repackage (p -c p) to test this, just run p p test.exw -
Finally, you can take that copy of [[Calendar#Phix|Calendar]] and make it all uppercase. In Edita (shipped with Phix) that is just <Ctrl A><Alt U>.
Line 2,594 ⟶ 2,868:
While PHP functions are case-sensitive (aside of <code>_()</code>), this isn't the case for language constructs.
<
ECHO <<<REALPROGRAMMERSTHINKINUPPERCASEANDCHEATBYUSINGPRINT
JANUARY FEBRUARY MARCH APRIL MAY JUNE
Line 2,613 ⟶ 2,887:
28 29 30 31 25 26 27 28 29 30 31 29 30 27 28 29 30 31 24 25 26 27 28 29 30 29 30 31
REALPROGRAMMERSTHINKINUPPERCASEANDCHEATBYUSINGPRINT
; // MAGICAL SEMICOLON</
=={{header|PicoLisp}}==
The "CALENDAR.L" source file:
<
(PRINL "====== " YEAR " ======")
(FOR DAT (RANGE (DATE YEAR 1 1) (DATE YEAR 12 31))
Line 2,629 ⟶ 2,903:
(CAL 1969)
(BYE)</
Then it can be executed with this command line:
<pre>$ pil -'load (list "awk" "{print tolower($0)}" "CALENDAR.L")'</pre>
Line 2,657 ⟶ 2,931:
30 Tue
31 Wed</pre>
=={{header|PL/I}}==
<
CALENDAR: PROCEDURE (YEAR) OPTIONS (MAIN);
DECLARE YEAR CHARACTER (4) VARYING;
Line 2,710 ⟶ 2,983:
END PREPARE_MONTH;
END CALENDAR;</
See CALENDAR for result.
=={{header|Racket}}==
<
#CI(MODULE NAME-OF-THIS-FILE RACKET
(REQUIRE RACKET/DATE)
Line 2,750 ⟶ 3,022:
(CALENDAR 1969))
</syntaxhighlight>
=={{header|Raku}}==
(formerly Perl 6)
Uppercase is no challenge, who needs letters at all?
[Requires the year to be supplied as a command-line argument, and Unixish <i>cal</i> command.]
<syntaxhighlight lang="raku" line>$_="\0".."~";<
115 97 121 32 34 91 73 78 83 69 82 84 32 83 78 79 79 80 89 32 72 69 82 69 93 34
59 114 117 110 32 60 99 97 108 62 44 64 42 65 82 71 83 91 48 93 47 47 49 57 54 57
>."$_[99]$_[104]$_[114]$_[115]"()."$_[69]$_[86]$_[65]$_[76]"()</syntaxhighlight>
=={{header|REXX}}==
This is essentially the same REXX program as for the CALENDAR task, but written entirely in uppercase. Indeed,
Line 2,766 ⟶ 3,045:
(from the command line), and a few simple tricks were used to accomplish this.
<br>[Note: the command line may also be all uppercase.]
This version automatically will use the depth and width of the terminal screen to determine which layout fits best.
<br>However, the depth and width can be overridden with the '''depth''' and '''width''' keywords.
In any case, both versions of the programs' output are identical
(but the second REXX version sure as heck looks
<br>like it was beat with a big ole ugly stick ─── and pardon the strong language).
<
@ABC=
PARSE VALUE SCRSIZE() WITH SD SW .
DO J=0 TO 255;_=D2C(J);IF DATATYPE(_,'L') THEN @ABC=@ABC||_;END
@ABCU=@ABC; UPPER @ABCU
Line 2,786 ⟶ 3,069:
END
CALFILL=' '; MC=12; _='1 3 1234567890' "FB"X
PARSE VAR _ GRID CALSPACES # CHK . CV_ DAYS.1 DAYS.2 DAYS.3 DAYSN
_=0; PARSE VAR _ COLS 1 JD 1 LOWERCASE 1 MAXKALPUTS 1 NARROW 1,
NARROWER 1 NARROWEST 1 SHORT 1 SHORTER 1 SHORTEST 1,
Line 2,829 ⟶ 3,112:
END /*DO WHILE OPTS\== ...*/
IF SD==0 THEN SD= 43; SD= SD-3
IF SW==0 THEN SW= 80; SW= SW-1
MC=INT(MC,'MONTHSCALENDER'); IF MC>0 THEN CAL=1
DAYS=' 'DAYS; MONTHS=' 'MONTHS
CYYYY=RIGHT(DATE(),4); HYY=LEFT(CYYYY,2); LYY=RIGHT(CYYYY,2)
DY.=31; _=30; PARSE VAR _ DY.4 1 DY.6 1 DY.9 1 DY.11; DY.2=28+LY(YYYY)
YY=RIGHT(YYYY,2);
IF SMALL THEN DO; NARROW=1 ; SHORT=1 ; END
IF SMALLER THEN DO; NARROWER=1 ; SHORTER=1 ; END
Line 2,939 ⟶ 3,224:
PUT:_=ARG(1);_=TRANSLATE(_,,'_'CHK);IF \GRID THEN _=UNGRID(_);IF LOWERCASE THEN _=LOWER(_);IF UPPERCASE THEN UPPER _;IF SHORTEST&_=' ' THEN RETURN;CALL TELL _;RETURN
TELL:SAY ARG(1);RETURN
UNGRID:RETURN TRANSLATE(ARG(1),,"│║─═┤┐└┴┬├┼┘┌╔╗╚╝╟╢╞╡╫╪╤╧╥╨╠╣")</
BIF) which is used to determine the screen
<br>width and depth of the terminal (console). Some REXXes don't
have this BIF.
here ───► [[SCRSIZE.REX]].
{{out|output|text= when using the input of: <tt> 1/1/1969 (NOGRID SHORTER NARROWER) </tt>}}
(Shown at <big>'''<sup>2</sup>/<sub>3</sub>'''</big> size.)
<pre style="font-size:67%">
January 1969 February 1969 March 1969 April 1969
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
1 2 3 4 1 1 1 2 3 4 5
5 6 7 8 9 10 11 2 3 4 5 6 7 8 2 3 4 5 6 7 8 6 7 8 9 10 11 12
12 13 14 15 16 17 18 9 10 11 12 13 14 15 9 10 11 12 13 14 15 13 14 15 16 17 18 19
19 20 21 22 23 24 25 16 17 18 19 20 21 22 16 17 18 19 20 21 22 20 21 22 23 24 25 26
26 27 28 29 30 31 23 24 25 26 27 28 23 24 25 26 27 28 29 27 28 29 30
30 31
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17 15 16 17 18 19 20 21
18 19 20 21 22 23 24 22 23 24 25 26 27 28
25 26 27 28 29 30 31 29 30
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
28 29 30 26 27 28 29 30 31 23 24 25 26 27 28 29 28 29 30 31
</pre>
{{out|output|text= when using the input of: <tt> 1/1/1969 (SHORTER NARROWER) </tt>}}
(Shown at <big>'''<sup>2</sup>/<sub>3</sub>'''</big> size.)
<pre style="font-size:67%">
«Snoopy "picture" here»
┌──────────────────────────────────┐ ┌──────────────────────────────────┐ ┌──────────────────────────────────┐ ┌──────────────────────────────────┐
│ │ │ │ │ │ │ │
│ January 1969 │ │ February 1969 │ │ March 1969 │ │ April 1969 │
│ │ │ │ │ │ │ │
│ Sun Mon Tue Wed Thu Fri Sat│ │ Sun Mon Tue Wed Thu Fri Sat│ │ Sun Mon Tue Wed Thu Fri Sat│ │ Sun Mon Tue Wed Thu Fri Sat│
├────┬────┬────┬────┬────┬────┬────┤ ├────┬────┬────┬────┬────┬────┬────┤ ├────┬────┬────┬────┬────┬────┬────┤ ├────┬────┬────┬────┬────┬────┬────┤
│ │ │ │ 1 │ 2 │ 3 │ 4 │ │ │ │ │ │ │ │ 1 │ │ │ │ │ │ │ │ 1 │ │ │ │ 1 │ 2 │ 3 │ 4 │ 5 │
├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤
│ 5 │ 6 │ 7 │ 8 │ 9 │ 10 │ 11 │ │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ │ 6 │ 7 │ 8 │ 9 │ 10 │ 11 │ 12 │
├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤
│ 12 │ 13 │ 14 │ 15 │ 16 │ 17 │ 18 │ │ 9 │ 10 │ 11 │ 12 │ 13 │ 14 │ 15 │ │ 9 │ 10 │ 11 │ 12 │ 13 │ 14 │ 15 │ │ 13 │ 14 │ 15 │ 16 │ 17 │ 18 │ 19 │
├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤
│ 19 │ 20 │ 21 │ 22 │ 23 │ 24 │ 25 │ │ 16 │ 17 │ 18 │ 19 │ 20 │ 21 │ 22 │ │ 16 │ 17 │ 18 │ 19 │ 20 │ 21 │ 22 │ │ 20 │ 21 │ 22 │ 23 │ 24 │ 25 │ 26 │
├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤
│ 26 │ 27 │ 28 │ 29 │ 30 │ 31 │ │ │ 23 │ 24 │ 25 │ 26 │ 27 │ 28 │ │ │ 23 │ 24 │ 25 │ 26 │ 27 │ 28 │ 29 │ │ 27 │ 28 │ 29 │ 30 │ │ │ │
└────┴────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┴────┘ ├────┼────┼────┼────┼────┼────┼────┤ └────┴────┴────┴────┴────┴────┴────┘
│ 30 │ 31 │ │ │ │ │ │
└────┴────┴────┴────┴────┴────┴────┘
┌──────────────────────────────────┐ ┌──────────────────────────────────┐ ┌──────────────────────────────────┐ ┌──────────────────────────────────┐
│ │ │ │ │ │ │ │
│ May 1969 │ │ June 1969 │ │ July 1969 │ │ August 1969 │
│ │ │ │ │ │ │ │
│ Sun Mon Tue Wed Thu Fri Sat│ │ Sun Mon Tue Wed Thu Fri Sat│ │ Sun Mon Tue Wed Thu Fri Sat│ │ Sun Mon Tue Wed Thu Fri Sat│
├────┬────┬────┬────┬────┬────┬────┤ ├────┬────┬────┬────┬────┬────┬────┤ ├────┬────┬────┬────┬────┬────┬────┤ ├────┬────┬────┬────┬────┬────┬────┤
│ │ │ │ │ 1 │ 2 │ 3 │ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ │ │ │ 1 │ 2 │ 3 │ 4 │ 5 │ │ │ │ │ │ │ 1 │ 2 │
├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤
│ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 10 │ │ 8 │ 9 │ 10 │ 11 │ 12 │ 13 │ 14 │ │ 6 │ 7 │ 8 │ 9 │ 10 │ 11 │ 12 │ │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │
├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤
│ 11 │ 12 │ 13 │ 14 │ 15 │ 16 │ 17 │ │ 15 │ 16 │ 17 │ 18 │ 19 │ 20 │ 21 │ │ 13 │ 14 │ 15 │ 16 │ 17 │ 18 │ 19 │ │ 10 │ 11 │ 12 │ 13 │ 14 │ 15 │ 16 │
├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤
│ 18 │ 19 │ 20 │ 21 │ 22 │ 23 │ 24 │ │ 22 │ 23 │ 24 │ 25 │ 26 │ 27 │ 28 │ │ 20 │ 21 │ 22 │ 23 │ 24 │ 25 │ 26 │ │ 17 │ 18 │ 19 │ 20 │ 21 │ 22 │ 23 │
├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤
│ 25 │ 26 │ 27 │ 28 │ 29 │ 30 │ 31 │ │ 29 │ 30 │ │ │ │ │ │ │ 27 │ 28 │ 29 │ 30 │ 31 │ │ │ │ 24 │ 25 │ 26 │ 27 │ 28 │ 29 │ 30 │
└────┴────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┴────┘ ├────┼────┼────┼────┼────┼────┼────┤
│ 31 │ │ │ │ │ │ │
└────┴────┴────┴────┴────┴────┴────┘
┌──────────────────────────────────┐ ┌──────────────────────────────────┐ ┌──────────────────────────────────┐ ┌──────────────────────────────────┐
│ │ │ │ │ │ │ │
│ September 1969 │ │ October 1969 │ │ November 1969 │ │ December 1969 │
│ │ │ │ │ │ │ │
│ Sun Mon Tue Wed Thu Fri Sat│ │ Sun Mon Tue Wed Thu Fri Sat│ │ Sun Mon Tue Wed Thu Fri Sat│ │ Sun Mon Tue Wed Thu Fri Sat│
├────┬────┬────┬────┬────┬────┬────┤ ├────┬────┬────┬────┬────┬────┬────┤ ├────┬────┬────┬────┬────┬────┬────┤ ├────┬────┬────┬────┬────┬────┬────┤
│ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ │ │ │ │ 1 │ 2 │ 3 │ 4 │ │ │ │ │ │ │ │ 1 │ │ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │
├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤
│ 7 │ 8 │ 9 │ 10 │ 11 │ 12 │ 13 │ │ 5 │ 6 │ 7 │ 8 │ 9 │ 10 │ 11 │ │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ │ 7 │ 8 │ 9 │ 10 │ 11 │ 12 │ 13 │
├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤
│ 14 │ 15 │ 16 │ 17 │ 18 │ 19 │ 20 │ │ 12 │ 13 │ 14 │ 15 │ 16 │ 17 │ 18 │ │ 9 │ 10 │ 11 │ 12 │ 13 │ 14 │ 15 │ │ 14 │ 15 │ 16 │ 17 │ 18 │ 19 │ 20 │
├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤
│ 21 │ 22 │ 23 │ 24 │ 25 │ 26 │ 27 │ │ 19 │ 20 │ 21 │ 22 │ 23 │ 24 │ 25 │ │ 16 │ 17 │ 18 │ 19 │ 20 │ 21 │ 22 │ │ 21 │ 22 │ 23 │ 24 │ 25 │ 26 │ 27 │
├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┼────┤
│ 28 │ 29 │ 30 │ │ │ │ │ │ 26 │ 27 │ 28 │ 29 │ 30 │ 31 │ │ │ 23 │ 24 │ 25 │ 26 │ 27 │ 28 │ 29 │ │ 28 │ 29 │ 30 │ 31 │ │ │ │
└────┴────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┴────┘ ├────┼────┼────┼────┼────┼────┼────┤ └────┴────┴────┴────┴────┴────┴────┘
│ 30 │ │ │ │ │ │ │
└────┴────┴────┴────┴────┴────┴────┘
</pre>
=={{header|Ring}}==
<
# PROJECT : CALENDAR - FOR "REAL" PROGRAMMERS
# DATE : 2018/06/28
Line 3,140 ⟶ 3,491:
NEXT
NEXT
</syntaxhighlight>
Output:
[https://www.dropbox.com/s/lb7rnqdb30a72kc/CalmoSoftRealCalendar.jpg?dl=0 CALENDAR - FOR "REAL" PROGRAMMERS]
=={{header|Ruby}}==
UPPERCASE RUBY is normally impossible, because Ruby is sensitive to case, and most methods and keywords have lowercase letters. To solve this task, we wrote a new program loader for UPPERCASE RUBY programs.
Line 3,151 ⟶ 3,501:
* <code>loadup.rb</code> is the program loader.
<
class Object
Line 3,176 ⟶ 3,526:
_PROGRAM = ARGV.SHIFT
_PROGRAM || ABORT("USAGE: #{$0} PROGRAM.RB ARGS...")
LOAD($0 = _PROGRAM)</
* <code>CAL.RB</code> is an UPPERCASE RUBY translation of [[Calendar#Ruby]].
{{works with|Ruby|1.8.7}}
<
REQUIRE 'DATE'.DOWNCASE
Line 3,263 ⟶ 3,613:
PROC {80}) }) })
PUTS CAL(ARGV[0].TO_I, _COLUMNS)</
* A local variable must start with a lowercase letter or an underscore, so we have many leading underscores (_YEAR, _COLUMN, _DATE and so on).
Line 3,290 ⟶ 3,640:
27 28 29 30 31 24 25 26 27 28 29 30 28 29 30 26 27 28 29 30 31 23 24 25 26 27 28 29 28 29 30 31
31 30 </pre>
=={{header|Seed7}}==
Seed7 keywords are lower case, so this silly solution uses the whole Calendar Task code, with small changes and all in upper case, in a text file named "CALENDAR.TXT":
Line 3,348 ⟶ 3,697:
Then in another program the file CALENDAR.TXT is [http://seed7.sourceforge.net/libraries/getf.htm#getf%28in_string%29 read], converted, [http://seed7.sourceforge.net/libraries/progs.htm#parseStri%28in_string,in_parseOptions,in_array_string,in_string%29 parsed] and [http://seed7.sourceforge.net/libraries/progs.htm#execute%28in_program,in_array_string,in_parseOptions,in_string%29 executed]:
<
include "getf.s7i";
include "progs.s7i";
Line 3,360 ⟶ 3,709:
source := replace(source, "daysinmonth", "daysInMonth");
execute(parseStri(source));
end func;</
{{out}}
Line 3,401 ⟶ 3,750:
27 28 29 30 31 24 25 26 27 28 29 30 29 30 31
</pre>
=={{header|Sidef}}==
<
-> MONTHS_PER_COL { 6 }
Line 3,461 ⟶ 3,809:
}
FMT_YEAR(ARGV ? ARGV[0].("\LTO_I") : 1969).("\LPRINT")</
{{out}}
<pre>
Line 3,481 ⟶ 3,829:
28 29 30 31 25 26 27 28 29 30 31 29 30 27 28 29 30 31 24 25 26 27 28 29 30 29 30 31
</pre>
=={{header|Tcl}}==
The program starts implementing aliases for all built-in commands. This is done without using any letters at all ;).
CALENDER takes arguments of year and optional terminal width to use.
<
\146\157\162\145\141\143\150 42 [\151\156\146\157 \143\157\155\155\141\156\144\163] {
\145\166\141\154 "
Line 3,534 ⟶ 3,881:
CALENDAR
</syntaxhighlight>
{{out}}
<pre>
Line 3,573 ⟶ 3,920:
27 28 29 30 31 24 25 26 27 28 29 30 29 30 31
</pre>
=={{header|UNIX Shell}}==
===Using Bash Case-Converting Parameter Expansion===
<syntaxhighlight lang="shell">CAL=CAL
TR=TR
A=A
Z=Z
LANG=C ${CAL,,} 1969 | ${TR,,} ${A,}-${Z,} A-Z</
{{out}}
<pre>
Line 3,616 ⟶ 3,964:
27 28 29 30 31 24 25 26 27 28 29 30 29 30 31
</pre>
===HISTORICALLY REAL WAY: INFORM UNIX YOUR TTY ONLY SUPPORTS CAPS===
<pre>sun-go:~$ stty olcuc
SUN-GO:~$ PS AUX | GREP PS
KERNOOPS 1159 0.0 0.0 10240 64 ? SS JUL04 3:59 /USR/SBIN/KERNELOOPS --TEST
KERNOOPS 1161 0.0 0.0 10240 64 ? SS JUL04 3:59 /USR/SBIN/KERNELOOPS
KAZ 2279 0.0 0.2 111724 5340 TTY2 SNL+ JUL04 0:00 /USR/LIB/TRACKER/TRACKER-MINER-APPS
ROOT 9404 0.0 0.3 19092 7600 ? SS 00:09 0:00 /USR/SBIN/CUPSD -L
ROOT 9406 0.0 0.4 44248 9772 ? SSL 00:09 0:00 /USR/SBIN/CUPS-BROWSED
KAZ 30121 4.0 0.1 8760 3072 PTS/3 R+ 09:38 0:00 PS AUX
KAZ 30122 0.0 0.0 6520 788 PTS/3 S+ 09:38 0:00 GREP PS
SUN-GO:~$ GREP ROOT /ETC/PASSWD
ROOT:X:0:0:ROOT:/ROOT:/BIN/BASH
SUN-GO:~$ CAL 1969
1969
JANUARY FEBRUARY MARCH
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 1 1
5 6 7 8 9 10 11 2 3 4 5 6 7 8 2 3 4 5 6 7 8
12 13 14 15 16 17 18 9 10 11 12 13 14 15 9 10 11 12 13 14 15
19 20 21 22 23 24 25 16 17 18 19 20 21 22 16 17 18 19 20 21 22
26 27 28 29 30 31 23 24 25 26 27 28 23 24 25 26 27 28 29
30 31
APRIL MAY JUNE
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 5 1 2 3 1 2 3 4 5 6 7
6 7 8 9 10 11 12 4 5 6 7 8 9 10 8 9 10 11 12 13 14
13 14 15 16 17 18 19 11 12 13 14 15 16 17 15 16 17 18 19 20 21
20 21 22 23 24 25 26 18 19 20 21 22 23 24 22 23 24 25 26 27 28
27 28 29 30 25 26 27 28 29 30 31 29 30
JULY AUGUST SEPTEMBER
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 5 1 2 1 2 3 4 5 6
6 7 8 9 10 11 12 3 4 5 6 7 8 9 7 8 9 10 11 12 13
13 14 15 16 17 18 19 10 11 12 13 14 15 16 14 15 16 17 18 19 20
20 21 22 23 24 25 26 17 18 19 20 21 22 23 21 22 23 24 25 26 27
27 28 29 30 31 24 25 26 27 28 29 30 28 29 30
31
OCTOBER NOVEMBER DECEMBER
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 1 1 2 3 4 5 6
5 6 7 8 9 10 11 2 3 4 5 6 7 8 7 8 9 10 11 12 13
12 13 14 15 16 17 18 9 10 11 12 13 14 15 14 15 16 17 18 19 20
19 20 21 22 23 24 25 16 17 18 19 20 21 22 21 22 23 24 25 26 27
26 27 28 29 30 31 23 24 25 26 27 28 29 28 29 30 31
30
SUN-GO:~$ STTY SANE
sun-go:~$</pre>
=={{header|Vedit macro language}}==
Line 3,624 ⟶ 4,025:
Vedit macro language is case insensitive, but it is normal practice to write short commands in upper case.
<
CFT(22)
#3 = 6 // NUMBER OF MONTHS PER LINE
Line 3,688 ⟶ 4,089:
REG_EMPTY(#20)
NUM_POP(4,20)
RETURN </
<pre>
Line 3,714 ⟶ 4,115:
28 29 30 31 25 26 27 28 29 30 31 29 30 27 28 29 30 31 24 25 26 27 28 29 30 29 30 31
</pre>
=={{header|Visual Basic .NET}}==
'''Compiler:''' Roslyn Visual Basic (language version >= 15.8)
Line 3,721 ⟶ 4,121:
Copied from [[Calendar#Visual_Basic_.NET]] and converted to uppercase. See entry there for description.
<
OPTION EXPLICIT ON
OPTION INFER ON
Line 4,051 ⟶ 4,451:
RETURN S.PADLEFT(((TOTALWIDTH - S.LENGTH) \ 2) + S.LENGTH, PADDINGCHAR).PADRIGHT(TOTALWIDTH, PADDINGCHAR)
END FUNCTION
END MODULE</
{{out|input=COLS:132 ROWS:25 MS/ROW:6 HSTRETCH:FALSE VSTRETCH:FALSE}}
Line 4,078 ⟶ 4,478:
</pre>
=={{header|Wren}}==
Strictly speaking, ''real'' programming is impossible in Wren which is case sensitive and keywords, library classes, methods etc. never use all upper case letters.
We therefore do what other languages in a similar predicament have done and begin by creating an all upper case version of the calendar program called ''calendar_real_uc.txt'':
{{libheader|Wren-date}}
{{libheader|Wren-fmt}}
{{libheader|Wren-seq}}
<syntaxhighlight lang="text">IMPORT "./DATE" FOR DATE
IMPORT "./FMT" FOR FMT
IMPORT "./SEQ" FOR LST
VAR CALENDAR = FN.NEW { |YEAR|
VAR SNOOPY = "🐶"
VAR DAYS = "SU MO TU WE TH FR SA"
VAR MONTHS = [
"JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE",
"JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER"
]
FMT.PRINT("$70M", SNOOPY)
VAR YEARSTR = "--- %(YEAR) ---"
FMT.PRINT("$70M\N", YEARSTR)
VAR FIRST = LIST.FILLED(3, 0)
VAR MLEN = LIST.FILLED(3, 0)
VAR C = 0
FOR (CHUNK IN LST.CHUNKS(MONTHS, 3)) {
FOR (I IN 0..2) FMT.WRITE("$20M ", CHUNK[I])
SYSTEM.PRINT()
FOR (I IN 0..2) SYSTEM.WRITE("%(DAYS) ")
SYSTEM.PRINT()
FIRST[0] = DATE.NEW(YEAR, C*3 + 1, 1).DAYOFWEEK % 7
FIRST[1] = DATE.NEW(YEAR, C*3 + 2, 1).DAYOFWEEK % 7
FIRST[2] = DATE.NEW(YEAR, C*3 + 3, 1).DAYOFWEEK % 7
MLEN[0] = DATE.MONTHLENGTH(YEAR, C*3 + 1)
MLEN[1] = DATE.MONTHLENGTH(YEAR, C*3 + 2)
MLEN[2] = DATE.MONTHLENGTH(YEAR, C*3 + 3)
FOR (I IN 0..5) {
FOR (J IN 0..2) {
VAR START = 1 + 7 * I - FIRST[J]
FOR (K IN START..START+6) {
IF (K >= 1 && K <= MLEN[J]) {
FMT.WRITE("$2D ", K)
} ELSE {
SYSTEM.WRITE(" ")
}
}
SYSTEM.WRITE(" ")
}
SYSTEM.PRINT()
}
SYSTEM.PRINT()
C = C + 1
}
}
CALENDAR.CALL(1969)</syntaxhighlight>
We then create a script called ''calendar_real.wren'' which takes the above text file as input, changes those items which cannot be upper case into their normal casing and compiles and runs the result:
{{libheader|Wren-str}}
<syntaxhighlight lang="wren">import "io" for File
import "./str" for Str
import "meta" for Meta
var keywords = ["import", "for", "var", "in", "if", "else"]
var modules = ["/date", "/fmt", "/seq"]
var classes = ["Date", "Fmt", "Lst", "Fn", "List", "System"]
var methods = ["print", "filled", "chunks", "write", "new", "dayOfWeek", "monthLength", "call"]
var formats = ["$70m", "\\n", "$20m", "$2d"]
var text = File.read("calendar_real_uc.txt")
for (keyword in keywords) text = text.replace(Str.upper(keyword) + " ", keyword + " ")
for (module in modules) text = text.replace(Str.upper(module), module)
for (clazz in classes) text = text.replace(Str.upper(clazz), clazz)
for (method in methods) text = text.replace("." + Str.upper(method), "." + method)
for (format in formats) text = text.replace(Str.upper(format), format)
Meta.compile(text).call()</syntaxhighlight>
{{out}}
<pre>
🐶
--- 1969 ---
JANUARY FEBRUARY MARCH
SU MO TU WE TH FR
1 2 3 4
26 27 28 29 30 31 23 24
30 31
APRIL MAY JUNE
SU MO TU WE TH FR
1 2 3 4 5
6 7 8 9 10 11 12 4
13 14 15 16 17 18 19 11 12 13
20 21 22 23 24 25 26 18 19 20
27 28 29 30 25 26 27 28 29 30 31 29 30
JULY AUGUST SEPTEMBER
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 5
6 7 8 9 10 11 12 3
13 14 15 16 17 18 19 10 11 12 13 14 15
20 21 22 23 24 25 26 17 18 19 20 21 22 23 21 22 23 24 25 26 27
27 28 29 30 31 24 25
31
OCTOBER
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4
5 6 7 8 9 10 11 2 3 4 5 6 7 8 7 8 9 10 11 12 13
12 13 14 15 16 17 18 9 10 11 12 13 14 15 14 15 16 17 18 19 20
19 20 21 22 23 24 25 16 17 18 19 20 21 22 21 22 23 24 25 26 27
26 27 28 29 30 31 23 24 25 26 27 28 29 28 29 30 31
</pre>
=={{header|X86 Assembly}}==
ASSEMBLE WITH: TASM CALENDAR; TLINK /t CALENDAR
<
.CODE
.486
Line 4,398 ⟶ 4,788:
DAYS DB 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
DAY DB ?, ?, ?, ?, ?, ?
END START</
{{Out}}
Line 4,423 ⟶ 4,813:
31 30
</pre>
=={{header|XLISP}}==
XLISP isn't case-sensitive, so in principle it would be possible just to reproduce the solution given in the "ordinary" Calendar task. But that program makes use of recursion, "fancy" data structures, long variable names, pretty-printy indentation, and a whole host of other features that I don't think REAL programmers like any better than they like lower case: so, instead, here is a version using only global variables and "<tt>DO</tt> loops like God meant them to be".
<syntaxhighlight lang="lisp">(SETQ YR 1969)
(SETQ M #("JANUARY" "FEBRUARY" "MARCH" "APRIL" "MAY" "JUNE" "JULY" "AUGUST" "SEPTEMBER" "OCTOBER" "NOVEMBER" "DECEMBER"))
(SETQ ML #(31 28 31 30 31 30 31 31 30 31 30 31))
(SETQ WD #("SU" "MO" "TU" "WE" "TH" "FR" "SA"))
(IF (AND (= (REM YR 4) 0) (OR (/= (REM YR 100) 0) (= (REM YR 400) 0))) (VECTOR-SET! ML 1 29))
(SETQ D (REM (+ 1 (+ (* 5 (REM (- YR 1) 4)) (* 4 (REM (- YR 1) 100)) (* 6 (REM (- YR 1) 400)))) 7))
(TERPRI)
(DO ((I 0 (+ I 1))) ((> I 60))
(PRINC " "))
(PRINC "SNOOPY CALENDAR ")
(PRINC YR)
(TERPRI)
(DO ((I 0 (+ I 1))) ((> I 11))
(TERPRI)
(DO ((J 0 (+ J 1))) ((> J 65))
(PRINC " "))
(PRINC (VECTOR-REF M I))
(TERPRI)
(PRINC " ")
(DO ((J 0 (+ J 1))) ((> J 6))
(DO ((K 0 (+ K 1))) ((> K 14))
(PRINC " "))
(PRINC (VECTOR-REF WD J))
(PRINC " "))
(TERPRI)
(DO ((J 0 (+ J 1))) ((> J 6))
(IF (< J D) (DO ((K 0 (+ K 1))) ((> K 18)) (PRINC " "))))
(DO ((J 1 (+ J 1))) ((> J (VECTOR-REF ML I)))
(PRINC " ")
(IF (< J 10) (PRINC " "))
(DO ((K 0 (+ K 1))) ((> K 14))
(PRINC " "))
(PRINC J)
(SETQ D (+ D 1))
(IF (> D 6) (TERPRI))
(IF (> D 6) (SETQ D 0))))</syntaxhighlight>
{{out}}
<pre> SNOOPY CALENDAR 1969
JANUARY
SU MO TU WE TH FR SA
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
FEBRUARY
SU MO TU WE TH FR SA
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
MARCH
SU MO TU WE TH FR SA
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
APRIL
SU MO TU WE TH FR SA
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
MAY
SU MO TU WE TH FR SA
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
JUNE
SU MO TU WE TH FR SA
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
JULY
SU MO TU WE TH FR SA
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
AUGUST
SU MO TU WE TH FR SA
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
SEPTEMBER
SU MO TU WE TH FR SA
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
OCTOBER
SU MO TU WE TH FR SA
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
NOVEMBER
SU MO TU WE TH FR SA
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30
DECEMBER
SU MO TU WE TH FR SA
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31</pre>
=={{header|zkl}}==
{{trans|D}}
Line 4,429 ⟶ 4,947:
The calendar code, file UPCAL.zkl (upper cased version of [[Calendar#zkl]]):
<
FCN CENTER(TEXT,M) { STRING(" "*((M-TEXT.LEN())/2),TEXT) }
Line 4,440 ⟶ 4,958:
.PUMP(LIST,T(VOID.READ,DAYS.LEN()/3,FALSE),STRING.CREATE));
}
...</
And the pre-processor, hand rolled for the above code (file bbb.zkl):
<
code=Data(Void,code.text.toLower());
mixed:=T("string","String", "list","List", " t("," T(",",t(",",T(",
Line 4,452 ⟶ 4,970:
);
mixed.pump(Void,Void.Read,'wrap(up,down){ code.replace(up,down) });
Compiler.Compiler.compileText(code)();</
{{out}}
<pre>
Line 4,465 ⟶ 4,983:
...
</pre>
{{omit from|C sharp|keywords are lower case}}
{{omit from|C++}}
{{omit from|Clojure|Clojure's keywords are lower case}}
{{omit from|D|D's keywords are lower case}}
Line 4,474 ⟶ 4,991:
{{omit from|Java|Java's keywords are lower case}}
{{omit from|Mathematica}}
{{omit from|Processing|Processing's keywords are lower case}}
{{omit from|Python}}
{{omit from|Stata|keywords are lower case}}
|