Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =========EASTER.BAT========
- @echo off
- set qbascmd=%1
- c:savedosqbasic /run L:savecdatabatcheaster.bas
- set qbascmd=
- ==========EASTER.BAS========
- s$ = ENVIRON$("QBASCMD")
- DEF fnddv (y, x) = INT(y / x)
- yr = VAL(s$)
- bb = fnddv(yr, 100): cc = yr MOD 100: aa = yr MOD 19
- dd = fnddv(bb, 4): ee = bb MOD 4
- gg = fnddv(8 * bb + 13, 25)
- hh = (19 * aa + bb - dd - gg + 15) MOD 30
- gm = fnddv(aa + 11 * hh, 319)
- ii = fnddv(cc, 4): kk = cc MOD 4
- gl = (2*ee+2*ii-kk-hh+gm+32) mod 7
- t1 = hh - gm + 18
- nn = fnddv(t1+71, 25)
- pp = (t1 + nn) mod 32
- print using "Easter Moon of #### is ##/##; yr, pp, nn
- t1 = hh - gm + gl + 19
- nn = fnddv(t1+71, 25)
- pp = (t1 + nn) mod 32
- print using "Easter Sunday of #### is ##/##"; yr, pp, nn,
- SYSTEM
- =======================================
- if A > 513 then md = A div 30 + 10 ; else md = A div 19
- solar year = 'mean tropical year'
- lunar year = 'mean tropical month' * 235/19
- // is MOD 120 // 7 = 1
- % is DIV 120 % 7 = 17
- austral = (360*year + 304 + cor(year)) // 570
- when austral < 513 /* lunae = date of full moon */
- then lunae = austral % 19 + 21
- else lunae = austral % 30 + 31
- easter = day(lunae + 8) % 7 * 7 /* 7 | day(sunday) */
- cor(year) is defined for calendar to calendar, as
- julian:
- cor(year) = 0
- gregorian: /* 43 epact shifts in 10,000 years */
- cor(year) = 19 * (year % 100 - year % 400 - (year % 100 * 8 + 13) % 25)
- binary: /* 7 epact shifts in 1536 years */
- cor(year) = 19 * ((year + 128) % 256 + year % 1536)
- c33a: /* 1 epact shift every 231 years */
- cor(year) = 19 * ((year + 165) % 231)
- elif: /* 1 golden jump every 363 years */
- cor(year) = 30 * ( year % 363)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement