{"id":183,"date":"2004-11-20T21:48:55","date_gmt":"2004-11-21T02:48:55","guid":{"rendered":"http:\/\/www.allyngibson.net\/?p=183"},"modified":"2004-11-20T21:48:55","modified_gmt":"2004-11-21T02:48:55","slug":"for-geekoid-fanboys-only","status":"publish","type":"post","link":"http:\/\/www.allyngibson.com\/?p=183","title":{"rendered":"For Geekoid Fanboys Only"},"content":{"rendered":"<p>In the summer of 1999 I reread <i>The Lord of the Rings<\/i> for perhaps the dozenth time.  With that particular reading I studied, <i>really<\/i> studied, Appendix D on the calendrical systems in use in Middle-Earth in the Third Age.  I was drawn, in particular, to the Hobbit calendar and decided to write a quick-and-dirty computer program to convert our dates into Hobbit dates.<\/p>\n<p>Today, November 20th, is in Shire Reckoning, the first of Foreyule.<\/p>\n<p>What made me think of this, today, of all days?  Maybe it&#8217;s playing <i>The Third Age<\/i>, EA&#8217;s <i>Lord of the Rings<\/i> turn-based RPG on the XBox.  How is the game?  I&#8217;ll save that for another post.<\/p>\n<p>But for those who want to see the program, after the cut is the BASIC source code.  Yes, I wrote it in BASIC.  You have a problem with that?<\/p>\n<p><!--more--><\/p>\n<p>100 CLS<br \/>\n110 GOSUB 1000<br \/>\n120 GOSUB 2000<br \/>\n130 GOSUB 2500<br \/>\n140 REM PRINT &#8220;JULIAN DATE&#8221;; JL<br \/>\n150 REM PRINT &#8220;SHIRE JULIAN DATE&#8221;; SJ<br \/>\n160 GOSUB 3000<br \/>\n170 GOSUB 3500<br \/>\n180 GOSUB 4000<br \/>\n190 GOSUB 4500<br \/>\n200 PRINT &#8220;Your date is &#8220;;W$;&#8221;, &#8220;;D$<br \/>\n210 REM PRINT DT<br \/>\n999 END<br \/>\n1000 REM Input date<br \/>\n1010 PRINT &#8220;Year&#8221;;<br \/>\n1020 INPUT Y:Y=INT(Y)<br \/>\n1030 IF Y&lt;0 THEN GOTO 1010<br \/>\n1040 GOSUB 1500<br \/>\n1050 PRINT &#8220;Month&#8221;;<br \/>\n1060 INPUT M:M=INT(M)<br \/>\n1070 IF M&lt;1 OR M>12 THEN GOTO 1050<br \/>\n1080 PRINT &#8220;Day&#8221;;<br \/>\n1090 INPUT D:D=INT(D)<br \/>\n1100 IF D&lt;1 THEN GOTO 1080<br \/>\n1110 IF M=2 AND D>28+LP THEN GOTO 1080<br \/>\n1120 IF (M=4 OR M=6 OR M=9 OR M=11) AND D>30 THEN GOTO 1080<br \/>\n1130 IF M>31 THEN GOTO 1080<br \/>\n1140 RETURN<br \/>\n1500 REM Leap Year Check<br \/>\n1510 LP=0<br \/>\n1520 IF Y\/4=INT(Y\/4) THEN LP=1<br \/>\n1530 IF Y\/100=INT(Y\/100) THEN LP=0<br \/>\n1540 IF Y\/400=INT(Y\/400) THEN LP=1<br \/>\n1550 RETURN<br \/>\n2000 REM Julian Date conversion<br \/>\n2010 JL=0<br \/>\n2020 IF M=2 THEN JL=31<br \/>\n2030 IF M=3 THEN JL=59<br \/>\n2040 IF M=4 THEN JL=90<br \/>\n2050 IF M=5 THEN JL=120<br \/>\n2060 IF M=6 THEN JL=151<br \/>\n2070 IF M=7 THEN JL=181<br \/>\n2080 IF M=8 THEN JL=212<br \/>\n2090 IF M=9 THEN JL=243<br \/>\n2100 IF M=10 THEN JL=273<br \/>\n2110 IF M=11 THEN JL=304<br \/>\n2120 IF M=12 THEN JL=334<br \/>\n2130 JL=JL+D<br \/>\n2140 IF M>2 THEN JL=JL+LP<br \/>\n2150 RETURN<br \/>\n2500 REM Shire Julian Date conversion<br \/>\n2510 SJ=0<br \/>\n2520 SJ=JL+11<br \/>\n2530 IF SJ>365+LP THEN SJ=SJ-(365+LP)<br \/>\n2540 RETURN<br \/>\n3000 REM Shire Date calculation<br \/>\n3010 SD=0:SM=0<br \/>\n3020 IF SJ=1 THEN SD=2:SM=13:RETURN<br \/>\n3030 IF SJ=182 THEN SD=1:SM=14:RETURN<br \/>\n3040 IF SJ=183 THEN SM=15:RETURN<br \/>\n3050 IF SJ=184+LP THEN SD=2:SM=14:RETURN<br \/>\n3060 IF SJ=184 AND LP=1 THEN SM=16:RETURN<br \/>\n3070 IF SJ=365+LP THEN SD=1:SM=13:RETURN<br \/>\n3080 SJ=SJ-1<br \/>\n3090 IF SJ>182+LP THEN SJ=SJ-(3+LP)<br \/>\n3100 SM=INT((SJ-1)\/30)+1<br \/>\n3110 SD=SJ-((SM-1)*30)<br \/>\n3120 RETURN<br \/>\n3500 REM Shire month string<br \/>\n3510 IF SM=1 THEN M$=&#8221;Afteryule&#8221;<br \/>\n3520 IF SM=2 THEN M$=&#8221;Solmath&#8221;<br \/>\n3530 IF SM=3 THEN M$=&#8221;Rethe&#8221;<br \/>\n3540 IF SM=4 THEN M$=&#8221;Astron&#8221;<br \/>\n3550 IF SM=5 THEN M$=&#8221;Thrimidge&#8221;<br \/>\n3560 IF SM=6 THEN M$=&#8221;Forelithe&#8221;<br \/>\n3570 IF SM=7 THEN M$=&#8221;Afterlithe&#8221;<br \/>\n3580 IF SM=8 THEN M$=&#8221;Wedmath&#8221;<br \/>\n3590 IF SM=9 THEN M$=&#8221;Halimath&#8221;<br \/>\n3600 IF SM=10 THEN M$=&#8221;Winterfilth&#8221;<br \/>\n3610 IF SM=11 THEN M$=&#8221;Blotmath&#8221;<br \/>\n3620 IF SM=12 THEN M$=&#8221;Foreyule&#8221;<br \/>\n3630 IF SM=13 THEN M$=&#8221;Yule&#8221;<br \/>\n3640 IF SM=14 THEN M$=&#8221;Lithe&#8221;<br \/>\n3650 IF SM=15 THEN M$=&#8221;Midyear&#8217;s Day&#8221;<br \/>\n3660 IF SM=16 THEN M$=&#8221;Overlithe&#8221;<br \/>\n3670 RETURN<br \/>\n4000 REM Create date string<br \/>\n4010 D$=&#8221;&#8221;<br \/>\n4020 IF SM>14 THEN D$=M$:RETURN<br \/>\n4030 D$=STR$(SD)+&#8221; &#8220;+M$<br \/>\n4040 RETURN<br \/>\n4500 REM Shire day of week calculation<br \/>\n4510 GOSUB 2500<br \/>\n4520 DT=0<br \/>\n4530 IF SJ=183 OR (SJ=184 AND LP=1) THEN DT=8:RETURN<br \/>\n4535 IF SJ>183 THEN SJ=SJ-LP-1<br \/>\n4540 DT=SJ-7*INT(SJ\/7)<br \/>\n4550 IF DT=0 THEN W$=&#8221;Highday&#8221;<br \/>\n4560 IF DT=1 THEN W$=&#8221;Sterday&#8221;<br \/>\n4570 IF DT=2 THEN W$=&#8221;Sunday&#8221;<br \/>\n4580 IF DT=3 THEN W$=&#8221;Monday&#8221;<br \/>\n4590 IF DT=4 THEN W$=&#8221;Trewsday&#8221;<br \/>\n4600 IF DT=5 THEN W$=&#8221;Hevensday&#8221;<br \/>\n4610 IF DT=6 THEN W$=&#8221;Mersday&#8221;<br \/>\n4620 RETURN<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the summer of 1999 I reread The Lord of the Rings for perhaps the dozenth time. With that particular reading I studied, really studied, Appendix D on the calendrical systems in use in Middle-Earth in the Third Age. I was drawn, in particular, to the Hobbit calendar and decided to write a quick-and-dirty computer<a class=\"more-link\" href=\"http:\/\/www.allyngibson.com\/?p=183\">Continue reading <span class=\"screen-reader-text\">&#8220;For Geekoid Fanboys Only&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[135],"tags":[368,348],"class_list":["post-183","post","type-post","status-publish","format-standard","hentry","category-tolkien","tag-lord-of-the-rings","tag-shire-reckoning","entry"],"_links":{"self":[{"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=\/wp\/v2\/posts\/183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=183"}],"version-history":[{"count":0,"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=\/wp\/v2\/posts\/183\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=183"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}