Calendar: Difference between revisions

m (→‎{{header|WYLBUR}}: minor edit)
Line 4,855:
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
</pre>
 
=={{header|Phixmonti}}==
{{trans|Lua}}
<lang Phixmonti>include ..\Utilitys.pmt
 
32 var space
 
def bksp /# -- backspace #/
8 tochar print
enddef
 
def floor
.5 + int
enddef
 
def center
tostr align
enddef
 
def startday /# year -- day of the week of january 1 #/
1 - >ps
tps 365 * tps 4 / floor + tps 100 / floor - ps> 400 / floor + 7 mod
enddef
 
def bisiesto? /# year -- true if leap #/
dup 4 mod not over 100 mod and swap 400 mod not or
enddef
 
def snoopy
0 tcolor 15 bcolor
"snoopy.txt" "r" fopen var f
 
true
while
f fgets
dup -1 == if
drop
f fclose
false
else
print
true
endif
endwhile
15 tcolor 0 bcolor
enddef
 
( "JANUARY" "FEBRUARY" "MARCH" "APRIL" "MAY" "JUNE" "JULY" "AUGUST" "SEPTEMBER" "OCTOBER" "NOVEMBER" "DECEMBER" ) var months
"MO TU WE TH FR SA SU" var daysTitle
( 31 28 31 30 31 30 31 31 30 31 30 31 ) var daysPerMonth
daysTitle len nip var monthwidth
 
def makeMonth var days >ps
monthwidth center daysTitle 2 tolist
 
1 ps> - 1 + >ps
true
while
( )
7 for drop
tps 1 < tps days > or if
" "
else
tps
endif
2 align 0 put
ps> 1 + >ps
endfor
0 put
len 8 <
endwhile
ps> drop
enddef
 
def print_cal >ps
tps bisiesto? if daysPerMonth 29 2 set var daysPerMonth endif
5 space over repeat var spaces
snoopy
3 monthwidth * swap 2 * +
"--- " tps tostr " ---" chain chain swap center ? nl
ps> startday var inicio
( )
 
12 for >ps
months tps get nip inicio
daysPerMonth ps> get nip >ps
tps makeMonth 0 put
inicio ps> + 7 mod var inicio
endfor
( 0 3 ) for var i
8 for var k
3 for var j
i 3 * j + get
k get
list? if
10 tcolor
len for
get print " " print
endfor
drop
bksp
else
11 tcolor
print
endif
drop
spaces print
endfor
nl
endfor
nl
endfor
drop
enddef
 
2020 print_cal</lang>
{{out}}
<pre>
co;
NM0 l lXM0cM
MM 0M;
Mc ;o: lMMMMMMMXOOOOMX:
ON M `c o :MK
M W '; l :M
o ,N 0` MO
M 'MM. WM' KK
M `:`` 0M .,,,,, K:
O:;cMXcK M, `MMMMMMMMM M
cK,lMoMXlMM`.O 0XXXXXK 0
M MMMlMM;MM:N.0 0o
locOMMMKMMMMMX o` ` M
M :MMMMMlWMoWMK O .Mo cK
M MMMMMMMMMMMO 0 c: : oM
cK MMMMMMMMMMMM 0 :O `M oMl
M ,MMMMMMMOMMW 0 cK ` oM`oWNMMM'
M ,MMM0MMMMM :W ::: cMl'
0M lMNMMMM.`M ,:,MMo lMMMX
KMc NW M0 `WcX;M'
WW .M :
M;O000KMO`
MMMMo::c,:0
'M cM
 
 
--- 2020 ---
 
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 2 3 4 5 6 7 8
6 7 8 9 10 11 12 3 4 5 6 7 8 9 9 10 11 12 13 14 15
13 14 15 16 17 18 19 10 11 12 13 14 15 16 16 17 18 19 20 21 22
20 21 22 23 24 25 26 17 18 19 20 21 22 23 23 24 25 26 27 28 29
27 28 29 30 31 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 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
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
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
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 2 3 4 5 6 7 8 1 2 3 4 5 6
5 6 7 8 9 10 11 9 10 11 12 13 14 15 7 8 9 10 11 12 13
12 13 14 15 16 17 18 16 17 18 19 20 21 22 14 15 16 17 18 19 20
19 20 21 22 23 24 25 23 24 25 26 27 28 29 21 22 23 24 25 26 27
26 27 28 29 30 31 30 28 29 30 31
 
 
 
=== Press any key to exit ===</pre>
 
=={{header|PicoLisp}}==
672

edits