Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
7
Task/Five-weekends/J/five-weekends-1.j
Normal file
7
Task/Five-weekends/J/five-weekends-1.j
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
require 'types/datetime numeric'
|
||||
find5wkdMonths=: verb define
|
||||
years=. range 2{. y
|
||||
months=. 1 3 5 7 8 10 12
|
||||
m5w=. (#~ 0 = weekday) >,{years;months;31 NB. 5 full weekends iff 31st is Sunday(0)
|
||||
>'MMM YYYY' fmtDate toDayNo m5w
|
||||
)
|
||||
16
Task/Five-weekends/J/five-weekends-2.j
Normal file
16
Task/Five-weekends/J/five-weekends-2.j
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# find5wkdMonths 1900 2100 NB. number of months found
|
||||
201
|
||||
(5&{. , '...' , _5&{.) find5wkdMonths 1900 2100 NB. First and last 5 months found
|
||||
Mar 1901
|
||||
Aug 1902
|
||||
May 1903
|
||||
Jan 1904
|
||||
Jul 1904
|
||||
...
|
||||
Mar 2097
|
||||
Aug 2098
|
||||
May 2099
|
||||
Jan 2100
|
||||
Oct 2100
|
||||
# (range -. {:"1@(_ ". find5wkdMonths)) 1900 2100 NB. number of years without 5 weekend months
|
||||
29
|
||||
Loading…
Add table
Add a link
Reference in a new issue