Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
67
Task/Calendar/M2000-Interpreter/calendar.m2000
Normal file
67
Task/Calendar/M2000-Interpreter/calendar.m2000
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
Module Calendar (Year, LocaleId) {
|
||||
Function GetMax(Year, Month) {
|
||||
a=date(str$(Year)+"-"+str$(Month)+"-1")
|
||||
max=32
|
||||
do {
|
||||
max--
|
||||
m=val(str$(cdate(a,0,0,max), "m"))
|
||||
} until m=Month
|
||||
=max+1
|
||||
}
|
||||
Function SkipMo(Year, Month) {
|
||||
a=date(str$(Year)+"-"+str$(Month)+"-1")
|
||||
=(val(str$(a, "w"))-8) mod 7 +7
|
||||
}
|
||||
Function Title$(a$) {
|
||||
=Ucase$(left$(a$,1))+Lcase$(Mid$(a$, 2))
|
||||
}
|
||||
locale LocaleId
|
||||
Cursor 0,Height-1 ' last line, so each new line scroll all lines up
|
||||
Print Over $(2), Year
|
||||
Print
|
||||
For j=0 to 3 {
|
||||
Print
|
||||
For i=1 to 3 {
|
||||
Month=i+j*3
|
||||
Print Part @((i-1)*29-1), $(2,22), Title$(Ucase$(locale$(55+Month)))
|
||||
}
|
||||
Print
|
||||
Dim Skip(1 to 3), Count(1 to 3), D(1 to 3)=1
|
||||
For i=1 to 3 {
|
||||
Month=i+j*3
|
||||
if i>1 Then Print String$(" ",8);
|
||||
For k=42 to 48 :Print Title$(Ucase$(Left$(locale$(k),2)));" ";:Next k
|
||||
Skip(i)=SkipMo(Year, Month)
|
||||
Count(i)=GetMax(Year, Month)
|
||||
}
|
||||
Print
|
||||
For i=1 to 3 {
|
||||
if i>1 Then Print String$(" ",8);
|
||||
For k=1 to 7 {
|
||||
skip(i)--
|
||||
if skip(i)>0 Then Print " "; :continue
|
||||
Count(i)--
|
||||
Print format$("{0::-2} ", d(i));
|
||||
d(i)++
|
||||
}
|
||||
}
|
||||
Print
|
||||
Print @(0)
|
||||
For m=1 to 5 {
|
||||
For i=1 to 3 {
|
||||
if i>1 Then Print String$(" ",8);
|
||||
For k=1 to 7 {
|
||||
Count(i)--
|
||||
if Count(i)<0 Then Print " "; : Continue
|
||||
Print format$("{0::-2} ", d(i));
|
||||
d(i)++
|
||||
}
|
||||
}
|
||||
Print
|
||||
}
|
||||
}
|
||||
}
|
||||
Form 80,43
|
||||
Calendar 1969, 1033 ' English
|
||||
k=Key$ ' wait key
|
||||
Calendar 2018, 1032 ' Greek
|
||||
Loading…
Add table
Add a link
Reference in a new issue