Calendar - for "REAL" programmers: Difference between revisions

m
(Merge omitted languages at bottom and add Processing)
Line 1,047:
 
=={{header|Elena}}==
ELENA 45.10 :
<lang elena>import system'text;
import system'routines;
Line 1,054:
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
Line 1,087 ⟶ 1,088:
if (theDate.Month == theMonth)
{
theLine.writeCopies("var dw ",theDate.DayOfWeek =:= 0 ? 7 : (theDate.DayOfWeek - 1));
theLine.writeCopies(" ",theDate.DayOfWeek == 0 ? 6 : (theDate.DayOfWeek - 1));
do
{
theLine.writePaddingLeft(theDate.Day.PrintabletoPrintable(), $32, 3);
theDate := theDate.addDays:1
}
until:(theDate.Month != theMonth || theDate.DayOfWeek == 1)
};
Line 1,105 ⟶ 1,108:
}
indexer() = new Indexer:
{
bool Available = theRow < 7;
 
writeIndex(int index)Index
readIndexTo(ref int retVal) { theRow.readValueTo(ref retVal) }
 
writeIndex(int index)
{
if get(index) <= theRow).Value;
{ self.writeTitle() };
set(int index)
while (index > theRow){
{if self.writeLine()index }<= theRow)
{ self.writeTitle() };
while (index > theRow)
{ self.writeLine() }
}
}
 
appendIndex(int index)
{
<this self.Index := writeIndex(theRow.Value + index);
}
readLengthTo(refget int retValLength() { retVal :=^ 7 }
 
get() = self;
Line 1,156 ⟶ 1,164:
output.writePadding("[SNOOPY]", $32, theRowLength * 25);
output.writeLine();
output.writePadding(theYear.PrintabletoPrintable(), $32, theRowLength * 25);
output.writeLine().writeLine();
Anonymous user