home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: SHell self-extracting ARchive
(archive/shar).
You can browse this item here: yearlen.gth
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/329 Shell Archive Format
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/rfc822
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 53 75 62 6a 65 63 74 3a | 20 20 76 30 37 69 30 39 |Subject:| v07i09|
|00000010| 39 3a 20 20 43 6f 6d 70 | 75 74 65 20 6c 65 6e 67 |9: Comp|ute leng|
|00000020| 74 68 20 6f 66 20 61 6e | 79 20 79 65 61 72 0a 4e |th of an|y year.N|
|00000030| 65 77 73 67 72 6f 75 70 | 73 3a 20 6d 6f 64 2e 73 |ewsgroup|s: mod.s|
|00000040| 6f 75 72 63 65 73 0a 41 | 70 70 72 6f 76 65 64 3a |ources.A|pproved:|
|00000050| 20 6d 69 72 72 6f 72 21 | 72 73 0a 0a 53 75 62 6d | mirror!|rs..Subm|
|00000060| 69 74 74 65 64 20 62 79 | 3a 20 73 65 69 73 6d 6f |itted by|: seismo|
|00000070| 21 6e 62 69 72 65 73 21 | 76 69 61 6e 65 74 21 64 |!nbires!|vianet!d|
|00000080| 65 76 69 6e 65 0a 4d 6f | 64 2e 73 6f 75 72 63 65 |evine.Mo|d.source|
|00000090| 73 3a 20 56 6f 6c 75 6d | 65 20 37 2c 20 49 73 73 |s: Volum|e 7, Iss|
|000000a0| 75 65 20 39 39 0a 41 72 | 63 68 69 76 65 2d 6e 61 |ue 99.Ar|chive-na|
|000000b0| 6d 65 3a 20 79 65 61 72 | 6c 65 6e 67 74 68 0a 0a |me: year|length..|
|000000c0| 45 6e 63 6c 6f 73 65 64 | 20 69 73 20 61 20 63 6f |Enclosed| is a co|
|000000d0| 6c 6c 65 63 74 69 6f 6e | 20 6f 66 20 66 69 6c 65 |llection| of file|
|000000e0| 73 20 74 68 61 74 20 64 | 65 61 6c 20 77 69 74 68 |s that d|eal with|
|000000f0| 20 64 65 74 65 72 6d 69 | 6e 69 6e 67 20 74 68 65 | determi|ning the|
|00000100| 20 61 63 74 75 61 6c 0a | 6c 65 6e 67 74 68 20 6f | actual.|length o|
|00000110| 66 20 61 20 63 61 6c 65 | 6e 64 61 72 20 79 65 61 |f a cale|ndar yea|
|00000120| 72 20 66 6f 72 20 74 68 | 65 20 79 65 61 72 73 20 |r for th|e years |
|00000130| 31 20 74 68 72 6f 75 67 | 68 20 39 39 39 39 2e 20 |1 throug|h 9999. |
|00000140| 20 49 20 72 65 61 6c 69 | 7a 65 20 74 68 61 74 0a | I reali|ze that.|
|00000150| 74 68 65 20 70 72 6f 67 | 72 61 6d 20 69 73 20 73 |the prog|ram is s|
|00000160| 65 76 65 72 65 6c 79 20 | 6c 61 63 6b 69 6e 67 20 |everely |lacking |
|00000170| 69 6e 20 61 20 67 6f 6f | 64 20 6d 61 69 6e 28 29 |in a goo|d main()|
|00000180| 20 62 75 74 20 69 74 20 | 77 61 73 20 6f 6e 6c 79 | but it |was only|
|00000190| 20 74 68 65 72 65 0a 66 | 6f 72 20 74 68 65 20 74 | there.f|or the t|
|000001a0| 65 73 74 69 6e 67 2e 0a | 09 42 6f 62 20 44 65 76 |esting..|.Bob Dev|
|000001b0| 69 6e 65 0a 09 28 73 65 | 69 73 6d 6f 21 6e 62 69 |ine..(se|ismo!nbi|
|000001c0| 72 65 73 21 76 69 61 6e | 65 74 21 64 65 76 69 6e |res!vian|et!devin|
|000001d0| 65 29 0a 0a 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |e)..----|--------|
|000001e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000001f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 0a 23 21 20 2f 62 |--------|--.#! /b|
|00000200| 69 6e 2f 73 68 0a 23 20 | 54 68 69 73 20 69 73 20 |in/sh.# |This is |
|00000210| 61 20 73 68 65 6c 6c 20 | 61 72 63 68 69 76 65 2c |a shell |archive,|
|00000220| 20 6d 65 61 6e 69 6e 67 | 3a 0a 23 20 31 2e 20 20 | meaning|:.# 1. |
|00000230| 52 65 6d 6f 76 65 20 65 | 76 65 72 79 74 68 69 6e |Remove e|verythin|
|00000240| 67 20 61 62 6f 76 65 20 | 74 68 65 20 23 21 20 2f |g above |the #! /|
|00000250| 62 69 6e 2f 73 68 20 6c | 69 6e 65 2e 0a 23 20 32 |bin/sh l|ine..# 2|
|00000260| 2e 20 20 53 61 76 65 20 | 74 68 65 20 72 65 73 75 |. Save |the resu|
|00000270| 6c 74 69 6e 67 20 74 65 | 73 74 20 69 6e 20 61 20 |lting te|st in a |
|00000280| 66 69 6c 65 0a 23 20 33 | 2e 20 20 45 78 65 63 75 |file.# 3|. Execu|
|00000290| 74 65 20 74 68 65 20 66 | 69 6c 65 20 77 69 74 68 |te the f|ile with|
|000002a0| 20 2f 62 69 6e 2f 73 68 | 20 28 6e 6f 74 20 63 73 | /bin/sh| (not cs|
|000002b0| 68 29 20 74 6f 20 63 72 | 65 61 74 65 20 74 68 65 |h) to cr|eate the|
|000002c0| 20 66 69 6c 65 73 3a 0a | 23 0a 23 09 09 52 45 41 | files:.|#.#..REA|
|000002d0| 44 5f 4d 45 0a 23 09 09 | 4d 61 6b 65 66 69 6c 65 |D_ME.#..|Makefile|
|000002e0| 0a 23 09 09 6d 61 69 6e | 2e 63 0a 23 09 09 64 61 |.#..main|.c.#..da|
|000002f0| 79 73 2e 63 0a 23 09 09 | 65 61 72 6c 79 2e 63 0a |ys.c.#..|early.c.|
|00000300| 23 09 09 79 65 61 72 2e | 74 62 6c 0a 23 0a 23 20 |#..year.|tbl.#.# |
|00000310| 43 72 65 61 74 65 64 20 | 62 79 20 64 65 76 69 6e |Created |by devin|
|00000320| 65 20 28 42 6f 62 20 44 | 65 76 69 6e 65 29 20 6f |e (Bob D|evine) o|
|00000330| 6e 20 54 75 65 20 4e 6f | 76 20 31 31 20 32 30 3a |n Tue No|v 11 20:|
|00000340| 31 36 3a 32 36 20 4d 53 | 54 20 31 39 38 36 0a 23 |16:26 MS|T 1986.#|
|00000350| 0a 69 66 20 74 65 73 74 | 20 2d 66 20 27 52 45 41 |.if test| -f 'REA|
|00000360| 44 5f 4d 45 27 0a 74 68 | 65 6e 0a 09 65 63 68 6f |D_ME'.th|en..echo|
|00000370| 20 73 68 61 72 3a 20 77 | 69 6c 6c 20 6e 6f 74 20 | shar: w|ill not |
|00000380| 6f 76 65 72 2d 77 72 69 | 74 65 20 65 78 69 73 74 |over-wri|te exist|
|00000390| 69 6e 67 20 66 69 6c 65 | 20 22 27 52 45 41 44 5f |ing file| "'READ_|
|000003a0| 4d 45 27 22 0a 65 6c 73 | 65 0a 65 63 68 6f 20 65 |ME'".els|e.echo e|
|000003b0| 78 74 72 61 63 74 69 6e | 67 20 22 27 52 45 41 44 |xtractin|g "'READ|
|000003c0| 5f 4d 45 27 22 0a 73 65 | 64 20 27 73 2f 5e 58 2f |_ME'".se|d 's/^X/|
|000003d0| 2f 27 20 3e 52 45 41 44 | 5f 4d 45 20 3c 3c 27 53 |/' >READ|_ME <<'S|
|000003e0| 48 41 52 5f 45 4f 46 27 | 0a 58 0a 58 0a 58 20 20 |HAR_EOF'|.X.X.X |
|000003f0| 54 68 69 73 20 63 6f 6c | 6c 65 63 74 69 6f 6e 20 |This col|lection |
|00000400| 6f 66 20 66 75 6e 63 74 | 69 6f 6e 73 20 61 74 74 |of funct|ions att|
|00000410| 65 6d 70 74 73 20 74 6f | 20 70 72 6f 76 69 64 65 |empts to| provide|
|00000420| 20 74 68 65 20 6e 75 6d | 62 65 72 20 6f 66 0a 58 | the num|ber of.X|
|00000430| 64 61 79 73 20 69 6e 20 | 61 20 79 65 61 72 20 62 |days in |a year b|
|00000440| 61 73 65 64 20 75 70 6f | 6e 20 61 20 73 65 6c 65 |ased upo|n a sele|
|00000450| 63 74 65 64 20 79 65 61 | 72 20 61 6e 64 20 63 6f |cted yea|r and co|
|00000460| 75 6e 74 72 79 2e 20 20 | 49 74 20 69 73 0a 58 62 |untry. |It is.Xb|
|00000470| 65 69 6e 67 20 70 6f 73 | 74 65 64 20 62 65 63 61 |eing pos|ted beca|
|00000480| 75 73 65 20 6f 66 20 61 | 20 70 72 6f 6d 69 73 65 |use of a| promise|
|00000490| 20 49 20 6d 61 64 65 20 | 74 6f 20 74 68 65 20 72 | I made |to the r|
|000004a0| 65 61 64 65 72 73 20 6f | 66 20 6e 65 74 2e 6c 61 |eaders o|f net.la|
|000004b0| 6e 67 2e 63 2e 0a 58 0a | 58 20 20 54 68 65 72 65 |ng.c..X.|X There|
|000004c0| 20 61 72 65 20 62 61 73 | 69 63 61 6c 6c 79 20 74 | are bas|ically t|
|000004d0| 68 72 65 65 20 6c 65 76 | 65 6c 73 20 6f 66 20 74 |hree lev|els of t|
|000004e0| 68 61 74 20 63 61 6e 20 | 62 65 20 75 73 65 64 20 |hat can |be used |
|000004f0| 69 6e 20 74 6f 20 63 61 | 6c 63 75 6c 61 74 65 0a |in to ca|lculate.|
|00000500| 58 68 6f 77 20 6c 6f 6e | 67 20 61 20 79 65 61 72 |Xhow lon|g a year|
|00000510| 20 69 73 3a 0a 58 0a 58 | 20 20 20 20 31 2e 20 44 | is:.X.X| 1. D|
|00000520| 69 76 69 73 69 62 69 6c | 69 74 79 20 62 79 20 34 |ivisibil|ity by 4|
|00000530| 20 2d 2d 20 74 68 69 73 | 20 77 6f 72 6b 73 20 66 | -- this| works f|
|00000540| 6f 72 20 74 68 65 20 79 | 65 61 72 73 20 31 39 30 |or the y|ears 190|
|00000550| 31 2d 32 30 39 39 20 61 | 6e 64 2c 0a 58 20 20 20 |1-2099 a|nd,.X |
|00000560| 20 20 20 20 61 73 20 61 | 20 72 65 73 75 6c 74 2c | as a| result,|
|00000570| 20 69 73 20 73 75 69 74 | 61 62 6c 65 20 66 6f 72 | is suit|able for|
|00000580| 20 6e 65 61 72 6c 79 20 | 61 6c 6c 20 70 72 6f 67 | nearly |all prog|
|00000590| 72 61 6d 73 2e 20 20 49 | 74 20 63 61 6e 20 62 65 |rams. I|t can be|
|000005a0| 0a 58 20 20 20 20 20 20 | 20 63 6f 64 65 64 20 61 |.X | coded a|
|000005b0| 73 3a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |s: | |
|000005c0| 20 20 20 20 20 20 20 6f | 72 20 61 20 66 61 73 74 | o|r a fast|
|000005d0| 65 72 20 76 65 72 73 69 | 6f 6e 3a 0a 58 09 20 20 |er versi|on:.X. |
|000005e0| 20 0a 58 09 20 20 20 69 | 66 20 28 79 65 61 72 20 | .X. i|f (year |
|000005f0| 25 20 34 20 3d 3d 20 30 | 29 20 20 20 20 20 20 20 |% 4 == 0|) |
|00000600| 20 20 20 20 20 20 69 66 | 20 28 28 79 65 61 72 20 | if| ((year |
|00000610| 26 20 30 78 30 33 29 20 | 3d 3d 20 30 29 0a 58 09 |& 0x03) |== 0).X.|
|00000620| 20 20 20 20 20 20 20 64 | 61 79 73 5f 69 6e 5f 79 | d|ays_in_y|
|00000630| 65 61 72 20 3d 20 33 36 | 36 3b 20 20 20 20 20 20 |ear = 36|6; |
|00000640| 20 20 20 20 20 20 64 61 | 79 73 5f 69 6e 5f 79 65 | da|ys_in_ye|
|00000650| 61 72 20 3d 20 33 36 36 | 3b 0a 58 09 20 20 20 65 |ar = 366|;.X. e|
|00000660| 6c 73 65 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |lse | |
|00000670| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 65 6c | | el|
|00000680| 73 65 0a 58 09 20 20 20 | 20 20 20 20 64 61 79 73 |se.X. | days|
|00000690| 5f 69 6e 5f 79 65 61 72 | 20 3d 20 33 36 35 3b 20 |_in_year| = 365; |
|000006a0| 20 20 20 20 20 20 20 20 | 20 20 20 64 61 79 73 5f | | days_|
|000006b0| 69 6e 5f 79 65 61 72 20 | 3d 20 33 36 35 3b 0a 58 |in_year |= 365;.X|
|000006c0| 0a 58 0a 58 20 20 20 20 | 32 2e 20 47 72 65 67 6f |.X.X |2. Grego|
|000006d0| 72 69 61 6e 20 72 75 6c | 65 73 20 2d 2d 20 74 68 |rian rul|es -- th|
|000006e0| 69 73 20 77 6f 72 6b 73 | 20 66 72 6f 6d 20 74 68 |is works| from th|
|000006f0| 65 20 79 65 61 72 20 61 | 66 74 65 72 20 79 6f 75 |e year a|fter you|
|00000700| 72 20 63 6f 75 6e 74 72 | 79 0a 58 20 20 20 20 20 |r countr|y.X |
|00000710| 20 20 61 64 6f 70 74 65 | 64 20 74 68 65 20 47 72 | adopte|d the Gr|
|00000720| 65 67 6f 72 69 61 6e 20 | 63 61 6c 65 6e 64 61 72 |egorian |calendar|
|00000730| 20 74 68 72 6f 75 67 68 | 20 74 68 65 20 66 6f 72 | through| the for|
|00000740| 73 65 65 61 62 6c 65 20 | 66 75 74 75 72 65 2e 0a |seeable |future..|
|00000750| 58 20 20 20 20 20 20 20 | 49 74 20 63 61 6e 20 62 |X |It can b|
|00000760| 65 20 63 6f 64 65 64 20 | 61 73 3a 0a 58 0a 58 09 |e coded |as:.X.X.|
|00000770| 20 20 20 69 66 20 28 79 | 65 61 72 25 34 20 3d 3d | if (y|ear%4 ==|
|00000780| 20 30 20 26 26 20 79 65 | 61 72 25 31 30 30 20 21 | 0 && ye|ar%100 !|
|00000790| 3d 20 30 20 7c 7c 20 79 | 65 61 72 25 34 30 30 20 |= 0 || y|ear%400 |
|000007a0| 3d 3d 20 30 29 0a 58 09 | 20 20 20 20 20 20 20 64 |== 0).X.| d|
|000007b0| 61 79 73 5f 69 6e 5f 79 | 65 61 72 20 3d 20 33 36 |ays_in_y|ear = 36|
|000007c0| 36 3b 0a 58 09 20 20 20 | 65 6c 73 65 0a 58 09 20 |6;.X. |else.X. |
|000007d0| 20 20 20 20 20 20 64 61 | 79 73 5f 69 6e 5f 79 65 | da|ys_in_ye|
|000007e0| 61 72 20 3d 20 33 36 35 | 3b 0a 58 0a 58 20 20 20 |ar = 365|;.X.X |
|000007f0| 20 20 20 20 6f 72 20 73 | 6c 69 67 68 74 6c 79 20 | or s|lightly |
|00000800| 66 61 73 74 65 72 20 28 | 61 73 20 4b 61 72 6c 20 |faster (|as Karl |
|00000810| 48 65 75 65 72 20 73 75 | 67 67 65 73 74 65 64 20 |Heuer su|ggested |
|00000820| 74 6f 20 6d 65 20 76 69 | 61 20 6d 61 69 6c 29 3a |to me vi|a mail):|
|00000830| 0a 58 0a 58 09 20 20 20 | 69 66 20 28 28 79 65 61 |.X.X. |if ((yea|
|00000840| 72 25 34 20 3d 3d 20 30 | 29 20 26 26 20 28 79 65 |r%4 == 0|) && (ye|
|00000850| 61 72 25 31 30 30 20 21 | 3d 20 30 20 7c 7c 20 79 |ar%100 !|= 0 || y|
|00000860| 65 61 72 25 34 30 30 20 | 3d 3d 20 30 29 29 0a 58 |ear%400 |== 0)).X|
|00000870| 09 20 20 20 20 20 20 20 | 64 61 79 73 5f 69 6e 5f |. |days_in_|
|00000880| 79 65 61 72 20 3d 20 33 | 36 36 3b 0a 58 09 20 20 |year = 3|66;.X. |
|00000890| 20 65 6c 73 65 0a 58 09 | 20 20 20 20 20 20 20 64 | else.X.| d|
|000008a0| 61 79 73 5f 69 6e 5f 79 | 65 61 72 20 3d 20 33 36 |ays_in_y|ear = 36|
|000008b0| 35 3b 0a 58 0a 58 20 20 | 20 20 20 20 20 6f 72 20 |5;.X.X | or |
|000008c0| 28 64 65 70 65 6e 64 69 | 6e 67 20 6f 6e 20 68 6f |(dependi|ng on ho|
|000008d0| 77 20 74 68 65 20 72 65 | 6d 61 69 6e 64 65 72 20 |w the re|mainder |
|000008e0| 6f 70 65 72 61 74 6f 72 | 20 69 73 20 69 6d 70 6c |operator| is impl|
|000008f0| 65 6d 65 6e 74 65 64 29 | 0a 58 20 20 20 20 20 20 |emented)|.X |
|00000900| 20 74 68 69 73 20 69 73 | 20 75 70 20 74 6f 20 35 | this is| up to 5|
|00000910| 20 74 69 6d 65 73 20 66 | 61 73 74 65 72 20 62 79 | times f|aster by|
|00000920| 20 74 61 6b 69 6e 67 20 | 61 64 76 61 6e 74 61 67 | taking |advantag|
|00000930| 65 20 6f 66 20 73 6f 6d | 65 0a 58 20 20 20 20 20 |e of som|e.X |
|00000940| 20 20 63 6f 6d 6d 6f 6e | 20 66 61 63 74 6f 72 73 | common| factors|
|00000950| 20 6f 66 20 31 30 30 20 | 61 6e 64 20 34 30 30 3a | of 100 |and 400:|
|00000960| 0a 58 0a 58 09 20 20 20 | 72 65 67 69 73 74 65 72 |.X.X. |register|
|00000970| 20 69 6e 74 20 6e 64 69 | 76 31 30 30 3b 09 2f 2a | int ndi|v100;./*|
|00000980| 20 42 6f 6f 6c 65 61 6e | 20 66 6f 72 20 6e 6f 74 | Boolean| for not|
|00000990| 20 64 69 76 69 73 69 62 | 6c 65 20 62 79 20 31 30 | divisib|le by 10|
|000009a0| 30 20 2a 2f 0a 58 0a 58 | 09 20 20 20 69 66 20 28 |0 */.X.X|. if (|
|000009b0| 28 79 65 61 72 26 30 78 | 33 29 3d 3d 30 20 26 26 |(year&0x|3)==0 &&|
|000009c0| 20 28 6e 64 69 76 31 30 | 30 3d 79 65 61 72 25 31 | (ndiv10|0=year%1|
|000009d0| 30 30 29 20 7c 7c 20 28 | 79 65 61 72 26 30 78 46 |00) || (|year&0xF|
|000009e0| 29 3d 3d 30 20 26 26 20 | 21 6e 64 69 76 31 30 30 |)==0 && |!ndiv100|
|000009f0| 29 0a 58 09 20 20 20 20 | 20 20 20 64 61 79 73 5f |).X. | days_|
|00000a00| 69 6e 5f 79 65 61 72 20 | 3d 20 33 36 36 3b 0a 58 |in_year |= 366;.X|
|00000a10| 09 20 20 20 65 6c 73 65 | 0a 58 09 20 20 20 20 20 |. else|.X. |
|00000a20| 20 20 64 61 79 73 5f 69 | 6e 5f 79 65 61 72 20 3d | days_i|n_year =|
|00000a30| 20 33 36 35 3b 0a 58 0a | 58 20 20 20 20 20 20 20 | 365;.X.|X |
|00000a40| 6f 72 20 65 76 65 6e 20 | 66 61 73 74 65 72 20 62 |or even |faster b|
|00000a50| 79 20 75 73 69 6e 67 20 | 4b 61 72 6c 20 48 65 75 |y using |Karl Heu|
|00000a60| 65 72 27 73 20 73 75 67 | 67 65 73 74 69 6f 6e 20 |er's sug|gestion |
|00000a70| 6f 66 20 72 65 6f 72 64 | 65 72 69 6e 67 0a 58 20 |of reord|ering.X |
|00000a80| 20 20 20 20 20 20 74 68 | 65 20 65 78 70 72 65 73 | th|e expres|
|00000a90| 73 69 6f 6e 3a 0a 58 0a | 58 09 20 20 20 69 66 20 |sion:.X.|X. if |
|00000aa0| 28 28 79 65 61 72 26 30 | 78 33 29 3d 3d 30 20 26 |((year&0|x3)==0 &|
|00000ab0| 26 20 28 28 79 65 61 72 | 26 30 78 46 29 3d 3d 30 |& ((year|&0xF)==0|
|00000ac0| 20 7c 7c 20 79 65 61 72 | 25 31 30 30 21 3d 30 29 | || year|%100!=0)|
|00000ad0| 29 0a 58 09 20 20 20 20 | 20 20 20 64 61 79 73 5f |).X. | days_|
|00000ae0| 69 6e 5f 79 65 61 72 20 | 3d 20 33 36 36 3b 0a 58 |in_year |= 366;.X|
|00000af0| 09 20 20 20 65 6c 73 65 | 0a 58 09 20 20 20 20 20 |. else|.X. |
|00000b00| 20 20 64 61 79 73 5f 69 | 6e 5f 79 65 61 72 20 3d | days_i|n_year =|
|00000b10| 20 33 36 35 3b 0a 58 0a | 58 20 20 20 20 20 20 20 | 365;.X.|X |
|00000b20| 49 20 62 65 6c 69 65 76 | 65 20 74 68 61 74 20 74 |I believ|e that t|
|00000b30| 68 69 73 20 69 73 20 74 | 68 65 20 66 61 73 74 65 |his is t|he faste|
|00000b40| 73 74 20 70 6f 73 73 69 | 62 6c 65 20 63 68 65 63 |st possi|ble chec|
|00000b50| 6b 20 66 6f 72 20 6c 65 | 61 70 20 79 65 61 72 73 |k for le|ap years|
|00000b60| 2e 0a 58 20 20 20 20 20 | 20 20 44 6f 65 73 20 61 |..X | Does a|
|00000b70| 6e 79 6f 6e 65 20 6b 6e | 6f 77 20 6f 66 20 61 20 |nyone kn|ow of a |
|00000b80| 66 61 73 74 20 63 68 65 | 63 6b 20 66 6f 72 20 72 |fast che|ck for r|
|00000b90| 65 6d 61 69 6e 64 65 72 | 73 20 73 6f 20 74 68 61 |emainder|s so tha|
|00000ba0| 74 20 74 68 65 20 22 25 | 20 31 30 30 22 0a 58 20 |t the "%| 100".X |
|00000bb0| 20 20 20 20 20 20 74 65 | 73 74 20 63 61 6e 20 62 | te|st can b|
|00000bc0| 65 20 73 70 65 65 64 65 | 64 20 75 70 3f 0a 58 0a |e speede|d up?.X.|
|00000bd0| 58 20 20 20 20 33 2e 20 | 43 6f 75 6e 74 72 79 2d |X 3. |Country-|
|00000be0| 64 65 70 65 6e 64 65 6e | 74 20 72 75 6c 65 73 20 |dependen|t rules |
|00000bf0| 2d 2d 20 20 77 68 69 63 | 68 20 69 73 20 77 68 61 |-- whic|h is wha|
|00000c00| 74 20 74 68 69 73 20 63 | 6f 6c 6c 65 63 74 69 6f |t this c|ollectio|
|00000c10| 6e 20 6f 66 0a 58 20 20 | 20 20 20 20 20 66 75 6e |n of.X | fun|
|00000c20| 63 74 69 6f 6e 73 20 61 | 74 74 65 6d 70 74 20 74 |ctions a|ttempt t|
|00000c30| 6f 20 64 6f 2e 20 20 49 | 74 20 67 65 74 73 20 6d |o do. I|t gets m|
|00000c40| 65 73 73 79 2e 0a 58 0a | 58 0a 58 0a 58 42 41 43 |essy..X.|X.X.XBAC|
|00000c50| 4b 47 52 4f 55 4e 44 20 | 49 4e 46 4f 52 4d 41 54 |KGROUND |INFORMAT|
|00000c60| 49 4f 4e 20 4f 46 20 43 | 4f 55 4e 54 52 59 2d 44 |ION OF C|OUNTRY-D|
|00000c70| 45 50 45 4e 44 45 4e 54 | 20 52 55 4c 45 53 0a 58 |EPENDENT| RULES.X|
|00000c80| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000c90| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000ca0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000cb0| 2d 0a 58 0a 58 20 20 57 | 68 65 6e 20 64 65 61 6c |-.X.X W|hen deal|
|00000cc0| 69 6e 67 20 77 69 74 68 | 20 63 61 6c 65 6e 64 61 |ing with| calenda|
|00000cd0| 72 73 20 62 61 73 65 64 | 20 6f 6e 20 64 69 66 66 |rs based| on diff|
|00000ce0| 65 72 65 6e 74 20 65 70 | 6f 63 68 73 20 28 65 2e |erent ep|ochs (e.|
|00000cf0| 67 2e 2c 20 45 67 79 70 | 74 69 61 6e 2c 0a 58 52 |g., Egyp|tian,.XR|
|00000d00| 6f 6d 61 6e 20 52 65 70 | 75 62 6c 69 63 61 6e 2c |oman Rep|ublican,|
|00000d10| 20 4a 75 6c 69 61 6e 2c | 20 41 75 67 75 73 74 61 | Julian,| Augusta|
|00000d20| 6e 2c 20 43 68 72 69 73 | 74 69 61 6e 2f 47 72 65 |n, Chris|tian/Gre|
|00000d30| 67 6f 72 69 61 6e 2c 20 | 4a 65 77 69 73 68 2c 20 |gorian, |Jewish, |
|00000d40| 4d 75 73 6c 69 6d 2c 0a | 58 43 68 69 6e 65 73 65 |Muslim,.|XChinese|
|00000d50| 2c 20 4d 61 79 61 6e 2c | 20 4a 61 70 61 6e 65 73 |, Mayan,| Japanes|
|00000d60| 65 29 20 69 74 20 69 73 | 20 65 61 73 69 65 72 20 |e) it is| easier |
|00000d70| 74 6f 20 63 6f 6e 76 65 | 72 74 20 64 61 74 65 73 |to conve|rt dates|
|00000d80| 20 69 6e 74 6f 20 61 20 | 73 63 68 65 6d 65 20 74 | into a |scheme t|
|00000d90| 68 61 74 0a 58 68 61 73 | 20 61 20 73 74 61 72 74 |hat.Xhas| a start|
|00000da0| 69 6e 67 20 64 61 74 65 | 20 6f 6c 64 65 72 20 74 |ing date| older t|
|00000db0| 68 61 6e 20 74 68 61 74 | 20 6f 66 20 61 6e 79 20 |han that| of any |
|00000dc0| 6f 66 20 74 68 65 20 65 | 70 6f 63 68 73 2e 20 20 |of the e|pochs. |
|00000dd0| 53 75 63 68 20 61 20 73 | 63 68 65 6d 65 0a 58 77 |Such a s|cheme.Xw|
|00000de0| 61 73 20 69 6e 76 65 6e | 74 65 64 20 62 79 20 4a |as inven|ted by J|
|00000df0| 2e 20 53 63 61 6c 69 6e | 67 65 72 20 69 6e 20 31 |. Scalin|ger in 1|
|00000e00| 35 38 33 2e 20 20 0a 58 | 0a 58 20 20 48 6f 77 65 |583. .X|.X Howe|
|00000e10| 76 65 72 2c 20 61 6c 6c | 20 79 65 61 72 73 20 61 |ver, all| years a|
|00000e20| 73 20 75 73 65 64 20 62 | 79 20 74 68 69 73 20 70 |s used b|y this p|
|00000e30| 61 63 6b 61 67 65 20 61 | 72 65 20 74 68 6f 73 65 |ackage a|re those|
|00000e40| 20 6f 66 20 74 68 65 20 | 43 68 72 69 73 74 69 61 | of the |Christia|
|00000e50| 6e 0a 58 65 72 61 20 62 | 65 63 61 75 73 65 20 74 |n.Xera b|ecause t|
|00000e60| 68 61 74 20 69 73 20 74 | 68 65 20 6d 6f 73 74 20 |hat is t|he most |
|00000e70| 63 6f 6d 6d 6f 6e 20 72 | 65 70 72 65 73 65 6e 74 |common r|epresent|
|00000e80| 61 74 69 6f 6e 20 75 73 | 65 64 20 74 68 72 6f 75 |ation us|ed throu|
|00000e90| 67 68 6f 75 74 20 74 68 | 65 0a 58 77 6f 72 6c 64 |ghout th|e.Xworld|
|00000ea0| 2e 20 20 56 61 6c 69 64 | 20 79 65 61 72 73 20 61 |. Valid| years a|
|00000eb0| 72 65 20 31 41 44 20 74 | 68 72 6f 75 67 68 20 39 |re 1AD t|hrough 9|
|00000ec0| 39 39 39 41 44 2e 20 20 | 20 54 68 65 72 65 20 69 |999AD. | There i|
|00000ed0| 73 20 6e 6f 20 79 65 61 | 72 20 30 2e 20 20 4e 65 |s no yea|r 0. Ne|
|00000ee0| 67 61 74 69 76 65 0a 58 | 79 65 61 72 73 20 28 74 |gative.X|years (t|
|00000ef0| 68 6f 73 65 20 42 43 29 | 20 61 72 65 20 6e 6f 74 |hose BC)| are not|
|00000f00| 20 75 73 65 64 20 69 6e | 20 74 68 69 73 20 70 72 | used in| this pr|
|00000f10| 6f 67 72 61 6d 20 62 65 | 63 61 75 73 65 20 74 68 |ogram be|cause th|
|00000f20| 65 20 4a 75 6c 69 61 6e | 20 63 61 6c 65 6e 64 61 |e Julian| calenda|
|00000f30| 72 0a 58 77 61 73 20 73 | 74 69 6c 6c 20 62 65 69 |r.Xwas s|till bei|
|00000f40| 6e 67 20 63 68 61 6e 67 | 65 64 20 62 79 20 41 75 |ng chang|ed by Au|
|00000f50| 67 75 73 74 75 73 20 69 | 6e 20 38 42 43 20 28 72 |gustus i|n 8BC (r|
|00000f60| 65 6e 61 6d 65 64 20 74 | 68 65 20 6d 6f 6e 74 68 |enamed t|he month|
|00000f70| 20 53 65 78 74 69 6c 75 | 73 0a 58 74 6f 20 41 75 | Sextilu|s.Xto Au|
|00000f80| 67 75 73 74 20 61 6e 64 | 20 63 68 61 6e 67 65 64 |gust and| changed|
|00000f90| 20 74 68 65 20 6e 75 6d | 62 65 72 20 6f 66 20 64 | the num|ber of d|
|00000fa0| 61 79 73 20 69 6e 20 73 | 65 76 65 72 61 6c 20 6d |ays in s|everal m|
|00000fb0| 6f 6e 74 68 73 29 2e 0a | 58 0a 58 20 20 54 68 65 |onths)..|X.X The|
|00000fc0| 20 61 72 67 75 6d 65 6e | 74 20 6d 61 79 20 62 65 | argumen|t may be|
|00000fd0| 20 6d 61 64 65 20 74 68 | 61 74 20 67 6f 69 6e 67 | made th|at going|
|00000fe0| 20 74 6f 20 79 65 61 72 | 73 20 62 65 66 6f 72 65 | to year|s before|
|00000ff0| 20 74 68 65 20 34 74 68 | 20 43 65 6e 74 75 72 79 | the 4th| Century|
|00001000| 20 41 44 0a 58 69 73 20 | 66 72 75 69 74 6c 65 73 | AD.Xis |fruitles|
|00001010| 73 2e 20 20 49 74 20 69 | 73 20 61 62 6f 75 74 20 |s. It i|s about |
|00001020| 74 68 61 74 20 74 69 6d | 65 20 74 68 61 74 20 74 |that tim|e that t|
|00001030| 68 65 20 45 6d 70 65 72 | 6f 72 20 43 6f 6e 73 74 |he Emper|or Const|
|00001040| 61 6e 74 69 6e 65 20 28 | 68 65 20 68 61 64 0a 58 |antine (|he had.X|
|00001050| 70 72 65 76 69 6f 75 73 | 6c 79 20 63 6f 6e 76 65 |previous|ly conve|
|00001060| 72 74 65 64 20 74 6f 20 | 43 68 72 69 73 74 69 61 |rted to |Christia|
|00001070| 6e 69 74 79 29 20 6d 61 | 64 65 20 74 68 65 20 37 |nity) ma|de the 7|
|00001080| 20 64 61 79 20 77 65 65 | 6b 20 6f 66 66 69 63 69 | day wee|k offici|
|00001090| 61 6c 0a 58 74 68 72 6f | 75 67 68 6f 75 74 20 74 |al.Xthro|ughout t|
|000010a0| 68 65 20 52 6f 6d 61 6e | 20 45 6d 70 69 72 65 2e |he Roman| Empire.|
|000010b0| 20 20 54 68 65 20 43 65 | 6c 74 69 63 20 63 61 6c | The Ce|ltic cal|
|000010c0| 65 6e 64 61 72 20 68 61 | 64 20 38 20 64 61 79 73 |endar ha|d 8 days|
|000010d0| 20 62 75 74 20 74 68 65 | 0a 58 63 61 6c 65 6e 64 | but the|.Xcalend|
|000010e0| 61 72 20 4d 6f 73 65 73 | 20 74 6f 6f 6b 20 77 69 |ar Moses| took wi|
|000010f0| 74 68 20 68 69 6d 20 66 | 72 6f 6d 20 45 67 79 70 |th him f|rom Egyp|
|00001100| 74 20 68 61 64 20 37 2e | 20 20 49 74 27 73 20 66 |t had 7.| It's f|
|00001110| 61 73 63 69 6e 61 74 69 | 6e 67 20 68 6f 77 0a 58 |ascinati|ng how.X|
|00001120| 63 61 6c 65 6e 64 61 72 | 73 20 74 69 65 20 69 6e |calendar|s tie in|
|00001130| 20 77 69 74 68 20 68 69 | 73 74 6f 72 79 2e 20 20 | with hi|story. |
|00001140| 48 61 64 20 74 68 65 20 | 4e 61 7a 69 73 20 77 6f |Had the |Nazis wo|
|00001150| 6e 20 57 57 32 2c 20 77 | 65 20 6e 6f 77 20 6d 69 |n WW2, w|e now mi|
|00001160| 67 68 74 20 68 61 76 65 | 0a 58 61 20 63 61 6c 65 |ght have|.Xa cale|
|00001170| 6e 64 61 72 20 62 61 73 | 65 64 20 6f 6e 20 74 68 |ndar bas|ed on th|
|00001180| 65 20 62 69 72 74 68 20 | 6f 66 20 48 69 74 6c 65 |e birth |of Hitle|
|00001190| 72 21 20 20 41 6e 64 20 | 69 74 20 77 61 73 20 61 |r! And |it was a|
|000011a0| 62 6f 75 74 20 74 68 61 | 74 20 74 69 6d 65 20 74 |bout tha|t time t|
|000011b0| 68 61 74 0a 58 74 68 65 | 20 79 65 61 72 20 6f 66 |hat.Xthe| year of|
|000011c0| 20 43 68 72 69 73 74 27 | 73 20 62 69 72 74 68 2c | Christ'|s birth,|
|000011d0| 20 69 6e 73 74 65 61 64 | 20 6f 66 20 74 68 65 20 | instead| of the |
|000011e0| 73 74 61 72 74 20 6f 66 | 20 43 69 74 79 20 6f 66 |start of| City of|
|000011f0| 20 52 6f 6d 65 2c 20 77 | 61 73 0a 58 73 75 67 67 | Rome, w|as.Xsugg|
|00001200| 65 73 74 65 64 20 61 73 | 20 74 68 65 20 62 61 73 |ested as| the bas|
|00001210| 69 73 20 66 6f 72 20 63 | 6f 75 6e 74 69 6e 67 20 |is for c|ounting |
|00001220| 79 65 61 72 73 2e 0a 58 | 0a 58 20 20 49 74 20 69 |years..X|.X It i|
|00001230| 73 20 6e 6f 74 20 70 6f | 73 73 69 62 6c 65 20 74 |s not po|ssible t|
|00001240| 6f 20 67 75 61 72 65 6e | 74 65 65 20 74 68 65 20 |o guaren|tee the |
|00001250| 61 63 63 75 72 61 63 79 | 20 66 6f 72 20 76 65 72 |accuracy| for ver|
|00001260| 79 20 65 61 72 6c 79 20 | 64 61 74 65 73 2e 20 20 |y early |dates. |
|00001270| 0a 58 54 68 65 20 72 65 | 66 65 72 65 6e 63 65 73 |.XThe re|ferences|
|00001280| 20 74 68 61 74 20 49 20 | 63 6f 6e 73 75 6c 74 65 | that I |consulte|
|00001290| 64 20 6f 63 63 61 73 69 | 6f 6e 61 6c 6c 79 20 77 |d occasi|onally w|
|000012a0| 6f 75 6c 64 20 64 69 73 | 61 67 72 65 65 20 6f 6e |ould dis|agree on|
|000012b0| 20 64 61 74 65 73 2e 0a | 58 54 68 65 72 65 20 61 | dates..|XThere a|
|000012c0| 72 65 20 6d 61 6e 79 20 | 64 69 66 66 69 63 75 6c |re many |difficul|
|000012d0| 74 69 65 73 20 69 6e 20 | 61 72 72 69 76 69 6e 67 |ties in |arriving|
|000012e0| 20 61 74 20 61 20 64 65 | 66 69 6e 69 74 69 76 65 | at a de|finitive|
|000012f0| 20 61 6e 73 77 65 72 20 | 66 6f 72 0a 58 61 20 72 | answer |for.Xa r|
|00001300| 65 67 69 6f 6e 27 73 20 | 63 61 6c 65 6e 64 61 72 |egion's |calendar|
|00001310| 20 62 65 63 61 75 73 65 | 20 6f 66 20 6e 61 74 69 | because| of nati|
|00001320| 6f 6e 61 6c 20 61 6e 64 | 20 73 75 70 65 72 6e 61 |onal and| superna|
|00001330| 74 69 6f 6e 61 6c 20 69 | 6e 66 6c 75 65 6e 63 65 |tional i|nfluence|
|00001340| 73 2e 0a 58 53 6f 6d 65 | 20 6f 66 20 74 68 65 73 |s..XSome| of thes|
|00001350| 65 20 61 72 65 3a 20 77 | 61 72 73 20 74 68 61 74 |e are: w|ars that|
|00001360| 20 63 68 61 6e 67 65 20 | 62 6f 75 6e 64 61 72 69 | change |boundari|
|00001370| 65 73 3b 20 63 6f 75 6e | 74 72 79 2d 64 77 65 6c |es; coun|try-dwel|
|00001380| 6c 65 72 73 0a 58 72 65 | 73 69 73 74 61 6e 63 65 |lers.Xre|sistance|
|00001390| 20 74 6f 20 74 68 65 20 | 63 61 6c 65 6e 64 61 72 | to the |calendar|
|000013a0| 20 63 68 61 6e 67 65 20 | 77 72 6f 75 67 68 74 20 | change |wrought |
|000013b0| 62 79 20 74 68 65 20 63 | 69 74 79 2d 62 61 73 65 |by the c|ity-base|
|000013c0| 64 20 67 6f 76 65 72 6e | 6d 65 6e 74 3b 0a 58 61 |d govern|ment;.Xa|
|000013d0| 6e 64 20 72 65 6c 69 67 | 6f 75 73 20 64 69 66 66 |nd relig|ous diff|
|000013e0| 65 72 65 6e 63 65 73 20 | 6f 76 65 72 20 77 68 61 |erences |over wha|
|000013f0| 74 20 69 73 20 74 68 65 | 20 22 72 69 67 68 74 22 |t is the| "right"|
|00001400| 20 63 61 6c 65 6e 64 61 | 72 2e 20 20 4d 61 6e 79 | calenda|r. Many|
|00001410| 0a 58 50 72 6f 74 65 73 | 74 61 6e 74 73 20 63 68 |.XProtes|tants ch|
|00001420| 6f 73 65 20 74 6f 20 62 | 65 20 22 77 72 6f 6e 67 |ose to b|e "wrong|
|00001430| 20 77 69 74 68 20 74 68 | 65 20 63 61 6c 65 6e 64 | with th|e calend|
|00001440| 61 72 20 72 61 74 68 65 | 72 20 74 68 61 6e 20 72 |ar rathe|r than r|
|00001450| 69 67 68 74 20 77 69 74 | 68 0a 58 74 68 65 20 50 |ight wit|h.Xthe P|
|00001460| 6f 70 65 22 2e 20 20 46 | 6f 72 20 65 78 61 6d 70 |ope". F|or examp|
|00001470| 6c 65 73 20 6f 66 20 73 | 75 63 68 20 74 75 72 6d |les of s|uch turm|
|00001480| 6f 69 6c 20 73 65 65 20 | 61 6e 79 20 6f 66 20 74 |oil see |any of t|
|00001490| 68 65 20 2a 5f 65 61 72 | 6c 79 28 29 20 66 75 6e |he *_ear|ly() fun|
|000014a0| 63 74 69 6f 6e 73 2e 0a | 58 0a 58 20 20 41 6e 20 |ctions..|X.X An |
|000014b0| 61 73 73 75 6d 70 74 69 | 6f 6e 20 74 68 61 74 20 |assumpti|on that |
|000014c0| 49 20 75 73 65 64 20 74 | 6f 20 64 65 63 69 64 65 |I used t|o decide|
|000014d0| 20 77 68 65 6e 20 61 20 | 63 6f 75 6e 74 72 79 20 | when a |country |
|000014e0| 73 68 6f 75 6c 64 20 62 | 65 20 70 75 74 0a 58 69 |should b|e put.Xi|
|000014f0| 6e 20 74 68 65 20 73 77 | 69 74 63 68 65 64 2d 74 |n the sw|itched-t|
|00001500| 6f 2d 47 72 65 67 6f 72 | 69 61 6e 20 63 61 6c 65 |o-Gregor|ian cale|
|00001510| 6e 64 61 72 20 6c 69 73 | 74 2c 20 69 66 20 49 20 |ndar lis|t, if I |
|00001520| 63 6f 75 6c 64 20 6e 6f | 74 20 66 69 6e 64 20 61 |could no|t find a|
|00001530| 0a 58 63 6c 65 61 72 20 | 64 61 74 65 2c 20 77 61 |.Xclear |date, wa|
|00001540| 73 20 74 6f 20 74 61 6b | 65 20 74 68 65 20 73 77 |s to tak|e the sw|
|00001550| 69 74 63 68 20 6f 76 65 | 72 20 64 61 74 65 20 6f |itch ove|r date o|
|00001560| 66 20 69 74 73 20 72 75 | 6c 69 6e 67 20 63 6f 75 |f its ru|ling cou|
|00001570| 6e 74 72 79 2e 0a 58 41 | 6c 6c 20 6f 66 20 74 68 |ntry..XA|ll of th|
|00001580| 65 20 53 6f 75 74 68 20 | 41 6d 65 72 69 63 61 6e |e South |American|
|00001590| 20 63 6f 75 6e 74 72 69 | 65 73 20 75 73 65 20 53 | countri|es use S|
|000015a0| 70 61 69 6e 27 73 20 64 | 61 74 65 20 65 76 65 6e |pain's d|ate even|
|000015b0| 20 74 68 6f 75 67 68 0a | 58 74 68 65 20 72 65 61 | though.|Xthe rea|
|000015c0| 6c 69 74 79 20 6f 66 20 | 77 68 65 6e 20 63 6f 75 |lity of |when cou|
|000015d0| 6e 74 72 69 65 73 20 61 | 63 74 75 61 6c 6c 79 20 |ntries a|ctually |
|000015e0| 63 68 61 6e 67 65 64 20 | 69 73 20 6d 75 63 68 20 |changed |is much |
|000015f0| 6d 6f 72 65 20 63 6f 6d | 70 6c 65 78 2e 0a 58 54 |more com|plex..XT|
|00001600| 68 65 20 6d 61 6e 79 20 | 42 72 69 74 69 73 68 20 |he many |British |
|00001610| 63 6f 6c 6f 6e 69 65 73 | 20 75 73 65 20 74 68 65 |colonies| use the|
|00001620| 20 73 61 6d 65 20 79 65 | 61 72 20 61 73 20 47 72 | same ye|ar as Gr|
|00001630| 65 61 74 20 42 72 69 74 | 61 69 6e 2c 20 31 37 35 |eat Brit|ain, 175|
|00001640| 32 2e 0a 58 53 65 65 20 | 63 61 6e 61 64 61 5f 65 |2..XSee |canada_e|
|00001650| 61 72 6c 79 28 29 20 66 | 6f 72 20 61 20 74 68 65 |arly() f|or a the|
|00001660| 20 74 79 70 65 20 6f 66 | 20 74 72 6f 75 62 6c 65 | type of| trouble|
|00001670| 20 63 61 75 73 65 64 20 | 62 79 20 74 77 6f 20 64 | caused |by two d|
|00001680| 6f 6d 69 6e 61 6e 74 0a | 58 63 6f 75 6e 74 72 69 |ominant.|Xcountri|
|00001690| 65 73 3a 20 42 72 69 74 | 61 69 6e 20 61 6e 64 20 |es: Brit|ain and |
|000016a0| 46 72 61 6e 63 65 2e 20 | 20 53 6f 2c 20 61 20 70 |France. | So, a p|
|000016b0| 6c 65 61 20 74 6f 20 74 | 68 6f 73 65 20 6f 75 74 |lea to t|hose out|
|000016c0| 20 74 68 65 72 65 20 74 | 68 61 74 0a 58 77 61 6e | there t|hat.Xwan|
|000016d0| 74 20 74 6f 20 72 75 6c | 65 20 74 68 65 20 77 6f |t to rul|e the wo|
|000016e0| 72 6c 64 3a 20 57 68 65 | 6e 20 79 6f 75 20 64 6f |rld: Whe|n you do|
|000016f0| 20 74 61 6b 65 20 6f 76 | 65 72 2c 20 73 65 65 20 | take ov|er, see |
|00001700| 74 6f 20 74 68 61 74 20 | 74 68 65 20 72 75 6c 65 |to that |the rule|
|00001710| 73 0a 58 61 72 65 20 6f | 62 73 65 72 76 65 64 20 |s.Xare o|bserved |
|00001720| 63 6f 6e 73 69 73 74 65 | 6e 74 6c 79 21 20 20 49 |consiste|ntly! I|
|00001730| 74 20 6d 61 6b 65 73 20 | 65 76 65 72 79 74 68 69 |t makes |everythi|
|00001740| 6e 67 20 6d 75 63 68 20 | 65 61 73 69 65 72 20 3a |ng much |easier :|
|00001750| 2d 29 0a 58 0a 58 20 20 | 53 6f 6d 65 20 63 6f 75 |-).X.X |Some cou|
|00001760| 6e 74 72 69 65 73 20 64 | 69 64 20 6e 6f 74 20 74 |ntries d|id not t|
|00001770| 72 61 6e 73 69 73 74 69 | 6f 6e 20 64 69 72 65 63 |ransisti|on direc|
|00001780| 74 6c 79 20 66 72 6f 6d | 20 74 68 65 20 4a 75 6c |tly from| the Jul|
|00001790| 69 61 6e 20 74 6f 20 74 | 68 65 0a 58 47 72 65 67 |ian to t|he.XGreg|
|000017a0| 6f 72 69 61 6e 20 63 61 | 6c 65 6e 64 61 72 2e 20 |orian ca|lendar. |
|000017b0| 20 41 6e 20 61 6c 74 65 | 72 6e 61 74 65 20 63 61 | An alte|rnate ca|
|000017c0| 6c 65 6e 64 61 72 20 77 | 61 73 20 74 72 69 65 64 |lendar w|as tried|
|000017d0| 20 6f 72 20 74 68 65 20 | 63 61 6c 65 6e 64 61 72 | or the |calendar|
|000017e0| 0a 58 77 61 73 20 6d 6f | 64 69 66 69 65 64 20 6f |.Xwas mo|dified o|
|000017f0| 6e 6c 79 20 73 6c 69 67 | 68 74 6c 79 2e 20 20 53 |nly slig|htly. S|
|00001800| 65 65 20 74 68 65 20 66 | 72 61 6e 63 65 5f 65 61 |ee the f|rance_ea|
|00001810| 72 6c 79 28 29 2c 20 73 | 77 65 64 65 6e 5f 65 61 |rly(), s|weden_ea|
|00001820| 72 6c 79 28 29 2c 0a 58 | 61 6e 64 20 75 73 73 72 |rly(),.X|and ussr|
|00001830| 5f 65 61 72 6c 79 28 29 | 20 66 75 6e 63 74 69 6f |_early()| functio|
|00001840| 6e 73 2e 0a 58 0a 58 20 | 20 53 6f 6d 65 20 6f 66 |ns..X.X | Some of|
|00001850| 20 74 68 65 20 64 61 74 | 65 2f 63 6f 75 6e 74 72 | the dat|e/countr|
|00001860| 79 20 70 61 69 72 73 20 | 61 72 65 20 68 69 73 74 |y pairs |are hist|
|00001870| 6f 72 69 63 61 6c 6c 79 | 20 6e 61 69 76 65 2e 20 |orically| naive. |
|00001880| 20 42 79 20 61 6c 6c 0a | 58 72 69 67 68 74 73 2c | By all.|Xrights,|
|00001890| 20 49 73 72 61 65 6c 69 | 20 64 61 74 65 73 20 73 | Israeli| dates s|
|000018a0| 68 6f 75 6c 64 20 6e 6f | 74 20 65 78 69 73 74 20 |hould no|t exist |
|000018b0| 62 65 66 6f 72 65 20 31 | 39 34 38 2e 20 20 48 6f |before 1|948. Ho|
|000018c0| 77 65 76 65 72 20 62 65 | 63 61 75 73 65 0a 58 74 |wever be|cause.Xt|
|000018d0| 68 65 20 63 6f 75 6e 74 | 72 79 20 6f 66 20 50 61 |he count|ry of Pa|
|000018e0| 6c 65 73 74 69 6e 65 20 | 77 61 73 20 66 6f 6c 6c |lestine |was foll|
|000018f0| 6f 77 69 6e 67 20 74 68 | 65 20 73 61 6d 65 20 79 |owing th|e same y|
|00001900| 65 61 72 20 72 75 6c 65 | 73 20 70 72 69 6f 72 20 |ear rule|s prior |
|00001910| 74 6f 0a 58 31 39 34 38 | 2c 20 49 20 61 6c 6c 6f |to.X1948|, I allo|
|00001920| 77 65 64 20 69 74 2e 20 | 20 4d 61 6e 79 2c 20 6d |wed it. | Many, m|
|00001930| 61 6e 79 20 73 75 63 68 | 20 61 72 67 75 6d 65 6e |any such| argumen|
|00001940| 74 73 20 63 61 6e 20 62 | 65 20 6d 61 64 65 20 28 |ts can b|e made (|
|00001950| 65 2e 67 2e 2c 20 68 6f | 77 0a 58 74 6f 20 68 61 |e.g., ho|w.Xto ha|
|00001960| 6e 64 6c 65 20 64 61 74 | 65 73 20 69 6e 20 79 65 |ndle dat|es in ye|
|00001970| 61 72 73 20 62 65 66 6f | 72 65 20 74 68 65 20 55 |ars befo|re the U|
|00001980| 53 41 20 67 61 69 6e 65 | 64 20 69 6e 64 65 70 65 |SA gaine|d indepe|
|00001990| 6e 64 65 6e 63 65 20 6f | 72 20 65 76 65 6e 0a 58 |ndence o|r even.X|
|000019a0| 62 65 66 6f 72 65 20 69 | 74 20 77 61 73 20 22 64 |before i|t was "d|
|000019b0| 69 73 63 6f 76 65 72 65 | 64 22 20 62 79 20 43 6f |iscovere|d" by Co|
|000019c0| 6c 75 6d 62 75 73 2f 73 | 74 72 61 79 20 56 69 6b |lumbus/s|tray Vik|
|000019d0| 69 6e 67 73 2f 41 6e 61 | 73 61 7a 69 20 49 6e 64 |ings/Ana|sazi Ind|
|000019e0| 69 61 6e 73 2e 0a 58 43 | 68 61 6e 67 65 20 74 68 |ians..XC|hange th|
|000019f0| 65 20 64 61 74 65 73 20 | 74 6f 20 6d 61 6b 65 20 |e dates |to make |
|00001a00| 79 6f 75 72 73 65 6c 66 | 20 68 61 70 70 79 2e 0a |yourself| happy..|
|00001a10| 58 0a 58 20 20 54 68 65 | 20 6c 69 73 74 20 6f 66 |X.X The| list of|
|00001a20| 20 63 6f 75 6e 74 72 69 | 65 73 20 69 73 20 6e 6f | countri|es is no|
|00001a30| 74 20 63 6f 6d 70 6c 65 | 74 65 2e 20 20 49 20 68 |t comple|te. I h|
|00001a40| 61 76 65 20 6e 6f 20 69 | 6e 74 65 6e 74 69 6f 6e |ave no i|ntention|
|00001a50| 20 6f 66 20 0a 58 65 78 | 74 65 6e 64 69 6e 67 20 | of .Xex|tending |
|00001a60| 69 74 20 74 6f 20 63 6f | 76 65 72 20 61 6c 6c 20 |it to co|ver all |
|00001a70| 63 75 72 72 65 6e 74 2c | 20 70 61 73 74 2c 20 61 |current,| past, a|
|00001a80| 6e 64 20 66 75 74 75 72 | 65 20 63 6f 75 6e 74 72 |nd futur|e countr|
|00001a90| 69 65 73 2e 20 20 49 66 | 0a 58 79 6f 75 20 77 61 |ies. If|.Xyou wa|
|00001aa0| 6e 74 20 74 6f 20 64 6f | 20 69 74 20 79 6f 75 72 |nt to do| it your|
|00001ab0| 73 65 6c 66 2c 20 66 65 | 65 6c 20 66 72 65 65 20 |self, fe|el free |
|00001ac0| 74 6f 20 68 61 63 6b 20 | 69 74 20 75 70 2e 0a 58 |to hack |it up..X|
|00001ad0| 0a 58 20 20 49 20 77 6f | 75 6c 64 20 61 70 70 72 |.X I wo|uld appr|
|00001ae0| 65 63 69 61 74 65 20 74 | 68 65 20 72 65 63 65 70 |eciate t|he recep|
|00001af0| 74 69 6f 6e 20 6f 66 20 | 61 6e 79 20 63 68 61 6e |tion of |any chan|
|00001b00| 67 65 73 2f 63 6f 72 72 | 65 63 74 69 6f 6e 73 20 |ges/corr|ections |
|00001b10| 79 6f 75 20 6d 61 6b 65 | 21 0a 58 0a 58 0a 58 42 |you make|!.X.X.XB|
|00001b20| 6f 62 20 44 65 76 69 6e | 65 0a 58 4e 6f 76 65 6d |ob Devin|e.XNovem|
|00001b30| 62 65 72 20 31 39 38 36 | 20 28 47 72 65 67 6f 72 |ber 1986| (Gregor|
|00001b40| 69 61 6e 20 73 74 79 6c | 65 20 6e 75 6d 62 65 72 |ian styl|e number|
|00001b50| 69 6e 67 29 0a 58 0a 53 | 48 41 52 5f 45 4f 46 0a |ing).X.S|HAR_EOF.|
|00001b60| 69 66 20 74 65 73 74 20 | 35 38 36 35 20 2d 6e 65 |if test |5865 -ne|
|00001b70| 20 22 60 77 63 20 2d 63 | 20 3c 20 27 52 45 41 44 | "`wc -c| < 'READ|
|00001b80| 5f 4d 45 27 60 22 0a 74 | 68 65 6e 0a 09 65 63 68 |_ME'`".t|hen..ech|
|00001b90| 6f 20 73 68 61 72 3a 20 | 65 72 72 6f 72 20 74 72 |o shar: |error tr|
|00001ba0| 61 6e 73 6d 69 74 74 69 | 6e 67 20 22 27 52 45 41 |ansmitti|ng "'REA|
|00001bb0| 44 5f 4d 45 27 22 20 27 | 28 73 68 6f 75 6c 64 20 |D_ME'" '|(should |
|00001bc0| 68 61 76 65 20 62 65 65 | 6e 20 35 38 36 35 20 63 |have bee|n 5865 c|
|00001bd0| 68 61 72 61 63 74 65 72 | 73 29 27 0a 66 69 0a 66 |haracter|s)'.fi.f|
|00001be0| 69 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 4d 61 |i.if tes|t -f 'Ma|
|00001bf0| 6b 65 66 69 6c 65 27 0a | 74 68 65 6e 0a 09 65 63 |kefile'.|then..ec|
|00001c00| 68 6f 20 73 68 61 72 3a | 20 77 69 6c 6c 20 6e 6f |ho shar:| will no|
|00001c10| 74 20 6f 76 65 72 2d 77 | 72 69 74 65 20 65 78 69 |t over-w|rite exi|
|00001c20| 73 74 69 6e 67 20 66 69 | 6c 65 20 22 27 4d 61 6b |sting fi|le "'Mak|
|00001c30| 65 66 69 6c 65 27 22 0a | 65 6c 73 65 0a 65 63 68 |efile'".|else.ech|
|00001c40| 6f 20 65 78 74 72 61 63 | 74 69 6e 67 20 22 27 4d |o extrac|ting "'M|
|00001c50| 61 6b 65 66 69 6c 65 27 | 22 0a 73 65 64 20 27 73 |akefile'|".sed 's|
|00001c60| 2f 5e 58 2f 2f 27 20 3e | 4d 61 6b 65 66 69 6c 65 |/^X//' >|Makefile|
|00001c70| 20 3c 3c 27 53 48 41 52 | 5f 45 4f 46 27 0a 58 23 | <<'SHAR|_EOF'.X#|
|00001c80| 20 50 52 49 4e 54 53 45 | 52 56 45 52 20 6d 61 6b | PRINTSE|RVER mak|
|00001c90| 65 66 69 6c 65 0a 58 0a | 58 23 43 4f 50 54 53 20 |efile.X.|X#COPTS |
|00001ca0| 20 3d 20 0a 58 43 4f 50 | 54 53 20 20 3d 20 2d 4f | = .XCOP|TS = -O|
|00001cb0| 0a 58 23 43 44 45 46 53 | 20 20 3d 20 2d 44 44 45 |.X#CDEFS| = -DDE|
|00001cc0| 42 55 47 20 0a 58 43 44 | 45 46 53 20 20 3d 0a 58 |BUG .XCD|EFS =.X|
|00001cd0| 49 4e 43 44 49 52 20 3d | 0a 58 43 46 4c 41 47 53 |INCDIR =|.XCFLAGS|
|00001ce0| 20 3d 20 24 28 43 4f 50 | 54 53 29 20 24 28 43 44 | = $(COP|TS) $(CD|
|00001cf0| 45 46 53 29 20 24 28 49 | 4e 43 44 49 52 29 0a 58 |EFS) $(I|NCDIR).X|
|00001d00| 0a 58 4c 46 4c 41 47 53 | 20 3d 20 0a 58 4c 49 42 |.XLFLAGS| = .XLIB|
|00001d10| 53 20 20 20 3d 20 0a 58 | 42 49 4e 5f 44 49 52 20 |S = .X|BIN_DIR |
|00001d20| 3d 20 0a 58 50 52 4f 47 | 20 3d 20 79 65 61 72 0a |= .XPROG| = year.|
|00001d30| 58 0a 58 43 46 49 4c 45 | 53 20 3d 20 5c 0a 58 09 |X.XCFILE|S = \.X.|
|00001d40| 6d 61 69 6e 2e 63 20 5c | 0a 58 09 64 61 79 73 2e |main.c \|.X.days.|
|00001d50| 63 20 5c 0a 58 09 65 61 | 72 6c 79 2e 63 20 0a 58 |c \.X.ea|rly.c .X|
|00001d60| 0a 58 0a 58 4f 46 49 4c | 45 53 20 3d 20 24 28 43 |.X.XOFIL|ES = $(C|
|00001d70| 46 49 4c 45 53 3a 2e 63 | 3d 2e 6f 29 0a 58 4c 46 |FILES:.c|=.o).XLF|
|00001d80| 49 4c 45 53 20 3d 20 24 | 28 43 46 49 4c 45 53 3a |ILES = $|(CFILES:|
|00001d90| 2e 63 3d 2e 6c 6e 29 0a | 58 0a 58 2e 53 55 46 46 |.c=.ln).|X.X.SUFF|
|00001da0| 49 58 45 53 3a 20 2e 6c | 6e 0a 58 2e 63 2e 6c 6e |IXES: .l|n.X.c.ln|
|00001db0| 3a 0a 58 09 6c 69 6e 74 | 20 2d 61 62 63 68 75 20 |:.X.lint| -abchu |
|00001dc0| 24 28 49 4e 43 44 49 52 | 29 20 24 2a 2e 63 0a 58 |$(INCDIR|) $*.c.X|
|00001dd0| 0a 58 62 75 69 6c 64 09 | 3a 20 24 28 50 52 4f 47 |.Xbuild.|: $(PROG|
|00001de0| 29 0a 58 0a 58 70 62 75 | 69 6c 64 09 3a 20 24 28 |).X.Xpbu|ild.: $(|
|00001df0| 4f 46 49 4c 45 53 29 0a | 58 09 63 63 20 2d 70 20 |OFILES).|X.cc -p |
|00001e00| 2d 6f 20 24 28 50 52 4f | 47 29 20 24 28 4c 46 4c |-o $(PRO|G) $(LFL|
|00001e10| 41 47 53 29 20 20 24 28 | 4f 46 49 4c 45 53 29 20 |AGS) $(|OFILES) |
|00001e20| 20 24 28 4c 49 42 53 29 | 0a 58 0a 58 61 6c 6c 09 | $(LIBS)|.X.Xall.|
|00001e30| 3a 20 24 28 50 52 4f 47 | 29 20 6c 69 6e 74 0a 58 |: $(PROG|) lint.X|
|00001e40| 0a 58 24 28 50 52 4f 47 | 29 3a 20 24 28 4f 46 49 |.X$(PROG|): $(OFI|
|00001e50| 4c 45 53 29 0a 58 09 63 | 63 20 2d 6f 20 24 28 50 |LES).X.c|c -o $(P|
|00001e60| 52 4f 47 29 20 24 28 4c | 46 4c 41 47 53 29 20 20 |ROG) $(L|FLAGS) |
|00001e70| 24 28 4f 46 49 4c 45 53 | 29 20 20 24 28 4c 49 42 |$(OFILES|) $(LIB|
|00001e80| 53 29 0a 58 0a 58 69 6e | 73 74 61 6c 6c 09 3a 20 |S).X.Xin|stall.: |
|00001e90| 24 28 50 52 4f 47 29 20 | 0a 58 09 6d 76 20 24 28 |$(PROG) |.X.mv $(|
|00001ea0| 50 52 4f 47 29 20 24 28 | 42 49 4e 5f 44 49 52 29 |PROG) $(|BIN_DIR)|
|00001eb0| 0a 58 0a 58 6c 69 6e 74 | 09 3a 20 24 28 4c 46 49 |.X.Xlint|.: $(LFI|
|00001ec0| 4c 45 53 29 0a 58 0a 58 | 63 6c 65 61 6e 09 3a 0a |LES).X.X|clean.:.|
|00001ed0| 58 09 2d 72 6d 20 24 28 | 50 52 4f 47 29 0a 58 09 |X.-rm $(|PROG).X.|
|00001ee0| 2d 72 6d 20 2a 2e 6f 0a | 53 48 41 52 5f 45 4f 46 |-rm *.o.|SHAR_EOF|
|00001ef0| 0a 69 66 20 74 65 73 74 | 20 35 37 33 20 2d 6e 65 |.if test| 573 -ne|
|00001f00| 20 22 60 77 63 20 2d 63 | 20 3c 20 27 4d 61 6b 65 | "`wc -c| < 'Make|
|00001f10| 66 69 6c 65 27 60 22 0a | 74 68 65 6e 0a 09 65 63 |file'`".|then..ec|
|00001f20| 68 6f 20 73 68 61 72 3a | 20 65 72 72 6f 72 20 74 |ho shar:| error t|
|00001f30| 72 61 6e 73 6d 69 74 74 | 69 6e 67 20 22 27 4d 61 |ransmitt|ing "'Ma|
|00001f40| 6b 65 66 69 6c 65 27 22 | 20 27 28 73 68 6f 75 6c |kefile'"| '(shoul|
|00001f50| 64 20 68 61 76 65 20 62 | 65 65 6e 20 35 37 33 20 |d have b|een 573 |
|00001f60| 63 68 61 72 61 63 74 65 | 72 73 29 27 0a 66 69 0a |characte|rs)'.fi.|
|00001f70| 66 69 0a 69 66 20 74 65 | 73 74 20 2d 66 20 27 6d |fi.if te|st -f 'm|
|00001f80| 61 69 6e 2e 63 27 0a 74 | 68 65 6e 0a 09 65 63 68 |ain.c'.t|hen..ech|
|00001f90| 6f 20 73 68 61 72 3a 20 | 77 69 6c 6c 20 6e 6f 74 |o shar: |will not|
|00001fa0| 20 6f 76 65 72 2d 77 72 | 69 74 65 20 65 78 69 73 | over-wr|ite exis|
|00001fb0| 74 69 6e 67 20 66 69 6c | 65 20 22 27 6d 61 69 6e |ting fil|e "'main|
|00001fc0| 2e 63 27 22 0a 65 6c 73 | 65 0a 65 63 68 6f 20 65 |.c'".els|e.echo e|
|00001fd0| 78 74 72 61 63 74 69 6e | 67 20 22 27 6d 61 69 6e |xtractin|g "'main|
|00001fe0| 2e 63 27 22 0a 73 65 64 | 20 27 73 2f 5e 58 2f 2f |.c'".sed| 's/^X//|
|00001ff0| 27 20 3e 6d 61 69 6e 2e | 63 20 3c 3c 27 53 48 41 |' >main.|c <<'SHA|
|00002000| 52 5f 45 4f 46 27 0a 58 | 23 69 6e 63 6c 75 64 65 |R_EOF'.X|#include|
|00002010| 20 3c 73 74 64 69 6f 2e | 68 3e 0a 58 0a 58 0a 58 | <stdio.|h>.X.X.X|
|00002020| 6d 61 69 6e 28 29 0a 58 | 7b 0a 58 20 20 20 20 69 |main().X|{.X i|
|00002030| 6e 74 20 64 61 79 73 5f | 69 6e 5f 79 65 61 72 28 |nt days_|in_year(|
|00002040| 29 3b 0a 58 20 20 20 20 | 69 6e 74 20 79 65 61 72 |);.X |int year|
|00002050| 3b 0a 58 20 20 20 20 69 | 6e 74 20 63 6f 75 6e 74 |;.X i|nt count|
|00002060| 72 79 5f 63 6f 64 65 3b | 0a 58 20 20 20 20 0a 58 |ry_code;|.X .X|
|00002070| 20 20 20 20 77 68 69 6c | 65 20 28 31 29 0a 58 20 | whil|e (1).X |
|00002080| 20 20 20 7b 0a 58 09 70 | 72 69 6e 74 66 28 22 5c | {.X.p|rintf("\|
|00002090| 6e 45 6e 74 65 72 20 79 | 65 61 72 20 61 6e 64 20 |nEnter y|ear and |
|000020a0| 63 6f 75 6e 74 72 79 20 | 63 6f 64 65 3a 20 22 29 |country |code: ")|
|000020b0| 3b 0a 58 09 69 66 20 28 | 73 63 61 6e 66 28 22 25 |;.X.if (|scanf("%|
|000020c0| 64 20 25 64 22 2c 20 26 | 79 65 61 72 2c 20 26 63 |d %d", &|year, &c|
|000020d0| 6f 75 6e 74 72 79 5f 63 | 6f 64 65 29 20 3d 3d 20 |ountry_c|ode) == |
|000020e0| 45 4f 46 29 0a 58 09 20 | 20 20 20 65 78 69 74 28 |EOF).X. | exit(|
|000020f0| 30 29 3b 0a 58 0a 58 09 | 70 72 69 6e 74 66 28 22 |0);.X.X.|printf("|
|00002100| 69 74 20 68 61 73 20 25 | 64 20 64 61 79 73 5c 6e |it has %|d days\n|
|00002110| 22 2c 20 64 61 79 73 5f | 69 6e 5f 79 65 61 72 28 |", days_|in_year(|
|00002120| 79 65 61 72 2c 20 63 6f | 75 6e 74 72 79 5f 63 6f |year, co|untry_co|
|00002130| 64 65 29 29 3b 0a 58 20 | 20 20 20 7d 0a 58 7d 0a |de));.X | }.X}.|
|00002140| 53 48 41 52 5f 45 4f 46 | 0a 69 66 20 74 65 73 74 |SHAR_EOF|.if test|
|00002150| 20 32 39 35 20 2d 6e 65 | 20 22 60 77 63 20 2d 63 | 295 -ne| "`wc -c|
|00002160| 20 3c 20 27 6d 61 69 6e | 2e 63 27 60 22 0a 74 68 | < 'main|.c'`".th|
|00002170| 65 6e 0a 09 65 63 68 6f | 20 73 68 61 72 3a 20 65 |en..echo| shar: e|
|00002180| 72 72 6f 72 20 74 72 61 | 6e 73 6d 69 74 74 69 6e |rror tra|nsmittin|
|00002190| 67 20 22 27 6d 61 69 6e | 2e 63 27 22 20 27 28 73 |g "'main|.c'" '(s|
|000021a0| 68 6f 75 6c 64 20 68 61 | 76 65 20 62 65 65 6e 20 |hould ha|ve been |
|000021b0| 32 39 35 20 63 68 61 72 | 61 63 74 65 72 73 29 27 |295 char|acters)'|
|000021c0| 0a 66 69 0a 66 69 0a 69 | 66 20 74 65 73 74 20 2d |.fi.fi.i|f test -|
|000021d0| 66 20 27 64 61 79 73 2e | 63 27 0a 74 68 65 6e 0a |f 'days.|c'.then.|
|000021e0| 09 65 63 68 6f 20 73 68 | 61 72 3a 20 77 69 6c 6c |.echo sh|ar: will|
|000021f0| 20 6e 6f 74 20 6f 76 65 | 72 2d 77 72 69 74 65 20 | not ove|r-write |
|00002200| 65 78 69 73 74 69 6e 67 | 20 66 69 6c 65 20 22 27 |existing| file "'|
|00002210| 64 61 79 73 2e 63 27 22 | 0a 65 6c 73 65 0a 65 63 |days.c'"|.else.ec|
|00002220| 68 6f 20 65 78 74 72 61 | 63 74 69 6e 67 20 22 27 |ho extra|cting "'|
|00002230| 64 61 79 73 2e 63 27 22 | 0a 73 65 64 20 27 73 2f |days.c'"|.sed 's/|
|00002240| 5e 58 2f 2f 27 20 3e 64 | 61 79 73 2e 63 20 3c 3c |^X//' >d|ays.c <<|
|00002250| 27 53 48 41 52 5f 45 4f | 46 27 0a 58 23 69 6e 63 |'SHAR_EO|F'.X#inc|
|00002260| 6c 75 64 65 20 3c 73 74 | 64 69 6f 2e 68 3e 0a 58 |lude <st|dio.h>.X|
|00002270| 0a 58 73 74 72 75 63 74 | 20 63 6f 75 6e 74 72 79 |.Xstruct| country|
|00002280| 5f 79 65 61 72 73 0a 58 | 7b 0a 58 20 20 20 20 73 |_years.X|{.X s|
|00002290| 68 6f 72 74 20 20 67 72 | 65 67 5f 73 77 69 74 63 |hort gr|eg_switc|
|000022a0| 68 3b 09 09 2f 2a 20 79 | 65 61 72 20 61 63 63 6f |h;../* y|ear acco|
|000022b0| 72 64 69 6e 67 20 74 6f | 20 43 68 72 69 73 74 69 |rding to| Christi|
|000022c0| 61 6e 20 65 72 61 20 20 | 2a 2f 0a 58 20 20 20 20 |an era |*/.X |
|000022d0| 69 6e 74 20 20 20 20 28 | 2a 77 65 69 72 64 5f 79 |int (|*weird_y|
|000022e0| 65 61 72 73 29 28 29 3b | 09 2f 2a 20 66 75 6e 63 |ears)();|./* func|
|000022f0| 74 69 6f 6e 20 70 6f 69 | 6e 74 65 72 20 66 6f 72 |tion poi|nter for|
|00002300| 20 65 61 72 6c 79 20 79 | 65 61 72 73 20 2a 2f 0a | early y|ears */.|
|00002310| 58 7d 3b 0a 58 0a 58 0a | 58 23 69 6e 63 6c 75 64 |X};.X.X.|X#includ|
|00002320| 65 20 22 79 65 61 72 2e | 74 62 6c 22 0a 58 0a 58 |e "year.|tbl".X.X|
|00002330| 0a 58 0a 58 2f 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |.X.X/***|********|
|00002340| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002350| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002360| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002370| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 0a 58 2a 0a 58 |********|***.X*.X|
|00002380| 2a 20 20 64 61 79 73 5f | 69 6e 5f 79 65 61 72 28 |* days_|in_year(|
|00002390| 29 20 2d 2d 20 67 69 76 | 65 20 6e 75 6d 62 65 72 |) -- giv|e number|
|000023a0| 20 6f 66 20 64 61 79 73 | 20 66 6f 72 20 70 61 72 | of days| for par|
|000023b0| 74 69 63 75 6c 61 72 20 | 79 65 61 72 20 61 6e 64 |ticular |year and|
|000023c0| 20 63 6f 75 6e 74 72 79 | 0a 58 2a 0a 58 2a 20 20 | country|.X*.X* |
|000023d0| 20 20 20 4e 2e 42 2e 20 | 63 6f 75 6e 74 72 69 65 | N.B. |countrie|
|000023e0| 73 20 61 6e 64 20 74 68 | 65 69 72 20 62 6f 72 64 |s and th|eir bord|
|000023f0| 65 72 73 20 68 61 76 65 | 20 63 68 61 6e 67 65 64 |ers have| changed|
|00002400| 20 61 20 62 69 74 20 6f | 76 65 72 20 74 69 6d 65 | a bit o|ver time|
|00002410| 20 2e 2e 2e 0a 58 2a 0a | 58 2a 20 20 20 20 20 72 | ....X*.|X* r|
|00002420| 65 74 75 72 6e 73 3a 0a | 58 2a 20 20 20 20 20 20 |eturns:.|X* |
|00002430| 20 20 2d 31 20 20 20 20 | 20 20 66 6f 72 20 75 6e | -1 | for un|
|00002440| 6b 6e 6f 77 6e 20 63 6f | 75 6e 74 72 69 65 73 20 |known co|untries |
|00002450| 6f 72 20 62 61 64 20 79 | 65 61 72 73 0a 58 2a 20 |or bad y|ears.X* |
|00002460| 20 20 20 20 23 20 6f 66 | 20 64 61 79 73 20 20 66 | # of| days f|
|00002470| 6f 72 20 67 6f 6f 64 20 | 79 65 61 72 73 20 6f 66 |or good |years of|
|00002480| 20 63 6f 75 6e 74 72 69 | 65 73 20 69 6e 20 74 61 | countri|es in ta|
|00002490| 62 6c 65 0a 58 2a 0a 58 | 2a 2a 2a 2a 2a 2a 2a 2a |ble.X*.X|********|
|000024a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000024b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000024c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000024d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2f 0a |********|******/.|
|000024e0| 58 69 6e 74 0a 58 64 61 | 79 73 5f 69 6e 5f 79 65 |Xint.Xda|ys_in_ye|
|000024f0| 61 72 28 79 65 61 72 2c | 20 63 6f 75 6e 74 72 79 |ar(year,| country|
|00002500| 5f 63 6f 64 65 29 0a 58 | 20 20 20 20 72 65 67 69 |_code).X| regi|
|00002510| 73 74 65 72 20 69 6e 74 | 20 20 20 79 65 61 72 3b |ster int| year;|
|00002520| 0a 58 20 20 20 20 72 65 | 67 69 73 74 65 72 20 69 |.X re|gister i|
|00002530| 6e 74 20 20 20 63 6f 75 | 6e 74 72 79 5f 63 6f 64 |nt cou|ntry_cod|
|00002540| 65 3b 0a 58 7b 0a 58 20 | 20 20 20 72 65 67 69 73 |e;.X{.X | regis|
|00002550| 74 65 72 20 69 6e 74 20 | 73 77 69 74 63 68 5f 79 |ter int |switch_y|
|00002560| 65 61 72 3b 0a 58 0a 58 | 0a 58 20 20 20 20 2f 2a |ear;.X.X|.X /*|
|00002570| 20 76 61 6c 69 64 20 63 | 6f 75 6e 74 72 79 20 63 | valid c|ountry c|
|00002580| 6f 64 65 3f 20 2a 2f 0a | 58 20 20 20 20 69 66 20 |ode? */.|X if |
|00002590| 28 63 6f 75 6e 74 72 79 | 5f 63 6f 64 65 20 3c 20 |(country|_code < |
|000025a0| 30 20 20 7c 7c 20 20 63 | 6f 75 6e 74 72 79 5f 63 |0 || c|ountry_c|
|000025b0| 6f 64 65 20 3e 20 4d 41 | 58 5f 43 4f 55 4e 54 52 |ode > MA|X_COUNTR|
|000025c0| 59 29 0a 58 09 72 65 74 | 75 72 6e 28 2d 31 29 3b |Y).X.ret|urn(-1);|
|000025d0| 0a 58 0a 58 20 20 20 20 | 2f 2a 20 63 68 65 63 6b |.X.X |/* check|
|000025e0| 20 74 68 65 20 66 61 72 | 74 68 65 73 74 20 62 6f | the far|thest bo|
|000025f0| 75 6e 64 61 72 69 65 73 | 3b 20 74 68 65 72 65 20 |undaries|; there |
|00002600| 69 73 20 6e 6f 20 79 65 | 61 72 20 30 20 2a 2f 0a |is no ye|ar 0 */.|
|00002610| 58 20 20 20 20 2f 2a 20 | 4e 4f 54 45 3a 20 69 6e |X /* |NOTE: in|
|00002620| 64 69 76 69 64 75 61 6c | 20 63 6f 75 6e 74 72 79 |dividual| country|
|00002630| 20 66 75 6e 63 74 69 6f | 6e 73 20 6d 61 79 20 68 | functio|ns may h|
|00002640| 61 6e 64 6c 65 20 6c 65 | 73 73 20 2a 2f 0a 58 20 |andle le|ss */.X |
|00002650| 20 20 20 69 66 20 28 79 | 65 61 72 20 3c 3d 20 30 | if (y|ear <= 0|
|00002660| 20 20 7c 7c 20 20 79 65 | 61 72 20 3e 20 39 39 39 | || ye|ar > 999|
|00002670| 39 29 0a 58 09 72 65 74 | 75 72 6e 28 2d 31 29 3b |9).X.ret|urn(-1);|
|00002680| 0a 58 0a 58 20 20 20 20 | 2f 2a 20 69 66 20 79 65 |.X.X |/* if ye|
|00002690| 61 72 20 69 73 20 61 66 | 74 65 72 20 47 72 65 67 |ar is af|ter Greg|
|000026a0| 6f 72 69 61 6e 20 63 61 | 6c 65 6e 64 61 72 20 63 |orian ca|lendar c|
|000026b0| 68 61 6e 67 65 2c 20 75 | 73 65 20 47 72 65 67 6f |hange, u|se Grego|
|000026c0| 72 69 61 6e 20 72 75 6c | 65 20 2a 2f 0a 58 20 20 |rian rul|e */.X |
|000026d0| 20 20 73 77 69 74 63 68 | 5f 79 65 61 72 20 3d 20 | switch|_year = |
|000026e0| 79 65 61 72 5f 74 61 62 | 6c 65 5b 63 6f 75 6e 74 |year_tab|le[count|
|000026f0| 72 79 5f 63 6f 64 65 5d | 2e 67 72 65 67 5f 73 77 |ry_code]|.greg_sw|
|00002700| 69 74 63 68 3b 0a 58 20 | 20 20 20 69 66 20 28 79 |itch;.X | if (y|
|00002710| 65 61 72 20 3e 20 73 77 | 69 74 63 68 5f 79 65 61 |ear > sw|itch_yea|
|00002720| 72 29 0a 58 09 69 66 20 | 28 28 79 65 61 72 26 30 |r).X.if |((year&0|
|00002730| 78 33 29 3d 3d 30 20 26 | 26 20 28 28 79 65 61 72 |x3)==0 &|& ((year|
|00002740| 26 30 78 46 29 3d 3d 30 | 20 7c 7c 20 79 65 61 72 |&0xF)==0| || year|
|00002750| 25 31 30 30 29 29 0a 58 | 09 20 20 20 20 72 65 74 |%100)).X|. ret|
|00002760| 75 72 6e 28 33 36 36 29 | 3b 0a 58 09 65 6c 73 65 |urn(366)|;.X.else|
|00002770| 0a 58 09 20 20 20 20 72 | 65 74 75 72 6e 28 33 36 |.X. r|eturn(36|
|00002780| 35 29 3b 0a 58 20 20 20 | 20 0a 58 20 20 20 20 2f |5);.X | .X /|
|00002790| 2a 20 65 6c 73 65 2c 20 | 6e 65 65 64 20 74 6f 20 |* else, |need to |
|000027a0| 68 61 6e 64 6c 65 20 79 | 65 61 72 73 20 62 65 66 |handle y|ears bef|
|000027b0| 6f 72 65 20 61 6e 64 20 | 64 75 72 69 6e 67 20 63 |ore and |during c|
|000027c0| 61 6c 65 6e 64 61 72 20 | 63 68 61 6e 67 65 20 2a |alendar |change *|
|000027d0| 2f 0a 58 20 20 20 20 72 | 65 74 75 72 6e 28 28 2a |/.X r|eturn((*|
|000027e0| 79 65 61 72 5f 74 61 62 | 6c 65 5b 63 6f 75 6e 74 |year_tab|le[count|
|000027f0| 72 79 5f 63 6f 64 65 5d | 2e 77 65 69 72 64 5f 79 |ry_code]|.weird_y|
|00002800| 65 61 72 73 29 28 79 65 | 61 72 2c 20 73 77 69 74 |ears)(ye|ar, swit|
|00002810| 63 68 5f 79 65 61 72 29 | 29 3b 0a 58 7d 0a 53 48 |ch_year)|);.X}.SH|
|00002820| 41 52 5f 45 4f 46 0a 69 | 66 20 74 65 73 74 20 31 |AR_EOF.i|f test 1|
|00002830| 34 32 33 20 2d 6e 65 20 | 22 60 77 63 20 2d 63 20 |423 -ne |"`wc -c |
|00002840| 3c 20 27 64 61 79 73 2e | 63 27 60 22 0a 74 68 65 |< 'days.|c'`".the|
|00002850| 6e 0a 09 65 63 68 6f 20 | 73 68 61 72 3a 20 65 72 |n..echo |shar: er|
|00002860| 72 6f 72 20 74 72 61 6e | 73 6d 69 74 74 69 6e 67 |ror tran|smitting|
|00002870| 20 22 27 64 61 79 73 2e | 63 27 22 20 27 28 73 68 | "'days.|c'" '(sh|
|00002880| 6f 75 6c 64 20 68 61 76 | 65 20 62 65 65 6e 20 31 |ould hav|e been 1|
|00002890| 34 32 33 20 63 68 61 72 | 61 63 74 65 72 73 29 27 |423 char|acters)'|
|000028a0| 0a 66 69 0a 66 69 0a 69 | 66 20 74 65 73 74 20 2d |.fi.fi.i|f test -|
|000028b0| 66 20 27 65 61 72 6c 79 | 2e 63 27 0a 74 68 65 6e |f 'early|.c'.then|
|000028c0| 0a 09 65 63 68 6f 20 73 | 68 61 72 3a 20 77 69 6c |..echo s|har: wil|
|000028d0| 6c 20 6e 6f 74 20 6f 76 | 65 72 2d 77 72 69 74 65 |l not ov|er-write|
|000028e0| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 22 | existin|g file "|
|000028f0| 27 65 61 72 6c 79 2e 63 | 27 22 0a 65 6c 73 65 0a |'early.c|'".else.|
|00002900| 65 63 68 6f 20 65 78 74 | 72 61 63 74 69 6e 67 20 |echo ext|racting |
|00002910| 22 27 65 61 72 6c 79 2e | 63 27 22 0a 73 65 64 20 |"'early.|c'".sed |
|00002920| 27 73 2f 5e 58 2f 2f 27 | 20 3e 65 61 72 6c 79 2e |'s/^X//'| >early.|
|00002930| 63 20 3c 3c 27 53 48 41 | 52 5f 45 4f 46 27 0a 58 |c <<'SHA|R_EOF'.X|
|00002940| 23 69 6e 63 6c 75 64 65 | 20 3c 73 74 64 69 6f 2e |#include| <stdio.|
|00002950| 68 3e 0a 58 0a 58 0a 58 | 2f 2a 2a 2a 2a 2a 2a 2a |h>.X.X.X|/*******|
|00002960| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002970| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002980| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002990| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 0a |********|*******.|
|000029a0| 58 2a 0a 58 2a 20 75 6e | 6b 6e 6f 77 6e 5f 63 61 |X*.X* un|known_ca|
|000029b0| 6c 65 6e 64 61 72 28 29 | 20 2d 2d 20 69 67 6e 6f |lendar()| -- igno|
|000029c0| 72 61 6e 63 65 20 70 6c | 61 63 65 20 68 6f 6c 64 |rance pl|ace hold|
|000029d0| 65 72 0a 58 2a 0a 58 2a | 20 20 20 20 20 54 68 69 |er.X*.X*| Thi|
|000029e0| 73 20 69 73 20 66 6f 72 | 20 63 6f 75 6e 74 72 69 |s is for| countri|
|000029f0| 65 73 20 74 68 61 74 20 | 49 20 64 6f 6e 27 74 20 |es that |I don't |
|00002a00| 6b 6e 6f 77 20 61 62 6f | 75 74 2e 20 20 49 74 20 |know abo|ut. It |
|00002a10| 69 73 20 75 73 65 64 20 | 66 6f 72 0a 58 2a 20 20 |is used |for.X* |
|00002a20| 20 74 68 65 20 4d 75 73 | 6c 69 6d 2c 20 43 65 6c | the Mus|lim, Cel|
|00002a30| 74 69 63 2c 20 43 68 69 | 6e 65 73 65 2c 20 4d 61 |tic, Chi|nese, Ma|
|00002a40| 79 61 6e 2c 20 61 6e 64 | 20 6f 74 68 65 72 20 63 |yan, and| other c|
|00002a50| 61 6c 65 6e 64 61 72 73 | 2e 0a 58 2a 0a 58 2a 2a |alendars|..X*.X**|
|00002a60| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002a70| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002a80| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002a90| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002aa0| 2a 2a 2a 2a 2f 0a 58 69 | 6e 74 20 75 6e 6b 6e 6f |****/.Xi|nt unkno|
|00002ab0| 77 6e 5f 63 61 6c 65 6e | 64 61 72 28 79 65 61 72 |wn_calen|dar(year|
|00002ac0| 2c 20 63 68 61 6e 67 65 | 5f 79 65 61 72 29 0a 58 |, change|_year).X|
|00002ad0| 20 20 20 20 69 6e 74 20 | 79 65 61 72 3b 0a 58 20 | int |year;.X |
|00002ae0| 20 20 20 69 6e 74 20 63 | 68 61 6e 67 65 5f 79 65 | int c|hange_ye|
|00002af0| 61 72 3b 0a 58 7b 0a 58 | 20 20 20 20 72 65 74 75 |ar;.X{.X| retu|
|00002b00| 72 6e 28 2d 31 29 3b 0a | 58 7d 0a 58 0a 58 0a 58 |rn(-1);.|X}.X.X.X|
|00002b10| 2f 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |/*******|********|
|00002b20| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002b30| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002b40| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002b50| 2a 2a 2a 2a 2a 2a 2a 0a | 58 2a 0a 58 2a 20 6a 75 |*******.|X*.X* ju|
|00002b60| 6c 69 61 6e 28 29 20 2d | 2d 20 72 65 74 75 72 6e |lian() -|- return|
|00002b70| 20 6c 65 6e 67 74 68 20 | 6f 66 20 79 65 61 72 20 | length |of year |
|00002b80| 62 61 73 65 64 20 6f 6e | 20 4a 75 6c 69 75 73 20 |based on| Julius |
|00002b90| 43 61 65 73 61 72 2f 53 | 6f 73 69 67 65 6e 65 73 |Caesar/S|osigenes|
|00002ba0| 20 72 75 6c 65 0a 58 2a | 0a 58 2a 20 20 20 20 20 | rule.X*|.X* |
|00002bb0| 41 63 74 75 61 6c 6c 79 | 20 63 6f 75 6c 64 20 67 |Actually| could g|
|00002bc0| 6f 20 62 61 63 6b 20 74 | 6f 20 34 35 20 42 43 2c |o back t|o 45 BC,|
|00002bd0| 20 62 75 74 20 77 68 79 | 3f 0a 58 2a 20 20 20 20 | but why|?.X* |
|00002be0| 20 43 61 6c 6c 69 6e 67 | 20 72 6f 75 74 69 6e 65 | Calling| routine|
|00002bf0| 20 61 6c 6c 6f 77 73 20 | 6e 6f 20 79 65 61 72 73 | allows |no years|
|00002c00| 20 62 65 66 6f 72 65 20 | 31 20 41 44 20 0a 58 2a | before |1 AD .X*|
|00002c10| 0a 58 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |.X******|********|
|00002c20| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002c30| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002c40| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002c50| 2a 2a 2a 2a 2a 2a 2a 2a | 2f 0a 58 69 6e 74 20 6a |********|/.Xint j|
|00002c60| 75 6c 69 61 6e 28 79 65 | 61 72 2c 20 63 68 61 6e |ulian(ye|ar, chan|
|00002c70| 67 65 5f 79 65 61 72 29 | 0a 58 20 20 20 20 69 6e |ge_year)|.X in|
|00002c80| 74 20 79 65 61 72 3b 0a | 58 20 20 20 20 69 6e 74 |t year;.|X int|
|00002c90| 20 63 68 61 6e 67 65 5f | 79 65 61 72 3b 0a 58 7b | change_|year;.X{|
|00002ca0| 0a 58 20 20 20 20 69 6e | 74 20 6c 65 6e 67 74 68 |.X in|t length|
|00002cb0| 20 3d 20 33 36 35 3b 0a | 58 0a 58 0a 58 20 20 20 | = 365;.|X.X.X |
|00002cc0| 20 69 66 20 28 28 79 65 | 61 72 20 26 20 30 33 29 | if ((ye|ar & 03)|
|00002cd0| 20 3d 3d 20 30 29 0a 58 | 09 6c 65 6e 67 74 68 20 | == 0).X|.length |
|00002ce0| 3d 20 33 36 36 3b 0a 58 | 0a 58 20 20 20 20 69 66 |= 366;.X|.X if|
|00002cf0| 20 28 79 65 61 72 20 3d | 3d 20 63 68 61 6e 67 65 | (year =|= change|
|00002d00| 5f 79 65 61 72 29 0a 58 | 09 73 77 69 74 63 68 20 |_year).X|.switch |
|00002d10| 28 63 68 61 6e 67 65 5f | 79 65 61 72 20 2f 20 31 |(change_|year / 1|
|00002d20| 30 30 29 0a 58 09 7b 0a | 58 09 63 61 73 65 20 32 |00).X.{.|X.case 2|
|00002d30| 30 3a 0a 58 09 09 2f 2a | 20 32 30 30 30 20 2d 20 |0:.X../*| 2000 - |
|00002d40| 32 30 39 39 20 2a 2f 0a | 58 09 09 2f 2a 20 32 30 |2099 */.|X../* 20|
|00002d50| 30 30 20 69 73 20 61 20 | 6c 65 61 70 20 79 65 61 |00 is a |leap yea|
|00002d60| 72 3b 20 66 61 6c 6c 20 | 74 68 72 6f 75 67 68 20 |r; fall |through |
|00002d70| 2a 2f 0a 58 09 63 61 73 | 65 20 31 39 3a 0a 58 09 |*/.X.cas|e 19:.X.|
|00002d80| 09 2f 2a 20 31 39 30 30 | 20 2d 20 31 39 39 39 20 |./* 1900| - 1999 |
|00002d90| 2a 2f 0a 58 09 09 72 65 | 74 75 72 6e 28 6c 65 6e |*/.X..re|turn(len|
|00002da0| 67 74 68 2d 31 33 29 3b | 0a 58 09 63 61 73 65 20 |gth-13);|.X.case |
|00002db0| 31 38 3a 0a 58 09 09 2f | 2a 20 31 38 30 30 20 2d |18:.X../|* 1800 -|
|00002dc0| 20 31 38 39 39 20 2a 2f | 0a 58 09 09 72 65 74 75 | 1899 */|.X..retu|
|00002dd0| 72 6e 28 6c 65 6e 67 74 | 68 2d 31 32 29 3b 0a 58 |rn(lengt|h-12);.X|
|00002de0| 09 63 61 73 65 20 31 37 | 3a 0a 58 09 09 2f 2a 20 |.case 17|:.X../* |
|00002df0| 31 37 30 30 20 2d 20 31 | 37 39 39 20 2a 2f 0a 58 |1700 - 1|799 */.X|
|00002e00| 09 09 72 65 74 75 72 6e | 28 6c 65 6e 67 74 68 2d |..return|(length-|
|00002e10| 31 31 29 3b 0a 58 09 63 | 61 73 65 20 31 36 3a 0a |11);.X.c|ase 16:.|
|00002e20| 58 09 09 2f 2a 20 31 36 | 30 30 20 2d 20 31 36 39 |X../* 16|00 - 169|
|00002e30| 39 20 2a 2f 0a 58 09 09 | 2f 2a 20 31 36 30 30 20 |9 */.X..|/* 1600 |
|00002e40| 69 73 20 61 20 6c 65 61 | 70 20 79 65 61 72 2c 20 |is a lea|p year, |
|00002e50| 66 61 6c 6c 20 74 68 72 | 6f 75 67 68 20 2a 2f 0a |fall thr|ough */.|
|00002e60| 58 09 63 61 73 65 20 31 | 35 3a 0a 58 09 09 2f 2a |X.case 1|5:.X../*|
|00002e70| 20 31 35 30 30 20 2d 20 | 31 35 39 39 20 2a 2f 0a | 1500 - |1599 */.|
|00002e80| 58 09 09 72 65 74 75 72 | 6e 28 6c 65 6e 67 74 68 |X..retur|n(length|
|00002e90| 2d 31 30 29 3b 0a 58 09 | 7d 0a 58 0a 58 20 20 20 |-10);.X.|}.X.X |
|00002ea0| 20 72 65 74 75 72 6e 28 | 6c 65 6e 67 74 68 29 3b | return(|length);|
|00002eb0| 0a 58 7d 0a 58 0a 58 0a | 58 2f 2a 2a 2a 2a 2a 2a |.X}.X.X.|X/******|
|00002ec0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002ed0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002ee0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002ef0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002f00| 0a 58 2a 0a 58 2a 20 62 | 65 6c 67 69 75 6d 5f 65 |.X*.X* b|elgium_e|
|00002f10| 61 72 6c 79 28 29 20 2d | 2d 20 68 61 6e 64 6c 65 |arly() -|- handle|
|00002f20| 20 70 72 6f 62 6c 65 6d | 20 63 61 75 73 65 64 20 | problem| caused |
|00002f30| 62 79 20 74 68 65 20 63 | 68 61 6e 67 65 20 74 6f |by the c|hange to|
|00002f40| 20 47 72 65 67 6f 72 69 | 61 6e 0a 58 2a 20 20 20 | Gregori|an.X* |
|00002f50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002f60| 20 6f 76 65 72 6c 61 70 | 70 69 6e 67 20 74 77 6f | overlap|ping two|
|00002f70| 20 79 65 61 72 73 0a 58 | 2a 0a 58 2a 2a 2a 2a 2a | years.X|*.X*****|
|00002f80| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002f90| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002fa0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002fb0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002fc0| 2a 2f 0a 58 69 6e 74 20 | 62 65 6c 67 69 75 6d 5f |*/.Xint |belgium_|
|00002fd0| 65 61 72 6c 79 28 79 65 | 61 72 2c 20 63 68 61 6e |early(ye|ar, chan|
|00002fe0| 67 65 5f 79 65 61 72 29 | 0a 58 20 20 20 20 69 6e |ge_year)|.X in|
|00002ff0| 74 20 79 65 61 72 3b 0a | 58 20 20 20 20 69 6e 74 |t year;.|X int|
|00003000| 20 63 68 61 6e 67 65 5f | 79 65 61 72 3b 0a 58 7b | change_|year;.X{|
|00003010| 0a 58 20 20 20 20 2f 2a | 20 74 68 65 20 64 61 79 |.X /*| the day|
|00003020| 73 20 31 32 2f 32 35 2f | 31 35 38 32 20 2d 20 31 |s 12/25/|1582 - 1|
|00003030| 2f 35 2f 31 35 38 33 20 | 77 65 72 65 20 64 72 6f |/5/1583 |were dro|
|00003040| 70 70 65 64 20 2a 2f 0a | 58 20 20 20 20 69 66 20 |pped */.|X if |
|00003050| 28 79 65 61 72 20 3d 3d | 20 63 68 61 6e 67 65 5f |(year ==| change_|
|00003060| 79 65 61 72 20 7c 7c 20 | 79 65 61 72 20 3d 3d 20 |year || |year == |
|00003070| 63 68 61 6e 67 65 5f 79 | 65 61 72 2d 31 29 0a 58 |change_y|ear-1).X|
|00003080| 20 20 20 20 20 20 20 20 | 72 65 74 75 72 6e 28 33 | |return(3|
|00003090| 36 30 29 3b 0a 58 0a 58 | 20 20 20 20 2f 2a 20 64 |60);.X.X| /* d|
|000030a0| 6f 20 6e 6f 72 6d 61 6c | 20 4a 75 6c 69 61 6e 20 |o normal| Julian |
|000030b0| 72 75 6c 65 73 20 2a 2f | 0a 58 20 20 20 20 69 66 |rules */|.X if|
|000030c0| 20 28 28 79 65 61 72 20 | 26 20 30 33 29 20 3d 3d | ((year |& 03) ==|
|000030d0| 20 30 29 0a 58 09 72 65 | 74 75 72 6e 28 33 36 36 | 0).X.re|turn(366|
|000030e0| 29 3b 0a 58 20 20 20 20 | 65 6c 73 65 0a 58 09 72 |);.X |else.X.r|
|000030f0| 65 74 75 72 6e 28 33 36 | 35 29 3b 0a 58 7d 0a 58 |eturn(36|5);.X}.X|
|00003100| 0a 58 0a 58 2f 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |.X.X/***|********|
|00003110| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003120| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003130| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003140| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 0a 58 2a 0a 58 |********|***.X*.X|
|00003150| 2a 20 20 63 61 6e 61 64 | 61 5f 65 61 72 6c 79 28 |* canad|a_early(|
|00003160| 29 20 2d 2d 20 64 65 61 | 6c 20 77 69 74 68 20 63 |) -- dea|l with c|
|00003170| 6f 6e 66 6c 69 63 74 20 | 62 65 74 77 65 65 6e 20 |onflict |between |
|00003180| 46 72 65 6e 63 68 20 72 | 75 6c 65 73 20 61 6e 64 |French r|ules and|
|00003190| 0a 58 2a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.X* | |
|000031a0| 20 20 20 20 20 20 20 42 | 72 69 74 69 73 68 20 72 | B|ritish r|
|000031b0| 75 6c 65 73 20 66 6f 72 | 20 64 61 74 65 73 0a 58 |ules for| dates.X|
|000031c0| 2a 0a 58 2a 20 20 20 46 | 72 61 6e 63 65 20 63 68 |*.X* F|rance ch|
|000031d0| 61 6e 67 65 64 20 74 6f | 20 47 72 65 67 6f 72 69 |anged to| Gregori|
|000031e0| 61 6e 20 31 32 2f 31 30 | 2f 31 35 38 32 20 28 4a |an 12/10|/1582 (J|
|000031f0| 75 6c 69 61 6e 29 0a 58 | 2a 20 20 20 42 72 69 74 |ulian).X|* Brit|
|00003200| 61 69 6e 20 63 68 61 6e | 67 65 64 20 74 6f 20 47 |ain chan|ged to G|
|00003210| 72 65 67 6f 72 69 61 6e | 20 30 39 2f 30 35 2f 31 |regorian| 09/05/1|
|00003220| 37 35 32 20 28 4a 75 6c | 69 61 6e 29 0a 58 2a 20 |752 (Jul|ian).X* |
|00003230| 20 20 74 68 65 72 65 66 | 6f 72 65 2c 20 43 61 6e | theref|ore, Can|
|00003240| 61 64 61 20 63 68 61 6e | 67 65 64 20 6f 6e 20 3f |ada chan|ged on ?|
|00003250| 3f 2f 3f 3f 2f 3f 3f 3f | 3f 0a 58 2a 0a 58 2a 20 |?/??/???|?.X*.X* |
|00003260| 20 20 53 6f 6d 65 20 67 | 75 65 73 73 65 73 20 63 | Some g|uesses c|
|00003270| 61 6e 20 62 65 20 6d 61 | 64 65 20 62 61 73 65 64 |an be ma|de based|
|00003280| 20 6f 6e 20 74 68 65 20 | 69 6e 64 69 76 69 64 75 | on the |individu|
|00003290| 61 6c 20 70 72 6f 76 69 | 6e 63 65 73 2f 74 65 72 |al provi|nces/ter|
|000032a0| 72 69 74 6f 72 69 65 73 | 3a 0a 58 2a 0a 58 2a 20 |ritories|:.X*.X* |
|000032b0| 20 20 20 20 41 6c 62 65 | 72 74 61 20 20 20 20 20 | Albe|rta |
|000032c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 42 72 69 | | Bri|
|000032d0| 74 69 73 68 20 72 75 6c | 65 73 20 6c 69 6b 65 6c |tish rul|es likel|
|000032e0| 79 20 61 70 70 6c 79 0a | 58 2a 20 20 20 20 20 42 |y apply.|X* B|
|000032f0| 72 69 74 69 73 68 20 43 | 6f 6c 75 6d 62 69 61 20 |ritish C|olumbia |
|00003300| 20 20 20 20 20 20 20 20 | 42 72 69 74 69 73 68 20 | |British |
|00003310| 72 75 6c 65 73 20 64 65 | 66 69 6e 69 74 65 6c 79 |rules de|finitely|
|00003320| 20 61 70 70 6c 79 0a 58 | 2a 20 20 20 20 20 4d 61 | apply.X|* Ma|
|00003330| 6e 69 74 6f 62 61 20 20 | 20 20 20 20 20 20 20 20 |nitoba | |
|00003340| 20 20 20 20 20 20 20 6c | 69 6b 65 6c 79 20 42 72 | l|ikely Br|
|00003350| 69 74 69 73 68 20 72 75 | 6c 65 73 20 28 64 65 66 |itish ru|les (def|
|00003360| 2e 20 42 72 69 74 69 73 | 68 20 61 66 74 65 72 20 |. Britis|h after |
|00003370| 31 37 36 33 29 0a 58 2a | 20 20 20 20 20 4e 65 77 |1763).X*| New|
|00003380| 20 42 72 75 6e 73 77 69 | 63 6b 20 20 20 20 20 20 | Brunswi|ck |
|00003390| 20 20 20 20 20 20 46 72 | 61 6e 63 65 20 61 6e 64 | Fr|ance and|
|000033a0| 20 42 72 69 74 69 73 68 | 20 61 6c 74 65 72 6e 61 | British| alterna|
|000033b0| 74 65 64 20 63 6f 6e 74 | 72 6f 6c 0a 58 2a 20 20 |ted cont|rol.X* |
|000033c0| 20 20 20 4e 65 77 66 6f | 75 6e 64 6c 61 6e 64 20 | Newfo|undland |
|000033d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 63 6f 6e 74 | | cont|
|000033e0| 65 73 74 65 64 20 75 6e | 74 69 6c 20 31 37 31 33 |ested un|til 1713|
|000033f0| 20 77 68 65 6e 20 62 65 | 63 61 6d 65 20 42 72 69 | when be|came Bri|
|00003400| 74 69 73 68 0a 58 2a 20 | 20 20 20 20 4e 6f 76 61 |tish.X* | Nova|
|00003410| 20 53 63 6f 74 69 61 20 | 20 20 20 20 20 20 20 20 | Scotia | |
|00003420| 20 20 20 20 20 42 72 69 | 74 69 73 68 20 61 66 74 | Bri|tish aft|
|00003430| 65 72 20 31 37 31 33 0a | 58 2a 20 20 20 20 20 4f |er 1713.|X* O|
|00003440| 6e 74 61 72 69 6f 20 20 | 20 20 20 20 20 20 20 20 |ntario | |
|00003450| 20 20 20 20 20 20 20 20 | 46 72 65 6e 63 68 20 66 | |French f|
|00003460| 69 72 73 74 20 74 68 65 | 6e 20 42 72 69 74 69 73 |irst the|n Britis|
|00003470| 68 20 61 66 74 65 72 20 | 31 37 35 39 0a 58 2a 20 |h after |1759.X* |
|00003480| 20 20 20 20 50 72 69 6e | 63 65 20 45 64 77 61 72 | Prin|ce Edwar|
|00003490| 64 20 49 73 6c 61 6e 64 | 20 20 20 20 20 66 6f 6c |d Island| fol|
|000034a0| 6c 6f 77 73 20 4f 6e 74 | 61 72 69 6f 20 72 75 6c |lows Ont|ario rul|
|000034b0| 65 73 20 28 3f 29 0a 58 | 2a 20 20 20 20 20 51 75 |es (?).X|* Qu|
|000034c0| 65 62 65 63 20 20 20 20 | 20 20 20 20 20 20 20 20 |ebec | |
|000034d0| 20 20 20 20 20 20 20 42 | 72 69 74 61 69 6e 20 67 | B|ritain g|
|000034e0| 61 69 6e 65 64 20 69 6e | 20 31 37 36 33 20 77 69 |ained in| 1763 wi|
|000034f0| 74 68 20 54 72 65 61 74 | 79 20 6f 66 20 50 61 72 |th Treat|y of Par|
|00003500| 69 73 0a 58 2a 20 20 20 | 20 20 53 61 73 6b 61 74 |is.X* | Saskat|
|00003510| 63 68 65 77 61 6e 20 20 | 20 20 20 20 20 20 20 20 |chewan | |
|00003520| 20 20 20 42 72 69 74 69 | 73 68 20 72 75 6c 65 73 | Briti|sh rules|
|00003530| 20 61 70 70 6c 79 0a 58 | 2a 20 20 20 20 20 59 75 | apply.X|* Yu|
|00003540| 6b 6f 6e 20 54 65 72 72 | 69 74 6f 72 79 20 20 20 |kon Terr|itory |
|00003550| 20 20 20 20 20 20 20 66 | 69 72 73 74 20 52 75 73 | f|irst Rus|
|00003560| 73 69 61 6e 20 74 68 65 | 6e 20 42 72 69 74 69 73 |sian the|n Britis|
|00003570| 68 20 61 66 74 65 72 20 | 31 38 34 30 20 28 3f 29 |h after |1840 (?)|
|00003580| 0a 58 2a 0a 58 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |.X*.X***|********|
|00003590| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000035a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000035b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000035c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2f 0a 58 69 6e |********|***/.Xin|
|000035d0| 74 20 63 61 6e 61 64 61 | 5f 65 61 72 6c 79 28 79 |t canada|_early(y|
|000035e0| 65 61 72 2c 20 63 68 61 | 6e 67 65 5f 79 65 61 72 |ear, cha|nge_year|
|000035f0| 29 0a 58 20 20 20 20 69 | 6e 74 20 79 65 61 72 3b |).X i|nt year;|
|00003600| 0a 58 20 20 20 20 69 6e | 74 20 63 68 61 6e 67 65 |.X in|t change|
|00003610| 5f 79 65 61 72 3b 0a 58 | 7b 0a 58 20 20 20 20 2f |_year;.X|{.X /|
|00003620| 2a 20 63 61 6c 63 75 6c | 61 74 65 20 75 73 69 6e |* calcul|ate usin|
|00003630| 67 20 42 72 69 74 69 73 | 68 20 63 68 61 6e 67 65 |g Britis|h change|
|00003640| 20 79 65 61 72 20 66 6f | 72 20 43 61 6e 61 64 61 | year fo|r Canada|
|00003650| 27 73 20 2a 2f 0a 58 20 | 20 20 20 72 65 74 75 72 |'s */.X | retur|
|00003660| 6e 28 6a 75 6c 69 61 6e | 28 79 65 61 72 2c 20 63 |n(julian|(year, c|
|00003670| 68 61 6e 67 65 5f 79 65 | 61 72 29 29 3b 0a 58 7d |hange_ye|ar));.X}|
|00003680| 0a 58 0a 58 0a 58 2f 2a | 2a 2a 2a 2a 2a 2a 2a 2a |.X.X.X/*|********|
|00003690| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000036a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000036b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000036c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 0a 58 2a |********|*****.X*|
|000036d0| 0a 58 2a 20 63 68 69 6e | 61 5f 65 61 72 6c 79 28 |.X* chin|a_early(|
|000036e0| 29 20 2d 2d 20 70 72 65 | 76 69 6f 75 73 20 74 6f |) -- pre|vious to|
|000036f0| 20 75 73 69 6e 67 20 74 | 68 65 20 47 72 65 67 6f | using t|he Grego|
|00003700| 72 69 61 6e 20 63 61 6c | 65 6e 64 61 72 2c 20 43 |rian cal|endar, C|
|00003710| 68 69 6e 61 0a 58 2a 20 | 20 20 20 20 20 20 20 20 |hina.X* | |
|00003720| 20 20 20 20 20 20 20 20 | 20 75 73 65 64 20 61 20 | | used a |
|00003730| 31 32 20 28 6f 72 64 69 | 6e 61 72 79 20 79 65 61 |12 (ordi|nary yea|
|00003740| 72 29 20 6f 72 20 31 33 | 20 28 66 75 6c 6c 20 79 |r) or 13| (full y|
|00003750| 65 61 72 29 20 6d 6f 6e | 74 68 0a 58 2a 20 20 20 |ear) mon|th.X* |
|00003760| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 63 | | c|
|00003770| 61 6c 65 6e 64 61 72 20 | 74 68 61 74 20 6f 70 65 |alendar |that ope|
|00003780| 72 61 74 65 64 20 69 6e | 20 36 30 20 79 65 61 72 |rated in| 60 year|
|00003790| 20 63 79 63 6c 65 73 0a | 58 2a 20 20 20 20 20 20 | cycles.|X* |
|000037a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 59 65 61 72 | | Year|
|000037b0| 73 20 62 65 67 61 6e 20 | 77 69 74 68 20 74 68 65 |s began |with the|
|000037c0| 20 6c 75 6e 61 72 20 6d | 6f 6e 74 68 20 74 68 61 | lunar m|onth tha|
|000037d0| 74 20 68 61 64 20 74 68 | 65 20 73 75 6e 0a 58 2a |t had th|e sun.X*|
|000037e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000037f0| 20 20 65 6e 74 65 72 20 | 74 68 65 20 7a 6f 64 69 | enter |the zodi|
|00003800| 61 63 61 6c 20 73 69 67 | 6e 20 41 71 75 61 72 69 |acal sig|n Aquari|
|00003810| 75 73 0a 58 2a 0a 58 2a | 20 20 20 20 20 20 20 20 |us.X*.X*| |
|00003820| 20 20 20 20 20 20 20 20 | 20 20 4a 65 73 75 69 74 | | Jesuit|
|00003830| 20 6d 69 73 73 69 6f 6e | 61 72 69 65 73 20 74 72 | mission|aries tr|
|00003840| 69 65 64 20 74 6f 20 72 | 65 66 6f 72 6d 20 74 68 |ied to r|eform th|
|00003850| 65 20 63 61 6c 65 6e 64 | 61 72 0a 58 2a 20 20 20 |e calend|ar.X* |
|00003860| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 77 | | w|
|00003870| 68 65 6e 20 74 68 65 79 | 20 61 72 72 69 76 65 64 |hen they| arrived|
|00003880| 20 69 6e 20 74 68 65 20 | 31 36 30 30 73 2e 20 20 | in the |1600s. |
|00003890| 49 20 68 61 76 65 6e 27 | 74 20 66 6f 75 6e 64 0a |I haven'|t found.|
|000038a0| 58 2a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |X* | |
|000038b0| 20 20 20 20 6f 75 74 20 | 74 68 65 20 66 75 6c 6c | out |the full|
|000038c0| 20 72 61 6d 69 66 69 63 | 61 74 69 6f 6e 73 20 6f | ramific|ations o|
|000038d0| 66 20 74 68 61 74 20 61 | 74 74 65 6d 70 74 2e 20 |f that a|ttempt. |
|000038e0| 20 57 68 61 74 20 49 0a | 58 2a 20 20 20 20 20 20 | What I.|X* |
|000038f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 68 61 76 65 | | have|
|00003900| 20 73 65 65 6e 20 69 73 | 20 74 68 61 74 20 74 68 | seen is| that th|
|00003910| 65 20 63 61 6c 65 6e 64 | 61 72 20 77 61 73 20 61 |e calend|ar was a|
|00003920| 67 61 69 6e 20 63 68 61 | 6e 67 65 64 20 62 79 0a |gain cha|nged by.|
|00003930| 58 2a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |X* | |
|00003940| 20 20 20 20 74 68 65 20 | 43 68 69 6e 65 73 65 20 | the |Chinese |
|00003950| 61 66 74 65 72 20 74 68 | 61 74 3b 20 74 68 69 73 |after th|at; this|
|00003960| 20 69 6e 74 72 6f 64 75 | 63 65 64 20 73 6f 6d 65 | introdu|ced some|
|00003970| 20 65 72 72 6f 72 73 2e | 0a 58 2a 0a 58 2a 20 20 | errors.|.X*.X* |
|00003980| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003990| 4e 6f 77 2c 20 77 68 61 | 74 20 74 68 61 74 20 6d |Now, wha|t that m|
|000039a0| 65 61 6e 73 20 66 6f 72 | 20 63 6f 6e 76 65 72 74 |eans for| convert|
|000039b0| 69 6e 67 20 79 65 61 72 | 73 20 69 73 0a 58 2a 20 |ing year|s is.X* |
|000039c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000039d0| 20 61 20 6c 6f 74 20 6f | 66 20 77 6f 72 6b 2e 2e | a lot o|f work..|
|000039e0| 2e 0a 58 2a 0a 58 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |..X*.X**|********|
|000039f0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003a00| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003a10| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003a20| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2f 0a 58 69 |********|****/.Xi|
|00003a30| 6e 74 20 63 68 69 6e 61 | 5f 65 61 72 6c 79 28 79 |nt china|_early(y|
|00003a40| 65 61 72 2c 20 63 68 61 | 6e 67 65 5f 79 65 61 72 |ear, cha|nge_year|
|00003a50| 29 0a 58 20 20 20 20 69 | 6e 74 20 79 65 61 72 3b |).X i|nt year;|
|00003a60| 0a 58 20 20 20 20 69 6e | 74 20 63 68 61 6e 67 65 |.X in|t change|
|00003a70| 5f 79 65 61 72 3b 0a 58 | 7b 0a 58 20 20 20 20 2f |_year;.X|{.X /|
|00003a80| 2a 20 70 75 6e 74 20 2a | 2f 0a 58 20 20 20 20 72 |* punt *|/.X r|
|00003a90| 65 74 75 72 6e 28 2d 31 | 29 3b 0a 58 7d 0a 58 0a |eturn(-1|);.X}.X.|
|00003aa0| 58 0a 58 0a 58 2f 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |X.X.X/**|********|
|00003ab0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003ac0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003ad0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003ae0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 0a 58 2a 0a |********|****.X*.|
|00003af0| 58 2a 20 66 72 61 6e 63 | 65 5f 65 61 72 6c 79 28 |X* franc|e_early(|
|00003b00| 29 20 2d 2d 20 64 65 61 | 6c 20 77 69 74 68 20 46 |) -- dea|l with F|
|00003b10| 72 61 6e 63 65 27 73 20 | 75 73 65 20 6f 66 20 74 |rance's |use of t|
|00003b20| 68 65 20 52 65 70 75 62 | 6c 69 63 20 63 61 6c 65 |he Repub|lic cale|
|00003b30| 6e 64 61 72 0a 58 2a 20 | 20 20 20 20 20 20 20 20 |ndar.X* | |
|00003b40| 20 20 20 20 20 20 20 20 | 20 20 66 6f 72 20 74 68 | | for th|
|00003b50| 65 20 79 65 61 72 73 20 | 31 37 39 33 2d 31 38 30 |e years |1793-180|
|00003b60| 35 0a 58 2a 0a 58 2a 20 | 20 20 20 54 68 65 20 52 |5.X*.X* | The R|
|00003b70| 65 76 6f 6c 75 74 69 6f | 6e 61 72 79 20 43 61 6c |evolutio|nary Cal|
|00003b80| 65 6e 64 61 72 20 77 61 | 73 20 61 20 62 61 73 65 |endar wa|s a base|
|00003b90| 20 31 30 20 63 61 6c 65 | 6e 64 61 72 2e 20 20 54 | 10 cale|ndar. T|
|00003ba0| 68 61 74 20 69 73 2c 20 | 69 74 0a 58 2a 20 20 68 |hat is, |it.X* h|
|00003bb0| 61 64 20 33 36 30 20 64 | 61 79 73 20 61 72 72 61 |ad 360 d|ays arra|
|00003bc0| 6e 67 65 64 20 69 6e 20 | 31 32 20 6d 6f 6e 74 68 |nged in |12 month|
|00003bd0| 73 20 6f 66 20 33 30 20 | 64 61 79 73 20 70 6c 75 |s of 30 |days plu|
|00003be0| 73 20 35 20 6f 72 20 36 | 20 75 6e 6e 75 6d 62 65 |s 5 or 6| unnumbe|
|00003bf0| 72 65 64 0a 58 2a 20 20 | 64 61 79 73 20 74 68 61 |red.X* |days tha|
|00003c00| 74 20 77 65 72 65 20 61 | 64 64 65 64 20 74 6f 20 |t were a|dded to |
|00003c10| 74 68 65 20 65 6e 64 20 | 6f 66 20 74 68 65 20 6c |the end |of the l|
|00003c20| 61 73 74 20 6d 6f 6e 74 | 68 2e 20 20 45 61 63 68 |ast mont|h. Each|
|00003c30| 20 64 61 79 20 77 61 73 | 20 31 30 0a 58 2a 20 20 | day was| 10.X* |
|00003c40| 68 6f 75 72 73 20 6f 66 | 20 31 30 30 20 6d 69 6e |hours of| 100 min|
|00003c50| 75 74 65 73 20 6f 66 20 | 31 30 30 20 73 65 63 6f |utes of |100 seco|
|00003c60| 6e 64 73 20 6c 6f 6e 67 | 2e 0a 58 2a 0a 58 2a 20 |nds long|..X*.X* |
|00003c70| 20 20 20 49 74 20 77 61 | 73 20 72 65 6a 65 63 74 | It wa|s reject|
|00003c80| 65 64 20 61 66 74 65 72 | 20 6f 76 65 72 20 61 20 |ed after| over a |
|00003c90| 64 65 63 61 64 65 20 6f | 66 20 75 73 65 20 6d 61 |decade o|f use ma|
|00003ca0| 69 6e 6c 79 20 62 65 63 | 61 75 73 65 20 6f 66 20 |inly bec|ause of |
|00003cb0| 69 74 73 0a 58 2a 20 20 | 6f 70 70 6f 73 69 74 69 |its.X* |oppositi|
|00003cc0| 6f 6e 20 66 72 6f 6d 20 | 72 65 6c 69 67 69 6f 75 |on from |religiou|
|00003cd0| 73 20 67 72 6f 75 70 73 | 20 77 68 6f 20 64 69 64 |s groups| who did|
|00003ce0| 20 6e 6f 74 20 61 70 70 | 72 6f 76 65 20 6f 66 20 | not app|rove of |
|00003cf0| 77 65 65 6b 73 20 74 68 | 61 74 0a 58 2a 20 20 77 |weeks th|at.X* w|
|00003d00| 65 72 65 20 73 65 76 65 | 6e 20 64 61 79 73 20 6c |ere seve|n days l|
|00003d10| 6f 6e 67 2e 0a 58 2a 0a | 58 2a 2a 2a 2a 2a 2a 2a |ong..X*.|X*******|
|00003d20| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003d30| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003d40| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003d50| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2f |********|*******/|
|00003d60| 0a 58 69 6e 74 20 66 72 | 61 6e 63 65 5f 65 61 72 |.Xint fr|ance_ear|
|00003d70| 6c 79 28 79 65 61 72 2c | 20 63 68 61 6e 67 65 5f |ly(year,| change_|
|00003d80| 79 65 61 72 29 0a 58 20 | 20 20 20 69 6e 74 20 79 |year).X | int y|
|00003d90| 65 61 72 3b 0a 58 20 20 | 20 20 69 6e 74 20 63 68 |ear;.X | int ch|
|00003da0| 61 6e 67 65 5f 79 65 61 | 72 3b 0a 58 7b 0a 58 20 |ange_yea|r;.X{.X |
|00003db0| 20 20 20 2f 2a 20 52 65 | 70 75 62 6c 69 63 20 2d | /* Re|public -|
|00003dc0| 2d 3e 20 47 72 65 67 6f | 72 69 61 6e 20 2a 2f 0a |-> Grego|rian */.|
|00003dd0| 58 20 20 20 20 69 66 20 | 28 79 65 61 72 20 3d 3d |X if |(year ==|
|00003de0| 20 31 38 30 36 29 0a 58 | 09 72 65 74 75 72 6e 28 | 1806).X|.return(|
|00003df0| 33 36 35 29 3b 09 2f 2a | 20 3f 20 2a 2f 0a 58 0a |365);./*| ? */.X.|
|00003e00| 58 20 20 20 20 2f 2a 20 | 52 65 70 75 62 6c 69 63 |X /* |Republic|
|00003e10| 20 43 61 6c 65 6e 64 61 | 72 20 2d 2d 20 66 6f 6c | Calenda|r -- fol|
|00003e20| 6c 6f 77 73 20 4a 75 6c | 69 61 6e 20 6c 65 61 70 |lows Jul|ian leap|
|00003e30| 2d 79 65 61 72 20 72 75 | 6c 65 20 2a 2f 0a 58 20 |-year ru|le */.X |
|00003e40| 20 20 20 69 66 20 28 79 | 65 61 72 20 3e 20 31 37 | if (y|ear > 17|
|00003e50| 39 33 20 20 7c 7c 20 20 | 79 65 61 72 20 3c 20 31 |93 || |year < 1|
|00003e60| 38 30 36 29 0a 58 20 20 | 20 20 7b 0a 58 09 69 66 |806).X | {.X.if|
|00003e70| 20 28 28 79 65 61 72 20 | 26 20 30 33 29 20 3d 3d | ((year |& 03) ==|
|00003e80| 20 30 29 0a 58 09 20 20 | 20 20 72 65 74 75 72 6e | 0).X. | return|
|00003e90| 28 33 36 36 29 3b 0a 58 | 09 65 6c 73 65 0a 58 09 |(366);.X|.else.X.|
|00003ea0| 20 20 20 20 72 65 74 75 | 72 6e 28 33 36 35 29 3b | retu|rn(365);|
|00003eb0| 0a 58 20 20 20 20 7d 0a | 58 0a 58 20 20 20 20 2f |.X }.|X.X /|
|00003ec0| 2a 20 47 72 65 67 6f 72 | 69 61 6e 20 2d 2d 3e 20 |* Gregor|ian --> |
|00003ed0| 52 65 70 75 62 6c 69 63 | 20 2a 2f 0a 58 20 20 20 |Republic| */.X |
|00003ee0| 20 69 66 20 28 79 65 61 | 72 20 3d 3d 20 31 37 39 | if (yea|r == 179|
|00003ef0| 33 29 0a 58 09 72 65 74 | 75 72 6e 28 33 36 35 29 |3).X.ret|urn(365)|
|00003f00| 3b 0a 58 0a 58 20 20 20 | 20 2f 2a 20 47 72 65 67 |;.X.X | /* Greg|
|00003f10| 6f 72 69 61 6e 20 2a 2f | 0a 58 20 20 20 20 69 66 |orian */|.X if|
|00003f20| 20 28 79 65 61 72 20 3e | 20 31 35 38 32 20 20 7c | (year >| 1582 ||
|00003f30| 7c 20 20 79 65 61 72 20 | 3c 20 31 37 39 33 29 0a || year |< 1793).|
|00003f40| 58 20 20 20 20 7b 0a 58 | 09 69 66 20 28 28 79 65 |X {.X|.if ((ye|
|00003f50| 61 72 26 30 78 33 29 3d | 3d 30 20 26 26 20 28 28 |ar&0x3)=|=0 && ((|
|00003f60| 79 65 61 72 26 30 78 46 | 29 3d 3d 30 20 7c 7c 20 |year&0xF|)==0 || |
|00003f70| 79 65 61 72 25 31 30 30 | 29 29 0a 58 09 20 20 20 |year%100|)).X. |
|00003f80| 72 65 74 75 72 6e 28 33 | 36 36 29 3b 0a 58 09 65 |return(3|66);.X.e|
|00003f90| 6c 73 65 0a 58 09 20 20 | 20 72 65 74 75 72 6e 28 |lse.X. | return(|
|00003fa0| 33 36 35 29 3b 0a 58 20 | 20 20 20 7d 0a 58 0a 58 |365);.X | }.X.X|
|00003fb0| 20 20 20 20 2f 2a 20 4a | 75 6c 69 61 6e 20 2d 2d | /* J|ulian --|
|00003fc0| 3e 20 47 72 65 67 6f 72 | 69 61 6e 20 2a 2f 0a 58 |> Gregor|ian */.X|
|00003fd0| 20 20 20 20 69 66 20 28 | 79 65 61 72 20 3d 3d 20 | if (|year == |
|00003fe0| 31 35 38 32 29 0a 58 09 | 72 65 74 75 72 6e 28 33 |1582).X.|return(3|
|00003ff0| 36 35 2d 31 30 29 3b 09 | 09 2f 2a 20 64 72 6f 70 |65-10);.|./* drop|
|00004000| 70 65 64 20 74 68 65 20 | 64 61 79 73 20 31 32 2f |ped the |days 12/|
|00004010| 31 30 20 2d 20 31 32 2f | 32 30 20 2a 2f 0a 58 0a |10 - 12/|20 */.X.|
|00004020| 58 20 20 20 20 2f 2a 20 | 4a 75 6c 69 61 6e 20 2a |X /* |Julian *|
|00004030| 2f 0a 58 20 20 20 20 69 | 66 20 28 28 79 65 61 72 |/.X i|f ((year|
|00004040| 20 26 20 30 33 29 20 3d | 3d 20 30 29 0a 58 09 72 | & 03) =|= 0).X.r|
|00004050| 65 74 75 72 6e 28 33 36 | 36 29 3b 0a 58 20 20 20 |eturn(36|6);.X |
|00004060| 20 65 6c 73 65 0a 58 09 | 72 65 74 75 72 6e 28 33 | else.X.|return(3|
|00004070| 36 35 29 3b 0a 58 7d 0a | 58 0a 58 0a 58 2f 2a 2a |65);.X}.|X.X.X/**|
|00004080| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004090| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000040a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000040b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000040c0| 2a 2a 2a 2a 0a 58 2a 0a | 58 2a 20 67 65 72 6d 61 |****.X*.|X* germa|
|000040d0| 6e 5f 65 61 72 6c 79 28 | 29 20 2d 2d 20 64 65 61 |n_early(|) -- dea|
|000040e0| 6c 20 77 69 74 68 20 70 | 72 6f 62 6c 65 6d 20 6f |l with p|roblem o|
|000040f0| 66 20 63 6f 75 6e 74 72 | 79 20 61 64 6f 70 74 69 |f countr|y adopti|
|00004100| 6e 67 20 74 68 65 0a 58 | 2a 20 20 20 20 20 20 20 |ng the.X|* |
|00004110| 20 20 20 20 20 20 20 20 | 20 20 20 20 47 72 65 67 | | Greg|
|00004120| 6f 72 69 61 6e 20 63 61 | 6c 65 6e 64 61 72 20 69 |orian ca|lendar i|
|00004130| 6e 20 70 61 72 74 73 0a | 58 2a 0a 58 2a 20 20 47 |n parts.|X*.X* G|
|00004140| 72 65 67 6f 72 69 61 6e | 20 63 61 6c 65 6e 64 61 |regorian| calenda|
|00004150| 72 20 77 61 73 20 61 64 | 6f 70 74 65 64 20 69 6e |r was ad|opted in|
|00004160| 20 6f 76 65 72 6c 61 70 | 70 69 6e 67 20 70 61 72 | overlap|ping par|
|00004170| 74 73 3a 0a 58 2a 20 20 | 20 20 20 20 31 30 2f 31 |ts:.X* | 10/1|
|00004180| 36 2f 31 35 38 33 20 20 | 20 42 61 76 61 72 69 61 |6/1583 | Bavaria|
|00004190| 0a 58 2a 20 20 20 20 20 | 20 31 31 2f 31 34 2f 31 |.X* | 11/14/1|
|000041a0| 35 38 33 20 20 20 74 68 | 65 20 43 61 74 68 6f 6c |583 th|e Cathol|
|000041b0| 69 63 20 70 6f 70 75 6c | 61 74 69 6f 6e 0a 58 2a |ic popul|ation.X*|
|000041c0| 20 20 20 20 20 20 20 33 | 2f 30 31 2f 31 36 38 32 | 3|/01/1682|
|000041d0| 20 20 20 53 74 72 61 73 | 73 62 75 72 67 0a 58 2a | Stras|sburg.X*|
|000041e0| 20 20 20 20 20 20 31 31 | 2f 31 35 2f 31 36 39 39 | 11|/15/1699|
|000041f0| 20 20 20 74 68 65 20 50 | 72 6f 74 65 73 74 61 6e | the P|rotestan|
|00004200| 74 20 70 6f 70 75 6c 61 | 74 69 6f 6e 0a 58 2a 20 |t popula|tion.X* |
|00004210| 20 20 20 20 20 31 32 2f | 31 32 2f 31 37 30 30 20 | 12/|12/1700 |
|00004220| 20 20 55 74 72 65 63 68 | 74 0a 58 2a 0a 58 2a 20 | Utrech|t.X*.X* |
|00004230| 20 49 20 68 61 76 65 20 | 74 68 65 20 6c 61 73 74 | I have |the last|
|00004240| 20 64 61 74 65 20 28 31 | 37 30 30 29 20 69 6e 20 | date (1|700) in |
|00004250| 74 68 65 20 74 61 62 6c | 65 20 66 6f 72 20 74 68 |the tabl|e for th|
|00004260| 65 20 65 6e 74 69 72 65 | 20 63 6f 75 6e 74 72 79 |e entire| country|
|00004270| 2e 0a 58 2a 20 20 49 66 | 20 79 6f 75 20 77 61 6e |..X* If| you wan|
|00004280| 74 20 6d 6f 72 65 20 61 | 63 63 75 72 61 63 79 20 |t more a|ccuracy |
|00004290| 69 6e 20 64 65 61 6c 69 | 6e 67 20 77 69 74 68 20 |in deali|ng with |
|000042a0| 74 68 65 20 70 61 72 74 | 69 61 6c 20 63 68 61 6e |the part|ial chan|
|000042b0| 67 65 73 2c 0a 58 2a 20 | 20 6d 61 6b 65 20 6d 6f |ges,.X* | make mo|
|000042c0| 64 69 66 69 63 61 74 69 | 6f 6e 73 20 74 6f 20 74 |dificati|ons to t|
|000042d0| 68 65 20 63 6f 75 6e 74 | 72 79 20 74 61 62 6c 65 |he count|ry table|
|000042e0| 20 61 6e 64 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 | and the| followi|
|000042f0| 6e 67 20 63 6f 64 65 2e | 0a 58 2a 0a 58 2a 2a 2a |ng code.|.X*.X***|
|00004300| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004310| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004320| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004330| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004340| 2a 2a 2a 2f 0a 58 69 6e | 74 20 67 65 72 6d 61 6e |***/.Xin|t german|
|00004350| 5f 65 61 72 6c 79 28 79 | 65 61 72 2c 20 63 68 61 |_early(y|ear, cha|
|00004360| 6e 67 65 5f 79 65 61 72 | 29 0a 58 20 20 20 20 69 |nge_year|).X i|
|00004370| 6e 74 20 79 65 61 72 3b | 0a 58 20 20 20 20 69 6e |nt year;|.X in|
|00004380| 74 20 63 68 61 6e 67 65 | 5f 79 65 61 72 3b 0a 58 |t change|_year;.X|
|00004390| 7b 0a 58 20 20 20 20 2f | 2a 20 64 65 61 6c 20 77 |{.X /|* deal w|
|000043a0| 69 74 68 20 63 68 61 6e | 67 65 2d 6f 76 65 72 20 |ith chan|ge-over |
|000043b0| 64 61 74 65 20 2a 2f 0a | 58 20 20 20 20 69 66 20 |date */.|X if |
|000043c0| 28 79 65 61 72 20 3d 3d | 20 63 68 61 6e 67 65 5f |(year ==| change_|
|000043d0| 79 65 61 72 29 0a 58 09 | 72 65 74 75 72 6e 28 33 |year).X.|return(3|
|000043e0| 36 36 2d 31 31 29 3b 09 | 09 09 2f 2a 20 31 37 30 |66-11);.|../* 170|
|000043f0| 30 20 69 73 20 61 20 6c | 65 61 70 20 79 65 61 72 |0 is a l|eap year|
|00004400| 20 2a 2f 0a 58 0a 58 20 | 20 20 20 2f 2a 20 65 6c | */.X.X | /* el|
|00004410| 73 65 2c 20 64 6f 20 6e | 6f 72 6d 61 6c 20 4a 75 |se, do n|ormal Ju|
|00004420| 6c 69 61 6e 20 72 75 6c | 65 73 20 2a 2f 0a 58 20 |lian rul|es */.X |
|00004430| 20 20 20 69 66 20 28 28 | 79 65 61 72 20 26 20 30 | if ((|year & 0|
|00004440| 33 29 20 3d 3d 20 30 29 | 0a 58 09 72 65 74 75 72 |3) == 0)|.X.retur|
|00004450| 6e 28 33 36 36 29 3b 0a | 58 20 20 20 20 65 6c 73 |n(366);.|X els|
|00004460| 65 0a 58 09 72 65 74 75 | 72 6e 28 33 36 35 29 3b |e.X.retu|rn(365);|
|00004470| 0a 58 7d 0a 58 0a 58 0a | 58 0a 58 2f 2a 2a 2a 2a |.X}.X.X.|X.X/****|
|00004480| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004490| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000044a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000044b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000044c0| 2a 2a 0a 58 2a 0a 58 2a | 20 67 72 65 65 63 65 5f |**.X*.X*| greece_|
|000044d0| 65 61 72 6c 79 28 29 20 | 2d 2d 20 63 6f 75 6e 74 |early() |-- count|
|000044e0| 72 79 20 64 69 64 20 6e | 6f 74 20 63 68 61 6e 67 |ry did n|ot chang|
|000044f0| 65 20 61 6c 6c 20 61 74 | 20 6f 6e 65 20 74 69 6d |e all at| one tim|
|00004500| 65 0a 58 2a 0a 58 2a 20 | 20 20 20 54 68 65 20 63 |e.X*.X* | The c|
|00004510| 68 61 6e 67 65 73 20 74 | 68 61 74 20 6f 63 63 75 |hanges t|hat occu|
|00004520| 72 72 65 64 20 61 72 65 | 3a 0a 58 2a 0a 58 2a 20 |rred are|:.X*.X* |
|00004530| 20 20 20 20 20 20 20 30 | 37 2f 31 35 2f 31 39 31 | 0|7/15/191|
|00004540| 36 20 20 43 61 6c 65 6e | 64 61 72 20 63 68 61 6e |6 Calen|dar chan|
|00004550| 67 65 20 61 64 6f 70 74 | 65 64 20 62 79 20 61 6c |ge adopt|ed by al|
|00004560| 6c 20 65 78 63 65 70 74 | 2e 2e 2e 0a 58 2a 20 20 |l except|....X* |
|00004570| 20 20 20 20 20 20 30 39 | 2f 33 30 2f 31 39 32 33 | 09|/30/1923|
|00004580| 20 20 2e 2e 2e 74 68 65 | 20 47 72 65 65 6b 20 43 | ...the| Greek C|
|00004590| 68 75 72 63 68 2c 20 77 | 68 69 63 68 20 66 69 6e |hurch, w|hich fin|
|000045a0| 61 6c 6c 79 20 61 63 63 | 65 70 74 65 64 20 69 74 |ally acc|epted it|
|000045b0| 0a 58 2a 0a 58 2a 20 20 | 20 20 54 68 65 20 74 61 |.X*.X* | The ta|
|000045c0| 62 6c 65 20 75 73 65 73 | 20 74 68 65 20 6c 61 74 |ble uses| the lat|
|000045d0| 74 65 72 20 64 61 74 65 | 2e 20 20 48 61 63 6b 20 |ter date|. Hack |
|000045e0| 74 68 69 73 20 69 66 20 | 79 6f 75 20 64 6f 6e 27 |this if |you don'|
|000045f0| 74 20 6c 69 6b 65 20 69 | 74 2e 0a 58 2a 20 20 20 |t like i|t..X* |
|00004600| 20 41 20 77 61 72 6e 69 | 6e 67 3a 20 20 6f 6e 65 | A warni|ng: one|
|00004610| 20 72 65 66 65 72 65 6e | 63 65 20 73 65 65 6d 65 | referen|ce seeme|
|00004620| 64 20 74 6f 20 69 6e 64 | 69 63 61 74 65 64 20 28 |d to ind|icated (|
|00004630| 69 74 20 77 61 73 6e 27 | 74 20 63 6c 65 61 72 20 |it wasn'|t clear |
|00004640| 69 66 0a 58 2a 20 20 20 | 20 69 74 20 68 61 64 20 |if.X* | it had |
|00004650| 62 65 65 6e 20 6a 75 73 | 74 20 70 72 6f 70 6f 73 |been jus|t propos|
|00004660| 65 64 20 6f 72 20 69 74 | 20 77 61 73 20 61 63 63 |ed or it| was acc|
|00004670| 65 70 74 65 64 29 20 74 | 68 61 74 20 47 72 65 65 |epted) t|hat Gree|
|00004680| 63 65 20 69 73 20 75 73 | 69 6e 67 20 61 0a 58 2a |ce is us|ing a.X*|
|00004690| 20 20 20 20 6d 6f 64 69 | 66 69 65 64 20 4a 75 6c | modi|fied Jul|
|000046a0| 69 61 6e 20 63 61 6c 65 | 6e 64 61 72 20 74 68 61 |ian cale|ndar tha|
|000046b0| 74 20 68 61 73 20 74 77 | 6f 20 6c 65 61 70 20 63 |t has tw|o leap c|
|000046c0| 65 6e 74 75 72 69 65 73 | 20 6f 75 74 20 6f 66 20 |enturies| out of |
|000046d0| 2a 6e 69 6e 65 2a 2e 0a | 58 2a 20 20 20 20 49 66 |*nine*..|X* If|
|000046e0| 20 74 68 69 73 20 69 73 | 20 74 72 75 65 2c 20 74 | this is| true, t|
|000046f0| 68 65 6e 20 64 61 74 65 | 73 20 61 66 74 65 72 20 |hen date|s after |
|00004700| 32 38 30 30 20 77 69 6c | 6c 20 62 65 20 64 69 66 |2800 wil|l be dif|
|00004710| 66 65 72 65 6e 74 20 66 | 72 6f 6d 0a 58 2a 20 20 |ferent f|rom.X* |
|00004720| 20 20 74 68 65 20 47 72 | 65 67 6f 72 69 61 6e 20 | the Gr|egorian |
|00004730| 63 61 6c 65 6e 64 61 72 | 2e 0a 58 2a 0a 58 2a 2a |calendar|..X*.X**|
|00004740| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004750| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004760| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004770| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004780| 2a 2a 2a 2a 2f 0a 58 69 | 6e 74 20 67 72 65 65 63 |****/.Xi|nt greec|
|00004790| 65 5f 65 61 72 6c 79 28 | 79 65 61 72 2c 20 63 68 |e_early(|year, ch|
|000047a0| 61 6e 67 65 5f 79 65 61 | 72 29 0a 58 20 20 20 20 |ange_yea|r).X |
|000047b0| 69 6e 74 20 79 65 61 72 | 3b 0a 58 20 20 20 20 69 |int year|;.X i|
|000047c0| 6e 74 20 63 68 61 6e 67 | 65 5f 79 65 61 72 3b 0a |nt chang|e_year;.|
|000047d0| 58 7b 0a 58 20 20 20 20 | 2f 2a 20 64 6f 20 63 68 |X{.X |/* do ch|
|000047e0| 61 6e 67 65 2d 6f 76 65 | 72 20 79 65 61 72 20 2a |ange-ove|r year *|
|000047f0| 2f 0a 58 20 20 20 20 69 | 66 20 28 79 65 61 72 20 |/.X i|f (year |
|00004800| 3d 3d 20 63 68 61 6e 67 | 65 5f 79 65 61 72 29 0a |== chang|e_year).|
|00004810| 58 09 72 65 74 75 72 6e | 28 33 36 35 2d 31 33 29 |X.return|(365-13)|
|00004820| 3b 09 09 2f 2a 20 31 39 | 32 33 20 77 61 73 20 6e |;../* 19|23 was n|
|00004830| 6f 74 20 61 20 6c 65 61 | 70 20 79 65 61 72 20 2a |ot a lea|p year *|
|00004840| 2f 0a 58 0a 58 20 20 20 | 20 2f 2a 20 64 6f 20 6e |/.X.X | /* do n|
|00004850| 6f 72 6d 61 6c 20 4a 75 | 6c 69 61 6e 20 72 75 6c |ormal Ju|lian rul|
|00004860| 65 73 20 2a 2f 0a 58 20 | 20 20 20 69 66 20 28 28 |es */.X | if ((|
|00004870| 79 65 61 72 20 26 20 30 | 33 29 20 3d 3d 20 30 29 |year & 0|3) == 0)|
|00004880| 0a 58 09 72 65 74 75 72 | 6e 28 33 36 36 29 3b 0a |.X.retur|n(366);.|
|00004890| 58 20 20 20 20 65 6c 73 | 65 0a 58 09 72 65 74 75 |X els|e.X.retu|
|000048a0| 72 6e 28 33 36 35 29 3b | 0a 58 7d 0a 58 0a 58 0a |rn(365);|.X}.X.X.|
|000048b0| 58 2f 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |X/******|********|
|000048c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000048d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000048e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000048f0| 2a 2a 2a 2a 2a 2a 2a 2a | 0a 58 2a 0a 58 2a 20 69 |********|.X*.X* i|
|00004900| 72 61 6e 5f 65 61 72 6c | 79 28 29 20 2d 2d 20 75 |ran_earl|y() -- u|
|00004910| 73 65 73 20 74 68 65 20 | 4d 6f 6e 61 72 63 68 69 |ses the |Monarchi|
|00004920| 63 20 43 61 6c 65 6e 64 | 61 72 0a 58 2a 0a 58 2a |c Calend|ar.X*.X*|
|00004930| 20 20 49 20 64 6f 6e 27 | 74 20 6b 6e 6f 77 20 68 | I don'|t know h|
|00004940| 6f 77 20 69 66 20 6f 72 | 20 77 68 65 6e 20 47 72 |ow if or| when Gr|
|00004950| 65 67 6f 72 69 61 6e 20 | 77 61 73 20 75 73 65 64 |egorian |was used|
|00004960| 2e 20 20 54 68 65 20 4d | 75 73 6c 69 6d 0a 58 2a |. The M|uslim.X*|
|00004970| 20 20 63 61 6c 65 6e 64 | 61 72 20 6d 61 79 20 73 | calend|ar may s|
|00004980| 74 69 6c 6c 20 62 65 20 | 75 73 65 64 20 28 69 74 |till be |used (it|
|00004990| 20 69 73 20 61 20 31 32 | 20 6d 6f 6e 74 68 20 63 | is a 12| month c|
|000049a0| 61 6c 65 6e 64 61 72 20 | 77 69 74 68 20 61 20 33 |alendar |with a 3|
|000049b0| 30 0a 58 2a 20 20 79 65 | 61 72 20 63 79 63 6c 65 |0.X* ye|ar cycle|
|000049c0| 3b 20 20 65 6c 65 76 65 | 6e 20 64 61 79 73 20 61 |; eleve|n days a|
|000049d0| 72 65 20 61 64 64 65 64 | 20 6f 76 65 72 20 74 68 |re added| over th|
|000049e0| 65 20 63 79 63 6c 65 29 | 20 66 6f 72 20 64 61 69 |e cycle)| for dai|
|000049f0| 6c 79 20 6f 72 0a 58 2a | 20 20 72 65 6c 69 67 69 |ly or.X*| religi|
|00004a00| 6f 75 73 20 6f 72 20 65 | 76 65 6e 20 47 6f 76 65 |ous or e|ven Gove|
|00004a10| 72 6e 6d 65 6e 74 20 66 | 75 6e 63 74 69 6f 6e 73 |rnment f|unctions|
|00004a20| 2e 0a 58 2a 0a 58 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |..X*.X**|********|
|00004a30| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004a40| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004a50| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004a60| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2f 0a 58 69 |********|****/.Xi|
|00004a70| 6e 74 20 69 72 61 6e 5f | 65 61 72 6c 79 28 79 65 |nt iran_|early(ye|
|00004a80| 61 72 2c 20 63 68 61 6e | 67 65 5f 79 65 61 72 29 |ar, chan|ge_year)|
|00004a90| 0a 58 20 20 20 20 69 6e | 74 20 79 65 61 72 3b 0a |.X in|t year;.|
|00004aa0| 58 20 20 20 20 69 6e 74 | 20 63 68 61 6e 67 65 5f |X int| change_|
|00004ab0| 79 65 61 72 3b 0a 58 7b | 0a 58 20 20 20 20 72 65 |year;.X{|.X re|
|00004ac0| 74 75 72 6e 28 2d 31 29 | 3b 0a 58 7d 0a 58 0a 58 |turn(-1)|;.X}.X.X|
|00004ad0| 0a 58 2f 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |.X/*****|********|
|00004ae0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004af0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004b00| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004b10| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 0a 58 2a 0a 58 2a 20 |********|*.X*.X* |
|00004b20| 6a 61 70 61 6e 5f 65 61 | 72 6c 79 28 29 20 2d 2d |japan_ea|rly() --|
|00004b30| 20 64 65 61 6c 20 77 69 | 74 68 20 4a 61 70 61 6e | deal wi|th Japan|
|00004b40| 65 73 65 20 6c 75 6e 61 | 72 20 63 61 6c 65 6e 64 |ese luna|r calend|
|00004b50| 61 72 0a 58 2a 0a 58 2a | 20 20 20 55 6e 66 6f 72 |ar.X*.X*| Unfor|
|00004b60| 74 75 6e 61 74 65 6c 79 | 2c 20 49 20 68 61 76 65 |tunately|, I have|
|00004b70| 20 62 65 65 6e 20 75 6e | 61 62 6c 65 20 74 6f 20 | been un|able to |
|00004b80| 66 69 6e 64 20 61 6e 79 | 20 64 65 74 61 69 6c 65 |find any| detaile|
|00004b90| 64 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 0a 58 2a |d inform|ation.X*|
|00004ba0| 20 20 20 6f 6e 20 74 68 | 65 20 63 61 6c 65 6e 64 | on th|e calend|
|00004bb0| 61 72 20 75 73 65 64 20 | 70 72 69 6f 72 20 74 6f |ar used |prior to|
|00004bc0| 20 74 68 65 20 61 64 6f | 70 74 69 6f 6e 20 6f 66 | the ado|ption of|
|00004bd0| 20 74 68 65 20 47 72 65 | 67 6f 72 69 61 6e 20 63 | the Gre|gorian c|
|00004be0| 61 6c 65 6e 64 61 72 2e | 0a 58 2a 0a 58 2a 20 20 |alendar.|.X*.X* |
|00004bf0| 20 49 66 20 61 6e 79 6f | 6e 65 20 68 61 73 20 73 | If anyo|ne has s|
|00004c00| 6f 6d 65 20 69 6e 66 6f | 2c 20 49 27 64 20 6c 69 |ome info|, I'd li|
|00004c10| 6b 65 20 74 6f 20 72 65 | 63 65 69 76 65 20 69 74 |ke to re|ceive it|
|00004c20| 2e 0a 58 2a 0a 58 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |..X*.X**|********|
|00004c30| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004c40| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004c50| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004c60| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2f 0a 58 69 |********|****/.Xi|
|00004c70| 6e 74 20 6a 61 70 61 6e | 5f 65 61 72 6c 79 28 79 |nt japan|_early(y|
|00004c80| 65 61 72 2c 20 63 68 61 | 6e 67 65 5f 79 65 61 72 |ear, cha|nge_year|
|00004c90| 29 0a 58 20 20 20 20 69 | 6e 74 20 79 65 61 72 3b |).X i|nt year;|
|00004ca0| 0a 58 20 20 20 20 69 6e | 74 20 63 68 61 6e 67 65 |.X in|t change|
|00004cb0| 5f 79 65 61 72 3b 0a 58 | 7b 0a 58 20 20 20 20 72 |_year;.X|{.X r|
|00004cc0| 65 74 75 72 6e 28 2d 31 | 29 3b 0a 58 7d 0a 58 0a |eturn(-1|);.X}.X.|
|00004cd0| 58 0a 58 2f 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |X.X/****|********|
|00004ce0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004cf0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004d00| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004d10| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 0a 58 2a 0a 58 2a |********|**.X*.X*|
|00004d20| 20 6e 65 74 68 65 72 6c | 61 6e 64 73 5f 65 61 72 | netherl|ands_ear|
|00004d30| 6c 79 28 29 20 2d 2d 20 | 64 65 61 6c 20 77 69 74 |ly() -- |deal wit|
|00004d40| 68 20 73 63 61 74 74 65 | 72 65 64 20 61 64 6f 70 |h scatte|red adop|
|00004d50| 74 69 6f 6e 0a 58 2a 0a | 58 2a 20 20 41 64 6f 70 |tion.X*.|X* Adop|
|00004d60| 74 69 6f 6e 20 6f 66 20 | 74 68 65 20 47 72 65 67 |tion of |the Greg|
|00004d70| 6f 72 69 61 6e 20 63 61 | 6c 65 6e 64 61 72 20 77 |orian ca|lendar w|
|00004d80| 65 6e 74 20 62 79 20 74 | 68 65 20 66 6f 6c 6c 6f |ent by t|he follo|
|00004d90| 77 69 6e 67 20 63 69 74 | 69 65 73 3a 0a 58 2a 20 |wing cit|ies:.X* |
|00004da0| 20 20 20 20 31 32 2f 31 | 35 2f 31 35 38 32 20 20 | 12/1|5/1582 |
|00004db0| 20 48 6f 6c 6c 61 6e 64 | 2c 20 5a 65 65 6c 61 6e | Holland|, Zeelan|
|00004dc0| 64 2c 20 42 72 61 62 61 | 6e 74 2c 20 56 6c 61 61 |d, Braba|nt, Vlaa|
|00004dd0| 6e 64 65 72 6e 0a 58 2a | 20 20 20 20 20 30 36 2f |ndern.X*| 06/|
|00004de0| 33 30 2f 31 37 30 30 20 | 20 20 47 65 6c 65 72 6c |30/1700 | Gelerl|
|00004df0| 61 6e 64 0a 58 2a 20 20 | 20 20 20 31 31 2f 33 30 |and.X* | 11/30|
|00004e00| 2f 31 37 30 30 20 20 20 | 55 74 72 65 63 68 74 2c |/1700 |Utrecht,|
|00004e10| 20 4f 76 65 72 69 6a 69 | 73 6f 6c 0a 58 2a 20 20 | Overiji|sol.X* |
|00004e20| 20 20 20 31 32 2f 33 31 | 2f 31 37 30 30 20 20 20 | 12/31|/1700 |
|00004e30| 46 72 69 65 73 6c 61 6e | 64 2c 20 47 72 6f 6e 69 |Frieslan|d, Groni|
|00004e40| 6e 67 65 6e 0a 58 2a 20 | 20 20 20 20 30 31 2f 31 |ngen.X* | 01/1|
|00004e50| 32 2f 31 37 30 31 20 20 | 20 45 6e 74 69 72 65 20 |2/1701 | Entire |
|00004e60| 63 6f 75 6e 74 72 79 20 | 63 6f 6e 73 69 73 74 65 |country |consiste|
|00004e70| 6e 74 0a 58 2a 0a 58 2a | 2a 2a 2a 2a 2a 2a 2a 2a |nt.X*.X*|********|
|00004e80| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004e90| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004ea0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004eb0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2f 0a 58 |********|*****/.X|
|00004ec0| 69 6e 74 20 6e 65 74 68 | 65 72 6c 61 6e 64 73 5f |int neth|erlands_|
|00004ed0| 65 61 72 6c 79 28 79 65 | 61 72 2c 20 63 68 61 6e |early(ye|ar, chan|
|00004ee0| 67 65 5f 79 65 61 72 29 | 0a 58 20 20 20 20 69 6e |ge_year)|.X in|
|00004ef0| 74 20 79 65 61 72 3b 0a | 58 20 20 20 20 69 6e 74 |t year;.|X int|
|00004f00| 20 63 68 61 6e 67 65 5f | 79 65 61 72 3b 0a 58 7b | change_|year;.X{|
|00004f10| 0a 58 20 20 20 20 2f 2a | 20 55 73 65 20 64 61 74 |.X /*| Use dat|
|00004f20| 65 20 6f 66 20 74 6f 74 | 61 6c 20 63 6f 75 6e 74 |e of tot|al count|
|00004f30| 72 79 20 61 64 6f 70 74 | 69 6f 6e 20 2d 2d 20 31 |ry adopt|ion -- 1|
|00004f40| 37 30 31 20 2a 2f 0a 58 | 20 20 20 20 69 66 20 28 |701 */.X| if (|
|00004f50| 79 65 61 72 20 3d 3d 20 | 63 68 61 6e 67 65 5f 79 |year == |change_y|
|00004f60| 65 61 72 29 0a 58 09 72 | 65 74 75 72 6e 28 33 36 |ear).X.r|eturn(36|
|00004f70| 35 20 2d 20 31 31 29 3b | 0a 58 0a 58 20 20 20 20 |5 - 11);|.X.X |
|00004f80| 2f 2a 20 64 6f 20 6e 6f | 72 6d 61 6c 20 4a 75 6c |/* do no|rmal Jul|
|00004f90| 69 61 6e 20 72 75 6c 65 | 73 20 2a 2f 0a 58 20 20 |ian rule|s */.X |
|00004fa0| 20 20 69 66 20 28 28 79 | 65 61 72 20 26 20 30 33 | if ((y|ear & 03|
|00004fb0| 29 20 3d 3d 20 30 29 0a | 58 09 72 65 74 75 72 6e |) == 0).|X.return|
|00004fc0| 28 33 36 36 29 3b 0a 58 | 20 20 20 20 65 6c 73 65 |(366);.X| else|
|00004fd0| 0a 58 09 72 65 74 75 72 | 6e 28 33 36 35 29 3b 0a |.X.retur|n(365);.|
|00004fe0| 58 7d 0a 58 0a 58 0a 58 | 2f 2a 2a 2a 2a 2a 2a 2a |X}.X.X.X|/*******|
|00004ff0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005000| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005010| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005020| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 0a |********|*******.|
|00005030| 58 2a 0a 58 2a 20 70 6f | 6c 61 6e 64 5f 65 61 72 |X*.X* po|land_ear|
|00005040| 6c 79 28 29 20 2d 2d 20 | 64 65 61 6c 20 77 69 74 |ly() -- |deal wit|
|00005050| 68 20 63 6f 75 6e 74 72 | 79 27 73 20 70 61 72 74 |h countr|y's part|
|00005060| 69 61 6c 20 61 64 6f 70 | 74 69 6f 6e 20 64 61 74 |ial adop|tion dat|
|00005070| 65 73 0a 58 2a 0a 58 2a | 20 20 44 61 74 65 73 20 |es.X*.X*| Dates |
|00005080| 66 6f 72 20 61 64 6f 70 | 74 69 6f 6e 20 61 72 65 |for adop|tion are|
|00005090| 0a 58 2a 20 20 20 20 20 | 20 31 31 2f 30 31 2f 31 |.X* | 11/01/1|
|000050a0| 35 38 32 20 20 20 43 61 | 74 68 6f 6c 69 63 73 20 |582 Ca|tholics |
|000050b0| 28 61 6e 64 20 50 72 6f | 74 65 73 74 61 6e 74 73 |(and Pro|testants|
|000050c0| 3f 29 20 61 64 6f 70 74 | 0a 58 2a 20 20 20 20 20 |?) adopt|.X* |
|000050d0| 20 30 33 2f 31 38 2f 31 | 39 31 38 20 20 20 52 75 | 03/18/1|918 Ru|
|000050e0| 73 73 69 61 6e 20 50 6f | 6c 61 6e 64 20 63 68 61 |ssian Po|land cha|
|000050f0| 6e 67 65 73 20 28 43 69 | 76 69 6c 20 57 61 72 20 |nges (Ci|vil War |
|00005100| 73 70 6c 69 74 29 0a 58 | 2a 20 20 20 20 20 20 30 |split).X|* 0|
|00005110| 35 2f 3f 3f 2f 31 39 32 | 33 20 20 20 4f 72 74 68 |5/??/192|3 Orth|
|00005120| 6f 64 6f 78 20 6d 65 6d | 62 65 72 73 20 61 64 6f |odox mem|bers ado|
|00005130| 70 74 0a 58 2a 0a 58 2a | 2a 2a 2a 2a 2a 2a 2a 2a |pt.X*.X*|********|
|00005140| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005150| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005160| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005170| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2f 0a 58 |********|*****/.X|
|00005180| 69 6e 74 20 70 6f 6c 61 | 6e 64 5f 65 61 72 6c 79 |int pola|nd_early|
|00005190| 28 79 65 61 72 2c 20 63 | 68 61 6e 67 65 5f 79 65 |(year, c|hange_ye|
|000051a0| 61 72 29 0a 58 20 20 20 | 20 69 6e 74 20 79 65 61 |ar).X | int yea|
|000051b0| 72 3b 0a 58 20 20 20 20 | 69 6e 74 20 63 68 61 6e |r;.X |int chan|
|000051c0| 67 65 5f 79 65 61 72 3b | 0a 58 7b 0a 58 20 20 20 |ge_year;|.X{.X |
|000051d0| 20 2f 2a 20 55 73 65 20 | 64 61 74 65 20 6f 66 20 | /* Use |date of |
|000051e0| 74 6f 74 61 6c 20 63 6f | 75 6e 74 72 79 20 61 64 |total co|untry ad|
|000051f0| 6f 70 74 69 6f 6e 20 2d | 2d 20 31 39 32 33 20 2a |option -|- 1923 *|
|00005200| 2f 0a 58 20 20 20 20 69 | 66 20 28 79 65 61 72 20 |/.X i|f (year |
|00005210| 3d 3d 20 63 68 61 6e 67 | 65 5f 79 65 61 72 29 0a |== chang|e_year).|
|00005220| 58 09 72 65 74 75 72 6e | 28 33 36 35 20 2d 20 31 |X.return|(365 - 1|
|00005230| 33 29 3b 0a 58 0a 58 20 | 20 20 20 2f 2a 20 64 6f |3);.X.X | /* do|
|00005240| 20 6e 6f 72 6d 61 6c 20 | 4a 75 6c 69 61 6e 20 72 | normal |Julian r|
|00005250| 75 6c 65 73 20 2a 2f 0a | 58 20 20 20 20 69 66 20 |ules */.|X if |
|00005260| 28 28 79 65 61 72 20 26 | 20 30 33 29 20 3d 3d 20 |((year &| 03) == |
|00005270| 30 29 0a 58 09 72 65 74 | 75 72 6e 28 33 36 36 29 |0).X.ret|urn(366)|
|00005280| 3b 0a 58 20 20 20 20 65 | 6c 73 65 0a 58 09 72 65 |;.X e|lse.X.re|
|00005290| 74 75 72 6e 28 33 36 35 | 29 3b 0a 58 7d 0a 58 0a |turn(365|);.X}.X.|
|000052a0| 58 0a 58 2f 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |X.X/****|********|
|000052b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000052c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000052d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000052e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 0a 58 2a 0a 58 2a |********|**.X*.X*|
|000052f0| 20 73 77 65 64 65 6e 5f | 65 61 72 6c 79 28 29 20 | sweden_|early() |
|00005300| 2d 2d 20 64 65 61 6c 20 | 77 69 74 68 20 62 6f 75 |-- deal |with bou|
|00005310| 6e 63 69 6e 67 20 6c 65 | 61 70 20 64 61 79 0a 58 |ncing le|ap day.X|
|00005320| 2a 0a 58 2a 20 20 53 77 | 65 64 65 6e 20 74 6f 6f |*.X* Sw|eden too|
|00005330| 6b 20 61 20 68 61 6c 66 | 2d 73 74 65 70 20 74 6f |k a half|-step to|
|00005340| 77 61 72 64 73 20 47 72 | 65 67 6f 72 69 61 6e 20 |wards Gr|egorian |
|00005350| 62 75 74 20 74 68 65 6e | 20 72 65 74 72 65 61 74 |but then| retreat|
|00005360| 65 64 20 28 74 68 69 6e | 6b 0a 58 2a 20 20 6f 66 |ed (thin|k.X* of|
|00005370| 20 69 74 20 61 73 20 73 | 6f 72 74 20 6f 66 20 61 | it as s|ort of a|
|00005380| 20 73 69 6e 67 6c 65 20 | 70 61 72 74 6e 65 72 20 | single |partner |
|00005390| 70 6f 6c 6b 61 29 2e 0a | 58 2a 0a 58 2a 20 20 20 |polka)..|X*.X* |
|000053a0| 20 20 20 20 31 37 30 30 | 20 2d 2d 20 6d 61 64 65 | 1700| -- made|
|000053b0| 20 74 68 69 73 20 79 65 | 61 72 20 61 20 6e 6f 6e | this ye|ar a non|
|000053c0| 2d 6c 65 61 70 20 79 65 | 61 72 20 62 79 20 64 72 |-leap ye|ar by dr|
|000053d0| 6f 70 70 69 6e 67 20 46 | 65 62 20 32 39 74 68 0a |opping F|eb 29th.|
|000053e0| 58 2a 20 20 20 20 20 20 | 20 31 37 31 32 20 2d 2d |X* | 1712 --|
|000053f0| 20 77 65 6e 74 20 62 61 | 63 6b 20 74 6f 20 4a 75 | went ba|ck to Ju|
|00005400| 6c 69 61 6e 20 63 61 6c | 65 6e 64 61 72 20 62 79 |lian cal|endar by|
|00005410| 20 6d 61 6b 69 6e 67 20 | 61 20 46 65 62 20 33 30 | making |a Feb 30|
|00005420| 74 68 20 21 21 0a 58 2a | 20 20 32 2f 31 38 2f 31 |th !!.X*| 2/18/1|
|00005430| 37 35 33 20 2d 2d 20 61 | 64 6f 70 74 65 64 20 47 |753 -- a|dopted G|
|00005440| 72 65 67 6f 72 69 61 6e | 0a 58 2a 0a 58 2a 2a 2a |regorian|.X*.X***|
|00005450| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005460| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005470| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005480| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005490| 2a 2a 2a 2f 0a 58 69 6e | 74 20 73 77 65 64 65 6e |***/.Xin|t sweden|
|000054a0| 5f 65 61 72 6c 79 28 79 | 65 61 72 2c 20 63 68 61 |_early(y|ear, cha|
|000054b0| 6e 67 65 5f 79 65 61 72 | 29 0a 58 20 20 20 20 69 |nge_year|).X i|
|000054c0| 6e 74 20 79 65 61 72 3b | 0a 58 20 20 20 20 69 6e |nt year;|.X in|
|000054d0| 74 20 63 68 61 6e 67 65 | 5f 79 65 61 72 3b 0a 58 |t change|_year;.X|
|000054e0| 7b 0a 58 20 20 20 20 69 | 66 20 28 79 65 61 72 20 |{.X i|f (year |
|000054f0| 3d 3d 20 63 68 61 6e 67 | 65 5f 79 65 61 72 29 0a |== chang|e_year).|
|00005500| 58 09 72 65 74 75 72 6e | 28 33 36 35 20 2d 20 31 |X.return|(365 - 1|
|00005510| 31 29 3b 0a 58 0a 58 20 | 20 20 20 69 66 20 28 79 |1);.X.X | if (y|
|00005520| 65 61 72 20 3d 3d 20 31 | 37 30 30 29 0a 58 09 72 |ear == 1|700).X.r|
|00005530| 65 74 75 72 6e 28 33 36 | 35 29 3b 0a 58 0a 58 20 |eturn(36|5);.X.X |
|00005540| 20 20 20 69 66 20 28 79 | 65 61 72 20 3d 3d 20 31 | if (y|ear == 1|
|00005550| 37 31 32 29 0a 58 09 72 | 65 74 75 72 6e 28 33 36 |712).X.r|eturn(36|
|00005560| 37 29 3b 0a 58 0a 58 20 | 20 20 20 2f 2a 20 64 6f |7);.X.X | /* do|
|00005570| 20 6e 6f 72 6d 61 6c 20 | 4a 75 6c 69 61 6e 20 72 | normal |Julian r|
|00005580| 75 6c 65 73 20 2a 2f 0a | 58 20 20 20 20 69 66 20 |ules */.|X if |
|00005590| 28 28 79 65 61 72 20 26 | 20 30 33 29 20 3d 3d 20 |((year &| 03) == |
|000055a0| 30 29 0a 58 09 72 65 74 | 75 72 6e 28 33 36 36 29 |0).X.ret|urn(366)|
|000055b0| 3b 0a 58 20 20 20 20 65 | 6c 73 65 0a 58 09 72 65 |;.X e|lse.X.re|
|000055c0| 74 75 72 6e 28 33 36 35 | 29 3b 0a 58 7d 0a 58 0a |turn(365|);.X}.X.|
|000055d0| 58 0a 58 2f 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |X.X/****|********|
|000055e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000055f0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005600| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005610| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 0a 58 2a 0a 58 2a |********|**.X*.X*|
|00005620| 20 73 77 69 74 7a 65 72 | 6c 61 6e 64 5f 65 61 72 | switzer|land_ear|
|00005630| 6c 79 28 29 20 2d 2d 20 | 64 65 61 6c 20 77 69 74 |ly() -- |deal wit|
|00005640| 68 20 73 63 61 74 74 65 | 72 65 64 20 61 64 6f 70 |h scatte|red adop|
|00005650| 74 69 6f 6e 20 69 6e 20 | 63 6f 75 6e 74 72 79 0a |tion in |country.|
|00005660| 58 2a 0a 58 2a 20 20 44 | 69 73 74 72 69 63 74 73 |X*.X* D|istricts|
|00005670| 20 61 6e 64 20 74 68 65 | 69 72 20 61 64 6f 70 74 | and the|ir adopt|
|00005680| 69 6f 6e 20 64 61 74 65 | 73 20 28 49 20 68 61 64 |ion date|s (I had|
|00005690| 20 63 6f 6e 66 6c 69 63 | 74 69 6e 67 20 73 6f 75 | conflic|ting sou|
|000056a0| 72 63 65 73 20 66 6f 72 | 0a 58 2a 20 20 74 68 65 |rces for|.X* the|
|000056b0| 20 73 70 65 6c 6c 69 6e | 67 20 6f 66 20 74 68 65 | spellin|g of the|
|000056c0| 20 64 69 73 74 72 69 63 | 74 20 6e 61 6d 65 73 29 | distric|t names)|
|000056d0| 0a 58 2a 0a 58 2a 20 20 | 43 61 74 68 6f 6c 69 63 |.X*.X* |Catholic|
|000056e0| 20 64 69 73 74 72 69 63 | 74 73 20 0a 58 2a 20 20 | distric|ts .X* |
|000056f0| 20 20 20 30 31 2f 32 32 | 2f 31 35 38 34 20 20 46 | 01/22|/1584 F|
|00005700| 72 69 62 6f 75 72 67 2c | 20 4c 75 63 65 72 6e 65 |ribourg,| Lucerne|
|00005710| 2c 20 53 63 68 77 79 7a | 2c 20 53 6f 6c 6f 74 68 |, Schwyz|, Soloth|
|00005720| 75 72 6e 2c 20 55 6e 74 | 65 72 77 61 6c 64 65 6e |urn, Unt|erwalden|
|00005730| 2c 20 55 72 69 2c 20 5a | 75 67 0a 58 2a 20 20 20 |, Uri, Z|ug.X* |
|00005740| 20 20 30 31 2f 31 37 2f | 31 35 39 37 20 20 41 70 | 01/17/|1597 Ap|
|00005750| 70 65 6e 7a 65 6c 6c 0a | 58 2a 20 20 20 20 20 30 |penzell.|X* 0|
|00005760| 33 2f 30 31 2f 31 36 35 | 36 20 20 56 61 6c 61 69 |3/01/165|6 Valai|
|00005770| 73 20 28 70 61 72 74 20 | 64 69 64 20 65 61 72 6c |s (part |did earl|
|00005780| 79 20 69 6e 20 31 36 32 | 32 29 0a 58 2a 0a 58 2a |y in 162|2).X*.X*|
|00005790| 20 20 50 72 6f 74 65 73 | 74 61 6e 74 20 64 69 73 | Protes|tant dis|
|000057a0| 74 72 69 63 74 73 20 0a | 58 2a 20 20 20 20 20 30 |tricts .|X* 0|
|000057b0| 31 2f 30 31 2f 31 37 30 | 31 20 20 42 61 73 65 6c |1/01/170|1 Basel|
|000057c0| 73 74 72 61 64 74 2c 20 | 42 65 72 6e 2c 20 42 69 |stradt, |Bern, Bi|
|000057d0| 65 6c 2c 20 43 61 72 67 | 6f 75 73 2c 20 47 65 6e |el, Carg|ous, Gen|
|000057e0| 65 76 61 2c 20 4e 65 75 | 63 68 61 74 65 6c 2c 0a |eva, Neu|chatel,.|
|000057f0| 58 2a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |X* | |
|00005800| 20 20 20 53 63 68 61 66 | 66 68 61 75 73 65 6e 2c | Schaf|fhausen,|
|00005810| 20 54 68 75 72 67 61 6e | 2c 20 61 6e 64 20 5a 75 | Thurgan|, and Zu|
|00005820| 72 69 63 68 0a 58 2a 20 | 20 20 20 20 31 32 2f 32 |rich.X* | 12/2|
|00005830| 30 2f 31 37 32 33 20 20 | 41 70 70 65 6e 7a 65 6c |0/1723 |Appenzel|
|00005840| 6c 0a 58 2a 20 20 20 20 | 20 30 31 2f 31 32 2f 31 |l.X* | 01/12/1|
|00005850| 37 32 34 20 20 47 6c 61 | 72 75 73 2c 20 53 74 2e |724 Gla|rus, St.|
|00005860| 20 47 61 6c 65 6e 0a 58 | 2a 20 20 20 20 20 30 32 | Galen.X|* 02|
|00005870| 2f 31 37 2f 31 38 31 32 | 20 20 47 72 69 73 6f 6e |/17/1812| Grison|
|00005880| 73 0a 58 2a 0a 58 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |s.X*.X**|********|
|00005890| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000058a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000058b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000058c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2f 0a 58 69 |********|****/.Xi|
|000058d0| 6e 74 20 73 77 69 74 7a | 65 72 6c 61 6e 64 5f 65 |nt switz|erland_e|
|000058e0| 61 72 6c 79 28 79 65 61 | 72 2c 20 63 68 61 6e 67 |arly(yea|r, chang|
|000058f0| 65 5f 79 65 61 72 29 0a | 58 20 20 20 20 69 6e 74 |e_year).|X int|
|00005900| 20 79 65 61 72 3b 0a 58 | 20 20 20 20 69 6e 74 20 | year;.X| int |
|00005910| 63 68 61 6e 67 65 5f 79 | 65 61 72 3b 0a 58 7b 0a |change_y|ear;.X{.|
|00005920| 58 20 20 20 20 2f 2a 20 | 55 73 65 20 64 61 74 65 |X /* |Use date|
|00005930| 20 6f 66 20 74 6f 74 61 | 6c 20 63 6f 75 6e 74 72 | of tota|l countr|
|00005940| 79 20 61 64 6f 70 74 69 | 6f 6e 20 2d 2d 20 31 37 |y adopti|on -- 17|
|00005950| 32 34 20 28 61 20 6c 65 | 61 70 20 79 65 61 72 29 |24 (a le|ap year)|
|00005960| 20 2a 2f 0a 58 20 20 20 | 20 69 66 20 28 79 65 61 | */.X | if (yea|
|00005970| 72 20 3d 3d 20 63 68 61 | 6e 67 65 5f 79 65 61 72 |r == cha|nge_year|
|00005980| 29 0a 58 09 72 65 74 75 | 72 6e 28 33 36 36 20 2d |).X.retu|rn(366 -|
|00005990| 20 31 31 29 3b 0a 58 0a | 58 20 20 20 20 2f 2a 20 | 11);.X.|X /* |
|000059a0| 64 6f 20 6e 6f 72 6d 61 | 6c 20 4a 75 6c 69 61 6e |do norma|l Julian|
|000059b0| 20 72 75 6c 65 73 20 2a | 2f 0a 58 20 20 20 20 69 | rules *|/.X i|
|000059c0| 66 20 28 28 79 65 61 72 | 20 26 20 30 33 29 20 3d |f ((year| & 03) =|
|000059d0| 3d 20 30 29 0a 58 09 72 | 65 74 75 72 6e 28 33 36 |= 0).X.r|eturn(36|
|000059e0| 36 29 3b 0a 58 20 20 20 | 20 65 6c 73 65 0a 58 09 |6);.X | else.X.|
|000059f0| 72 65 74 75 72 6e 28 33 | 36 35 29 3b 0a 58 7d 0a |return(3|65);.X}.|
|00005a00| 58 0a 58 0a 58 2f 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |X.X.X/**|********|
|00005a10| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005a20| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005a30| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005a40| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 0a 58 2a 0a |********|****.X*.|
|00005a50| 58 2a 20 74 75 72 6b 65 | 79 5f 65 61 72 6c 79 28 |X* turke|y_early(|
|00005a60| 29 20 2d 2d 20 64 65 61 | 6c 20 77 69 74 68 20 73 |) -- dea|l with s|
|00005a70| 63 61 74 74 65 72 65 64 | 20 61 64 6f 70 74 69 6f |cattered| adoptio|
|00005a80| 6e 20 6f 66 20 6e 65 77 | 20 63 61 6c 65 6e 64 61 |n of new| calenda|
|00005a90| 72 0a 58 2a 0a 58 2a 20 | 20 41 64 6f 70 74 69 6f |r.X*.X* | Adoptio|
|00005aa0| 6e 20 73 65 65 6d 65 64 | 20 74 6f 20 64 65 70 65 |n seemed| to depe|
|00005ab0| 6e 64 20 6f 6e 20 72 65 | 67 69 6f 6e 61 6c 20 62 |nd on re|gional b|
|00005ac0| 61 63 6b 67 72 6f 75 6e | 64 0a 58 2a 0a 58 2a 20 |ackgroun|d.X*.X* |
|00005ad0| 20 20 20 20 20 31 39 30 | 38 20 20 70 65 6f 70 6c | 190|8 peopl|
|00005ae0| 65 20 77 69 74 68 20 61 | 20 45 75 72 6f 70 65 61 |e with a| Europea|
|00005af0| 6e 20 68 65 72 69 74 61 | 67 65 0a 58 2a 20 20 20 |n herita|ge.X* |
|00005b00| 20 20 20 31 39 31 37 20 | 20 70 65 6f 70 6c 65 20 | 1917 | people |
|00005b10| 77 69 74 68 20 61 20 41 | 73 69 61 6e 20 68 65 72 |with a A|sian her|
|00005b20| 69 74 61 67 65 20 28 6d | 69 67 68 74 20 62 65 20 |itage (m|ight be |
|00005b30| 31 39 31 34 29 0a 58 2a | 0a 58 2a 2a 2a 2a 2a 2a |1914).X*|.X******|
|00005b40| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005b50| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005b60| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005b70| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005b80| 2f 0a 58 69 6e 74 20 74 | 75 72 6b 65 79 5f 65 61 |/.Xint t|urkey_ea|
|00005b90| 72 6c 79 28 79 65 61 72 | 2c 20 63 68 61 6e 67 65 |rly(year|, change|
|00005ba0| 5f 79 65 61 72 29 0a 58 | 20 20 20 20 69 6e 74 20 |_year).X| int |
|00005bb0| 79 65 61 72 3b 0a 58 20 | 20 20 20 69 6e 74 20 63 |year;.X | int c|
|00005bc0| 68 61 6e 67 65 5f 79 65 | 61 72 3b 0a 58 7b 0a 58 |hange_ye|ar;.X{.X|
|00005bd0| 20 20 20 20 2f 2a 20 55 | 73 65 20 64 61 74 65 20 | /* U|se date |
|00005be0| 6f 66 20 74 6f 74 61 6c | 20 63 6f 75 6e 74 72 79 |of total| country|
|00005bf0| 20 61 64 6f 70 74 69 6f | 6e 20 2d 2d 20 31 39 31 | adoptio|n -- 191|
|00005c00| 37 20 2a 2f 0a 58 20 20 | 20 20 69 66 20 28 79 65 |7 */.X | if (ye|
|00005c10| 61 72 20 3d 3d 20 63 68 | 61 6e 67 65 5f 79 65 61 |ar == ch|ange_yea|
|00005c20| 72 29 0a 58 09 72 65 74 | 75 72 6e 28 33 36 35 20 |r).X.ret|urn(365 |
|00005c30| 2d 20 31 33 29 3b 0a 58 | 0a 58 20 20 20 20 2f 2a |- 13);.X|.X /*|
|00005c40| 20 64 6f 20 6e 6f 72 6d | 61 6c 20 4a 75 6c 69 61 | do norm|al Julia|
|00005c50| 6e 20 72 75 6c 65 73 20 | 2a 2f 0a 58 20 20 20 20 |n rules |*/.X |
|00005c60| 69 66 20 28 28 79 65 61 | 72 20 26 20 30 33 29 20 |if ((yea|r & 03) |
|00005c70| 3d 3d 20 30 29 0a 58 09 | 72 65 74 75 72 6e 28 33 |== 0).X.|return(3|
|00005c80| 36 36 29 3b 0a 58 20 20 | 20 20 65 6c 73 65 0a 58 |66);.X | else.X|
|00005c90| 09 72 65 74 75 72 6e 28 | 33 36 35 29 3b 0a 58 7d |.return(|365);.X}|
|00005ca0| 0a 58 0a 58 0a 58 2f 2a | 2a 2a 2a 2a 2a 2a 2a 2a |.X.X.X/*|********|
|00005cb0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005cc0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005cd0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005ce0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 0a 58 2a |********|*****.X*|
|00005cf0| 0a 58 2a 20 75 73 61 5f | 65 61 72 6c 79 28 29 20 |.X* usa_|early() |
|00005d00| 2d 2d 20 64 65 61 6c 20 | 77 69 74 68 20 73 74 61 |-- deal |with sta|
|00005d10| 74 65 20 64 69 66 66 65 | 72 65 6e 63 65 73 0a 58 |te diffe|rences.X|
|00005d20| 2a 0a 58 2a 20 20 54 68 | 65 20 55 53 41 2c 20 66 |*.X* Th|e USA, f|
|00005d30| 6f 72 20 74 68 65 20 6d | 6f 73 74 20 70 61 72 74 |or the m|ost part|
|00005d40| 2c 20 66 6f 6c 6c 6f 77 | 65 64 20 47 72 65 61 74 |, follow|ed Great|
|00005d50| 20 42 72 69 74 61 69 6e | 27 73 20 6c 65 61 64 20 | Britain|'s lead |
|00005d60| 69 6e 20 74 68 65 0a 58 | 2a 20 20 61 64 6f 70 74 |in the.X|* adopt|
|00005d70| 69 6f 6e 20 6f 66 20 74 | 68 65 20 74 68 65 20 47 |ion of t|he the G|
|00005d80| 72 65 67 6f 72 69 61 6e | 20 63 61 6c 65 6e 64 61 |regorian| calenda|
|00005d90| 72 20 69 6e 20 31 37 35 | 32 2e 20 20 48 6f 77 65 |r in 175|2. Howe|
|00005da0| 76 65 72 2c 20 6e 6f 74 | 20 61 6c 6c 0a 58 2a 20 |ver, not| all.X* |
|00005db0| 20 63 75 72 72 65 6e 74 | 20 73 74 61 74 65 73 20 | current| states |
|00005dc0| 77 65 72 65 20 70 61 72 | 74 20 6f 66 20 74 68 65 |were par|t of the|
|00005dd0| 20 22 63 6f 75 6e 74 72 | 79 22 20 61 74 20 74 68 | "countr|y" at th|
|00005de0| 61 74 20 74 69 6d 65 2e | 20 20 41 6e 20 65 61 73 |at time.| An eas|
|00005df0| 79 0a 58 2a 20 20 6c 69 | 65 20 69 73 20 74 6f 20 |y.X* li|e is to |
|00005e00| 73 61 79 20 74 68 61 74 | 20 61 6c 6c 20 70 61 72 |say that| all par|
|00005e10| 74 73 20 6f 66 20 74 68 | 65 20 79 65 74 2d 74 6f |ts of th|e yet-to|
|00005e20| 2d 62 65 20 55 53 41 20 | 63 68 61 6e 67 65 64 20 |-be USA |changed |
|00005e30| 6f 76 65 72 20 6f 6e 0a | 58 2a 20 20 74 68 61 74 |over on.|X* that|
|00005e40| 20 64 61 74 65 2e 20 20 | 53 74 61 74 65 73 20 6c | date. |States l|
|00005e50| 69 6b 65 20 43 61 6c 69 | 66 6f 72 6e 69 61 20 77 |ike Cali|fornia w|
|00005e60| 65 72 65 20 6e 6f 74 20 | 65 76 65 6e 20 73 65 74 |ere not |even set|
|00005e70| 74 6c 65 64 20 75 6e 74 | 69 6c 0a 58 2a 20 20 61 |tled unt|il.X* a|
|00005e80| 62 6f 75 74 20 31 37 37 | 30 2e 0a 58 2a 0a 58 2a |bout 177|0..X*.X*|
|00005e90| 20 20 54 68 65 20 65 78 | 63 65 70 74 69 6f 6e 73 | The ex|ceptions|
|00005ea0| 20 74 6f 20 74 68 65 20 | 31 37 35 32 20 72 75 6c | to the |1752 rul|
|00005eb0| 65 3a 0a 58 2a 0a 58 2a | 20 20 41 6c 61 73 6b 61 |e:.X*.X*| Alaska|
|00005ec0| 20 77 61 73 20 6f 77 6e | 65 64 20 62 79 20 52 75 | was own|ed by Ru|
|00005ed0| 73 73 69 61 20 75 6e 74 | 69 6c 20 31 38 36 37 2e |ssia unt|il 1867.|
|00005ee0| 20 28 73 65 65 20 52 75 | 73 73 69 61 27 73 20 72 | (see Ru|ssia's r|
|00005ef0| 75 6c 65 73 29 0a 58 2a | 20 20 48 61 77 61 69 69 |ules).X*| Hawaii|
|00005f00| 20 77 61 73 20 61 6e 20 | 69 6e 64 65 70 65 6e 64 | was an |independ|
|00005f10| 65 6e 74 20 63 6f 75 6e | 74 72 79 20 74 68 61 74 |ent coun|try that|
|00005f20| 20 61 64 6f 70 74 65 64 | 20 47 72 65 67 6f 72 69 | adopted| Gregori|
|00005f30| 61 6e 20 69 6e 20 31 38 | 39 33 28 3f 29 2e 0a 58 |an in 18|93(?)..X|
|00005f40| 2a 0a 58 2a 20 20 54 68 | 65 20 6e 6f 6e 2d 73 74 |*.X* Th|e non-st|
|00005f50| 61 74 65 73 20 74 68 61 | 74 20 6f 70 65 72 61 74 |ates tha|t operat|
|00005f60| 65 20 75 6e 64 65 72 20 | 55 53 20 70 72 6f 74 65 |e under |US prote|
|00005f70| 63 74 69 6f 6e 20 61 72 | 65 20 6c 69 6b 65 77 69 |ction ar|e likewi|
|00005f80| 73 65 20 65 78 63 65 70 | 74 69 6f 6e 73 0a 58 2a |se excep|tions.X*|
|00005f90| 20 20 74 6f 20 74 68 65 | 20 72 75 6c 65 20 28 6c | to the| rule (l|
|00005fa0| 75 63 6b 69 6c 79 2c 20 | 73 6f 6d 65 20 77 65 72 |uckily, |some wer|
|00005fb0| 65 20 6e 6f 74 20 69 6e | 68 61 62 69 74 65 64 20 |e not in|habited |
|00005fc0| 6f 72 20 77 65 27 64 20 | 68 61 76 65 20 74 6f 20 |or we'd |have to |
|00005fd0| 68 79 70 6e 6f 74 69 73 | 65 0a 58 2a 20 20 74 68 |hypnotis|e.X* th|
|00005fe0| 65 20 6e 61 74 69 76 65 | 20 70 6f 70 75 6c 61 74 |e native| populat|
|00005ff0| 69 6f 6e 20 74 6f 20 63 | 68 61 6e 67 65 20 74 68 |ion to c|hange th|
|00006000| 65 69 72 20 6d 65 6d 6f | 72 79 20 6f 66 20 70 72 |eir memo|ry of pr|
|00006010| 65 76 69 6f 75 73 20 63 | 61 6c 65 6e 64 61 72 73 |evious c|alendars|
|00006020| 3a 2d 29 3a 0a 58 2a 0a | 58 2a 20 20 41 6d 65 72 |:-):.X*.|X* Amer|
|00006030| 69 63 61 6e 20 53 61 6d | 6f 61 20 62 65 63 61 6d |ican Sam|oa becam|
|00006040| 65 20 70 6f 73 73 65 73 | 69 6f 6e 20 31 38 39 39 |e posses|ion 1899|
|00006050| 2e 0a 58 2a 20 20 42 61 | 6b 65 72 2c 20 48 6f 77 |..X* Ba|ker, How|
|00006060| 6c 61 6e 64 2c 20 61 6e | 64 20 4a 61 72 76 69 73 |land, an|d Jarvis|
|00006070| 20 49 73 6c 61 6e 64 73 | 20 62 65 63 61 6d 65 20 | Islands| became |
|00006080| 70 6f 73 73 65 73 69 6f | 6e 73 20 31 38 35 37 28 |possesio|ns 1857(|
|00006090| 3f 29 2e 0a 58 2a 20 20 | 50 61 6e 61 6d 61 20 43 |?)..X* |Panama C|
|000060a0| 61 6e 61 6c 20 5a 6f 6e | 65 20 77 61 73 20 61 20 |anal Zon|e was a |
|000060b0| 70 6f 73 73 65 73 69 6f | 6e 20 31 39 30 33 2d 31 |possesio|n 1903-1|
|000060c0| 39 37 39 20 28 3f 29 2e | 0a 58 2a 20 20 43 61 6e |979 (?).|.X* Can|
|000060d0| 74 6f 6e 20 61 6e 64 20 | 45 6e 64 65 72 62 75 72 |ton and |Enderbur|
|000060e0| 79 20 49 73 6c 61 6e 64 | 73 20 2d 20 31 39 33 39 |y Island|s - 1939|
|000060f0| 2e 0a 58 2a 20 20 47 72 | 65 61 74 20 43 6f 72 6e |..X* Gr|eat Corn|
|00006100| 20 61 6e 64 20 4c 69 74 | 74 6c 65 20 43 6f 72 6e | and Lit|tle Corn|
|00006110| 20 2d 20 6c 65 61 73 65 | 64 20 66 72 6f 6d 20 4e | - lease|d from N|
|00006120| 69 63 61 72 61 75 67 75 | 61 20 66 6f 72 20 39 39 |icaraugu|a for 99|
|00006130| 20 79 65 61 72 73 20 69 | 6e 20 31 39 31 34 2e 0a | years i|n 1914..|
|00006140| 58 2a 20 20 47 75 61 6d | 20 2d 20 6f 62 74 61 69 |X* Guam| - obtai|
|00006150| 6e 65 64 20 69 6e 20 31 | 38 39 38 2c 20 6c 6f 73 |ned in 1|898, los|
|00006160| 74 20 74 6f 20 4a 61 70 | 61 6e 20 31 39 34 31 2c |t to Jap|an 1941,|
|00006170| 20 72 65 67 61 69 6e 65 | 64 20 69 6e 20 31 39 34 | regaine|d in 194|
|00006180| 34 2e 0a 58 2a 20 20 4a | 6f 68 6e 73 74 6f 6e 20 |4..X* J|ohnston |
|00006190| 49 73 6c 61 6e 64 20 2d | 20 63 61 6d 65 20 77 69 |Island -| came wi|
|000061a0| 74 68 20 48 61 77 61 69 | 69 0a 58 2a 20 20 4d 69 |th Hawai|i.X* Mi|
|000061b0| 64 77 61 79 20 49 73 6c | 61 6e 64 73 20 2d 20 31 |dway Isl|ands - 1|
|000061c0| 38 36 37 0a 58 2a 20 20 | 50 68 69 6c 6c 69 70 69 |867.X* |Phillipi|
|000061d0| 6e 65 20 49 73 6c 61 6e | 64 73 20 2d 20 77 61 73 |ne Islan|ds - was|
|000061e0| 20 55 53 20 74 65 72 72 | 69 74 6f 72 79 20 31 38 | US terr|itory 18|
|000061f0| 39 38 2d 31 39 34 36 0a | 58 2a 20 20 50 75 65 72 |98-1946.|X* Puer|
|00006200| 74 6f 20 52 69 63 6f 20 | 2d 20 53 70 61 69 6e 20 |to Rico |- Spain |
|00006210| 63 65 64 65 64 20 74 6f | 20 55 53 20 69 6e 20 31 |ceded to| US in 1|
|00006220| 38 39 38 0a 58 2a 20 20 | 54 72 75 73 74 20 54 65 |898.X* |Trust Te|
|00006230| 72 72 69 74 6f 72 69 65 | 73 20 6f 66 20 74 68 65 |rritorie|s of the|
|00006240| 20 50 61 63 69 66 69 63 | 20 28 61 70 70 72 6f 78 | Pacific| (approx|
|00006250| 20 32 30 30 30 20 69 73 | 6c 61 6e 64 73 20 69 6e | 2000 is|lands in|
|00006260| 20 57 2e 20 50 61 63 69 | 66 69 63 29 2d 31 39 34 | W. Paci|fic)-194|
|00006270| 37 0a 58 2a 20 20 56 69 | 72 67 69 6e 20 49 73 6c |7.X* Vi|rgin Isl|
|00006280| 61 6e 64 73 20 2d 20 62 | 6f 75 67 68 74 20 66 72 |ands - b|ought fr|
|00006290| 6f 6d 20 44 65 6e 6d 61 | 72 6b 20 69 6e 20 31 39 |om Denma|rk in 19|
|000062a0| 31 37 0a 58 2a 20 20 57 | 61 6b 65 20 49 73 6c 61 |17.X* W|ake Isla|
|000062b0| 6e 64 20 2d 20 67 6f 74 | 20 66 72 6f 6d 20 53 70 |nd - got| from Sp|
|000062c0| 61 69 6e 20 31 38 39 38 | 2c 20 4a 61 70 61 6e 20 |ain 1898|, Japan |
|000062d0| 74 6f 6f 6b 20 31 39 34 | 31 2c 20 72 65 67 61 69 |took 194|1, regai|
|000062e0| 6e 65 64 20 69 6e 20 31 | 39 34 35 0a 58 2a 0a 58 |ned in 1|945.X*.X|
|000062f0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00006300| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00006310| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00006320| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00006330| 2a 2a 2a 2a 2a 2a 2f 0a | 58 69 6e 74 20 75 73 61 |******/.|Xint usa|
|00006340| 5f 65 61 72 6c 79 28 79 | 65 61 72 2c 20 63 68 61 |_early(y|ear, cha|
|00006350| 6e 67 65 5f 79 65 61 72 | 29 0a 58 20 20 20 20 69 |nge_year|).X i|
|00006360| 6e 74 20 79 65 61 72 3b | 0a 58 20 20 20 20 69 6e |nt year;|.X in|
|00006370| 74 20 63 68 61 6e 67 65 | 5f 79 65 61 72 3b 0a 58 |t change|_year;.X|
|00006380| 7b 0a 58 20 20 20 20 2f | 2a 20 74 68 69 73 20 69 |{.X /|* this i|
|00006390| 73 20 66 6f 72 20 74 68 | 65 20 6d 61 6a 6f 72 69 |s for th|e majori|
|000063a0| 74 79 20 6f 66 20 74 68 | 65 20 63 61 73 65 73 2c |ty of th|e cases,|
|000063b0| 20 20 63 68 61 6e 67 65 | 20 69 66 20 64 65 73 69 | change| if desi|
|000063c0| 72 65 64 20 2a 2f 0a 58 | 20 20 20 20 69 66 20 28 |red */.X| if (|
|000063d0| 79 65 61 72 20 3d 3d 20 | 63 68 61 6e 67 65 5f 79 |year == |change_y|
|000063e0| 65 61 72 29 09 2f 2a 20 | 31 37 35 32 20 2a 2f 0a |ear)./* |1752 */.|
|000063f0| 58 09 72 65 74 75 72 6e | 28 33 36 36 20 2d 20 31 |X.return|(366 - 1|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.