Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
37
Task/Calendar/SPL/calendar.spl
Normal file
37
Task/Calendar/SPL/calendar.spl
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
year = 1969
|
||||
#.output(#.str(year,">68<"))
|
||||
> row, 0..3
|
||||
> col, 1..3
|
||||
cal[col] = mcal(row*3+col,year)
|
||||
size = #.size(cal[col],1)
|
||||
<
|
||||
> i, 1..8
|
||||
str = ""
|
||||
> col, 1..3
|
||||
? col>1, str += " "
|
||||
line = ""
|
||||
? #.size(cal[col],1)!<i, line = cal[col][i]
|
||||
str += #.str(line,"<20<")
|
||||
<
|
||||
#.output(str)
|
||||
<
|
||||
<
|
||||
mcal(m,y)=
|
||||
months = ["January","February","March","April","May","June","July","August","September","October","November","December"]
|
||||
days = [31,28,31,30,31,30,31,31,30,31,30,31]
|
||||
? y%4=0, days[2] = 29
|
||||
lines = #.array(0)
|
||||
lines[1] = #.str(months[m],">20<")
|
||||
lines[2] = "Mo Tu We Th Fr Sa Su"
|
||||
n = 3
|
||||
> i, 1..#.weekday(1,m,y)-1
|
||||
lines[n] += " "
|
||||
<
|
||||
> d, 1..days[m]
|
||||
wd = #.weekday(d,m,y)
|
||||
lines[n] += #.str(d,">2>")
|
||||
? wd<7, lines[n] += " "
|
||||
? wd=7, n += 1
|
||||
<
|
||||
<= lines
|
||||
.
|
||||
Loading…
Add table
Add a link
Reference in a new issue