Calendar - for "REAL" programmers: Difference between revisions

m
→‎{{header|Phix}}: use pygments
No edit summary
m (→‎{{header|Phix}}: use pygments)
 
(7 intermediate revisions by 6 users not shown)
Line 519:
30
</pre>
=={{header|BaConBASIC}}==
==={{header|BaCon}}===
Choosing 132 character output. Same as the "Calendar" from [[Calendar#BaCon|the calendar task]] but using all capitals:
<syntaxhighlight lang="freebasic">DECLARE MON$[] = { "JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER" }
Line 575 ⟶ 576:
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|BBC BASIC}}==
==={{header|BBC BASIC}}===
{{works with|BBC BASIC for Windows}}
<syntaxhighlight lang="bbcbasic"> VDU 23,22,1056;336;8,16,16,128
Line 1,044 ⟶ 1,046:
30 </pre>
=={{header|Elena}}==
ELENA 56.0x :
<syntaxhighlight lang="elena">import system'text;
import system'routines;
Line 1,051 ⟶ 1,053:
import extensions'routines;
 
const MonthNames = new string[]{"JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER"};
"NOVEMBER","DECEMBER"};
const DayNames = new string[]{"MO", "TU", "WE", "TH", "FR", "SA", "SU"};
 
class CalendarMonthPrinter
{
Date theDate _date;
TextBuilder theLine _line;
int theMonth _month;
int theYear _year;
refReference<int> theRow_row;
constructor(year, month)
{
theMonth_month := month;
theYear_year := year;
theLine_line := new TextBuilder();
theRow_row := 0;
}
 
writeTitle()
{
theRow_row.Value := 0;
theDate_date := Date.new(theYear_year, theMonth_month, 1);
 
DayNames.forEach:(name)
{ theLineDayNames.printforEach::(" ",name) }
{ _line.print(" ",name) }
}
}
writeLine()
{
theLine_line.clear();
 
if (theDate_date.Month == theMonth_month)
{
var dw := theDate_date.DayOfWeek;
 
theLine_line.writeCopies(" ",theDate_date.DayOfWeek == 0 ? 6 : (theDate_date.DayOfWeek - 1));
 
do
{
theLine_line.writePaddingLeft(theDate_date.Day.toPrintable(), $32, 3);
 
theDate_date := theDate_date.addDays:(1)
}
until(theDate_date.Month != theMonth_month || theDate_date.DayOfWeek == 1)
};
 
int length := theLine_line.Length;
if (length < 21)
{ theLine_line.writeCopies(" ", 21 - length) };
 
theRow_row.append(1)
}
indexer() = new Indexer
{
bool Available = theRow_row < 7;
 
int Index
{
get() = theRow_row.Value;
set(int index)
{
if (index <= theRow_row)
{ self.writeTitle() };
while (index > theRow_row)
{ self.writeLine() }
}
}
 
appendIndex(int index)
{
this self.Index := theRow_row.Value + index
}
get int Length() { ^ 7 }
 
get getValue() = self;
set setValue(o) { NotSupportedException.raise() }
};
printTitleTo(output)
{
output.writePadding(MonthNames[theMonth_month - 1], $32, 21)
}
printTo(output)
{
output.write(theLine_line.Value)
}
}
 
class Calendar
{
int theYear_year;
int theRowLength_rowLength;
constructor new(int year)
{
theYear_year := year;
theRowLength_rowLength := 3
}
printTo(output)
{
output.writePadding("[SNOOPY]", $32, theRowLength_rowLength * 25);
output.writeLine();
output.writePadding(theYear_year.toPrintable(), $32, theRowLength_rowLength * 25);
output.writeLine().writeLine();
var rowCount := 12 / theRowLength_rowLength;
var months := Array.allocate(rowCount).populate::(i =>
Array.allocate(theRowLength_rowLength)
.populate::(j =>
new CalendarMonthPrinter(theYear_year, i * theRowLength_rowLength + j + 1)));
months.forEach::(row)
{
var r := row;
row.forEach::(month)
{
month.printTitleTo:(output);
output.write:(" ")
};
output.writeLine();
ParallelEnumerator.new(row).forEach::(line)
{
line.forEach::(printer)
{
lineprinter.forEach:printTo(printeroutput);
{
printer.printTo:output;
 
output.write:(" ")
};
 
output.writeLine()
}
}
}
}
 
public program()
{
var calender := Calendar.new(console.write:("ENTER THE YEAR:").readLine().toInt());
calender.printTo:(console);
 
console.readChar()
}</syntaxhighlight>
{{out}}
Line 1,243 ⟶ 1,245:
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|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}}==
Line 1,568 ⟶ 1,641:
 
=={{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
include "NSLog.incl"
CFSTRINGREF OUTPUTSTR = NULL
 
local fn RunTerminalCommand( cmd as CFStringRef ) as CFStringRef
CFStringRef outputStr = NULL
TaskRefTASKREF taskTASK = fnFN TaskInitTASKINIT
TASKSETEXECUTABLEURL( TASK, FN URLFILEURLWITHPATH( FN STRINGLOWERCASESTRING( @"/BIN/ZSH" ) ) )
TaskSetExecutableURL( task, fn URLFileURLWithPath( @"/bin/zsh" ) )
CFStringRefCFSTRINGREF cmdStrCMDSTR = fnFN StringWithFormatSTRINGWITHFORMAT( @"%@", cmdFN STRINGLOWERCASESTRING( CMD ) )
CFArrayRefCFARRAYREF argsARGS = fnFN ArrayWithObjectsARRAYWITHOBJECTS( FN STRINGLOWERCASESTRING( @"-cC" ), cmdStrCMDSTR, NULL )
TaskSetArgumentsTASKSETARGUMENTS( taskTASK, argsARGS )
PipeRefPIPEREF pP = fnFN PipeInitPIPEINIT
TaskSetStandardOutputTASKSETSTANDARDOUTPUT( taskTASK, pP )
TaskSetStandardErrorTASKSETSTANDARDERROR( taskTASK, pP )
FileHandleRefFILEHANDLEREF fhFH = fnFN PipeFileHandleForReadingPIPEFILEHANDLEFORREADING( pP )
fnFN TaskLaunchTASKLAUNCH( taskTASK, NULL )
TaskWaitUntilExitTASKWAITUNTILEXIT( taskTASK )
ErrorRefERRORREF errERR
CFDataRefCFDATAREF dtaDTA = fnFN FileHandleReadDataToEndOfFileFILEHANDLEREADDATATOENDOFFILE( fhFH, @errERR )
ifIF errERR thenTHEN NSLogNSLOG( @"%@", fnFN ErrorLocalizedDescriptionERRORLOCALIZEDDESCRIPTION( errERR ) ) : exitEXIT fnFN
OUTPUTSTR = FN STRINGWITHDATA( DTA, NSUTF8STRINGENCODING )
outputStr = fn StringWithData( dta, NSUTF8StringEncoding )
OUTPUTSTR = FN STRINGUPPERCASESTRING( OUTPUTSTR )
outputStr = fn StringUppercaseString( outputStr )
endEND fnFN = outputStrOUTPUTSTR
 
VOID LOCAL FN BUILDSNOOPYCALENDAR
void local fn BuildSnoopyCalendar
CFStringRefCFSTRINGREF calStrCALSTR = fnFN StringWithFormatSTRINGWITHFORMAT( FN STRINGLOWERCASESTRING( @"\n%37s37S\n\n%@" ), fnFN StringUTF8StringSTRINGUTF8STRING( @"[SNOOPY HERE]" ), fnFN RunTerminalCommandRUNTERMINALCOMMAND( FN STRINGLOWERCASESTRING( @"calCAL 1969" ) ) )
NSLogNSLOG( @"%@", calStrCALSTR )
END FN
end fn
 
FN BUILDSNOOPYCALENDAR
fn BuildSnoopyCalendar
 
HANDLEEVENTS
HandleEvents
</syntaxhighlight>
{{output}}
Line 1,648 ⟶ 1,720:
30
</pre>
 
 
=={{header|Go}}==
Line 2,748 ⟶ 2,819:
Although, if we are abusing the backticks and other innocent programs, why not just: <syntaxhighlight lang="perl">$_=$ARGV[0]//1969;`\143\141\154 $_ >&2`</syntaxhighlight>
=={{header|Phix}}==
I'm not going to take this too seriously and instead treat it as a good opportunity to showcase how trivial it is to make some rather fundamental changes to the compiler. So, the first task is to take a copy of [[Calendar#Phix|Calendar]] and make it output uppercase. Change the line in routine centre:
<syntaxhighlight lang="phix">
 
--return repeat(' ',left)&s&repeat(' ',right)
So, the first task is to take a copy of [[Calendar#Phix|Calendar]] and make it output uppercase. Change the line
return repeat(' ',left)&upper(s)&repeat(' ',right)
<!--<syntaxhighlight lang="phix">(phixonline)-->
</syntaxhighlight>
<span style="color: #008080;">return</span> <span style="color: #7060A8;">repeat</span><span style="color: #0000FF;">(</span><span style="color: #008000;">' '</span><span style="color: #0000FF;">,</span><span style="color: #000000;">left</span><span style="color: #0000FF;">)&</span><span style="color: #000000;">s</span><span style="color: #0000FF;">&</span><span style="color: #7060A8;">repeat</span><span style="color: #0000FF;">(</span><span style="color: #008000;">' '</span><span style="color: #0000FF;">,</span><span style="color: #000000;">right</span><span style="color: #0000FF;">)</span>
(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>-->
<syntaxhighlight lang="phix">
in routine centre to:
initialSymEntry("integer", S_Type,"TI",opInt, E_none) -- #01 / 0b0001 integer
<!--<syntaxhighlight lang="phix">(phixonline)-->
</syntaxhighlight>
<span style="color: #008080;">return</span> <span style="color: #7060A8;">repeat</span><span style="color: #0000FF;">(</span><span style="color: #008000;">' '</span><span style="color: #0000FF;">,</span><span style="color: #000000;">left</span><span style="color: #0000FF;">)&</span><span style="color: #7060A8;">upper</span><span style="color: #0000FF;">(</span><span style="color: #000000;">s</span><span style="color: #0000FF;">)&</span><span style="color: #7060A8;">repeat</span><span style="color: #0000FF;">(</span><span style="color: #008000;">' '</span><span style="color: #0000FF;">,</span><span style="color: #000000;">right</span><span style="color: #0000FF;">)</span>
<!--</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.<br>
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">(phixonline)-->
<span style="color: #000000;">initialSymEntry</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"integer"</span><span style="color: #0000FF;">,</span> <span style="color: #000000;">S_Type</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"TI"</span><span style="color: #0000FF;">,</span><span style="color: #000000;">opInt</span><span style="color: #0000FF;">,</span> <span style="color: #000000;">E_none</span><span style="color: #0000FF;">)</span> <span style="color: #000080;font-style:italic;">-- #01 / 0b0001 integer</span>
<!--</syntaxhighlight>-->
Immediately after that (it should now be there commented out) add:
<!--<syntaxhighlight lang="phix">(phixonline)-->
Alias("INTEGER",symlimit)
<span style="color: #000000;">Alias</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"INTEGER"</span><span style="color: #0000FF;">,</span><span style="color: #000000;">symlimit</span><span style="color: #0000FF;">)</span>
<!--</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">
Add similar lines for length, floor, repeat, upper, day_of_week, sequence, string, sprintf, append, printf, join, at the appropriate places.
procedure tt_stringA(sequence text, integer alias)
 
tt_string(text,-2)
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):
tt[pcurr] = alias
<!--<syntaxhighlight lang="phix">(phixonline)-->
end procedure
<span style="color: #008080;">procedure</span> <span style="color: #000000;">tt_stringA</span><span style="color: #0000FF;">(</span><span style="color: #004080;">sequence</span> <span style="color: #000000;">text</span><span style="color: #0000FF;">,</span> <span style="color: #004080;">integer</span> <span style="color: #000000;">alias</span><span style="color: #0000FF;">)</span>
</syntaxhighlight>
<span style="color: #000000;">tt_string</span><span style="color: #0000FF;">(</span><span style="color: #000000;">text</span><span style="color: #0000FF;">,-</span><span style="color: #000000;">2</span><span style="color: #0000FF;">)</span>
<span style="color: #000000;">tt</span><span style="color: #0000FF;">[</span><span style="color: #000000;">pcurr</span><span style="color: #0000FF;">]</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">alias</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">procedure</span>
<!--</syntaxhighlight>-->
and you can find the line
<!--<syntaxhighlight lang="phix">(phixonline)-->
global constant T_include = 596 tt_stringF("include",T_include)
<span style="color: #008080;">global</span> <span style="color: #008080;">constant</span> <span style="color: #000000;">T_include</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">596</span> <span style="color: #000000;">tt_stringF</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"include"</span><span style="color: #0000FF;">,</span><span style="color: #000000;">T_include</span><span style="color: #0000FF;">)</span>
<!--</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">(phixonline)-->
tt_stringA("INCLUDE",T_include)
<span style="color: #000000;">tt_stringA</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"INCLUDE"</span><span style="color: #0000FF;">,</span><span style="color: #000000;">T_include</span><span style="color: #0000FF;">)</span>
<!--</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).
Line 2,792 ⟶ 2,852:
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">(phixonline)-->
--Ch = find(Ch,escchar)
<span style="color: #000000;">Ch</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">find</span><span style="color: #0000FF;">(</span><span style="color: #000000;">Ch</span><span style="color: #0000FF;">,</span><span style="color: #000000;">escchar</span><span style="color: #0000FF;">)</span>
Ch = find(lower(Ch),escchar)
<!--</syntaxhighlight>-->
</syntaxhighlight>
to
<!--<syntaxhighlight lang="phix">(phixonline)-->
<span style="color: #000000;">Ch</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">find</span><span style="color: #0000FF;">(</span><span style="color: #7060A8;">lower</span><span style="color: #0000FF;">(</span><span style="color: #000000;">Ch</span><span style="color: #0000FF;">),</span><span style="color: #000000;">escchar</span><span style="color: #0000FF;">)</span>
<!--</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 are probably even simpler changes to ptok.e/pttree.e that would make everything case insensitive, but locating those is left as an exercise for the reader.<br> Likewise the changes that would be needed to pwa/p2js have been left as an exercise for the reader, but are assumed similarly trivial.
Likewise the changes that would be needed to pwa/p2js have been left as an exercise for the reader, but are assumed similarly trivial.
 
You don't actually have to repackage (p -c p) to test this, just run p p test.exw - technically slower by a second or so but only really noticeable long-term.
 
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>.
 
=={{header|PHP}}==
While PHP functions are case-sensitive (aside of <code>_()</code>), this isn't the case for language constructs.
Line 3,864 ⟶ 3,921:
</pre>
=={{header|UNIX Shell}}==
 
===Using Bash Case-Converting Parameter Expansion===
<syntaxhighlight lang="shell">CAL=CAL
TR=TR
Line 3,905 ⟶ 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}}==
In [[Calendar]] task, standard calendar.vdm macro was called to draw one month calendar.
Line 4,373 ⟶ 4,486:
{{libheader|Wren-fmt}}
{{libheader|Wren-seq}}
<syntaxhighlight lang="ecmascripttext">IMPORT "./DATE" FOR DATE
IMPORT "./FMT" FOR FMT
IMPORT "./SEQ" FOR LST
 
VAR CALENDAR = FN.NEW { |YEAR|
Line 4,425 ⟶ 4,538:
 
{{libheader|Wren-str}}
<syntaxhighlight lang="ecmascriptwren">import "io" for File
import "./str" for Str
import "meta" for Meta
 
Line 4,485 ⟶ 4,598:
30
</pre>
 
=={{header|X86 Assembly}}==
ASSEMBLE WITH: TASM CALENDAR; TLINK /t CALENDAR
7,803

edits