home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1604 < prev    next >
Internet Message Format  |  1990-12-28  |  56KB

  1. From: goer@sophist.uucp (Richard Goerwitz)
  2. Newsgroups: alt.sources
  3. Subject: Jewish/Civil calendar, part 03 of 03
  4. Message-ID: <1990Jul20.001212.4559@midway.uchicago.edu>
  5. Date: 20 Jul 90 00:12:12 GMT
  6.  
  7. In article <1990Jul20.000900.4359@midway.uchicago.edu> goer@sophist.UUCP (Richard Goerwitz) writes:
  8. >
  9. >This is an experimental posting of a Unix port of an MS-DOS program
  10. >written in Icon.  Icon, for those who do not know, is the successor
  11. >language to Snobol (in fact SL5).  It retains great string handling
  12. >facilities of Snobol, and yet possesses a fully procedural structure.
  13. >It also incorporates data structures such as hash tables and linked
  14. >lists, and provides builtin garbage collection, like most dialects
  15. >of Lisp.  I personally use it for natural language processing, but
  16. >it can also be used for rapid prototying of almost anything except
  17. >low-level bit manipulation and systems programming jobs.  It is popu-
  18. >lar among people doing all varieties of nonnumeric computing.
  19. >
  20. >The program itself - yes, by Jove, there is a program here - is a
  21. >Jewish/Civil calendar display utility.  Lets you view corresponding
  22. >dates for both calendars on screen simultaneously.  I've never un-
  23. >derstood the Jewish calendar, and this seemed a good excuse to learn
  24. >all the month names.  My real reason for porting it was that it was
  25. >the first piece of software posted to comp.lang.icon that seemed a
  26. >good way of testing my rough port of the C/Unix termlib library to
  27. >Icon.  I thank Alan Corre (the original author) for permitting me to
  28. >(ab)use the original MS-DOS program in this way.
  29. >
  30. >Anyone who does not have Icon is without excuse, since it is free,
  31. >and available for many, many popular micros, minis, and some main-
  32. >frames.  Just about anything that calls itself -nix can run Icon
  33. >(Unix, Xenix, etc.).  Ftp it from cs.arizona.edu if you find your
  34. >curiosity aroused, and don't already have it installed.
  35. >
  36. >   -Richard L. Goerwitz              goer%sophist@uchicago.bitnet
  37. >   goer@sophist.uchicago.edu         rutgers!oddjob!gide!sophist!goer
  38. >
  39. >
  40. >---- Cut Here and unpack ----
  41. >#!/bin/sh
  42. ># This is a shell archive (shar 3.24)
  43. ># made 07/19/1990 22:27 UTC by goer@sophist.uchicago.edu
  44. ># Source directory /u/richard/Hebcalen
  45. >#
  46. ># existing files WILL be overwritten
  47. ># This format requires very little intelligence at unshar time.
  48. ># "echo" and "sed" will be needed.
  49. >#
  50. ># This is part 1 of a multipart archive                                    
  51. ># do not concatenate these parts, unpack them in order with /bin/sh        
  52. >#
  53. ># This shar contains:
  54. ># length  mode       name
  55. ># ------ ---------- ------------------------------------------
  56. >#  23020 -r--r--r-- hebcalen.src
  57. >#  11276 -r--r--r-- itlib.icn
  58. >#   4008 -rw-r--r-- hebcalen.hlp
  59. >#   6490 -rw-r--r-- hebcalen.dat
  60. >#   2475 -rw-r--r-- README
  61. >#   1654 -rw-r--r-- Makefile.dist
  62. >#  29360 -rw-r--r-- cal.text
  63. >#
  64. >if test -r shar3_seq_.tmp; then
  65. >    echo "Must unpack archives in sequence!"
  66. >    next=`cat shar3_seq_.tmp`; echo "Please unpack part $next next"
  67. >    exit 1
  68. >fi
  69. ># ============= hebcalen.src ==============
  70. >echo "x - extracting hebcalen.src (Text)"
  71. >sed 's/^X//' << 'SHAR_EOF' > hebcalen.src &&
  72. >X##########################################################################
  73. >X#
  74. >X#    NAME:   hebcalen.icn
  75. >X#
  76. >X#    TITLE:  Combination Jewish/Civil calendar
  77. >X#
  78. >X#    AUTHOR: Alan D. Corre (ported to Unix by Richard Goerwitz)   
  79. >X#
  80. >X#    DATE:   7/19/90 (version 1.11)
  81. >X#
  82. >X##########################################################################
  83. >X#
  84. >X#  COPYRIGHT (c) 1990, Alan D. Corre
  85. >X#
  86. >X#  Permission is hereby given to all persons to copy, compile and pass
  87. >X#  to others this code provided that (1) it is not used for monetary
  88. >X#  gain; (2) it is not subverted from its original purpose, and is
  89. >X#  changed only to the extent necessary to make it work on a different
  90. >X#  computer or terminal.  No guarantees are given or implied as to the
  91. >X#  correctness of information furnished by this program.
  92. >X#
  93. >X##########################################################################
  94. >X#
  95. >X#  This work is respectfully devoted to the authors of two books
  96. >X#  consulted with much profit: "A Guide to the Solar-Lunar Calendar"
  97. >X#  by B. Elihu Rothblatt published by our sister Hebrew Dept. in
  98. >X#  Madison, Wis., and "Kiddush HaHodesh" by Rabbenu Moses ben Maimon,
  99. >X#  on whom be peace.
  100. >X#
  101. >X#  The Jewish year harmonizes the solar and lunar cycle, using the
  102. >X#  19-year cycle of Meton (c. 432 BCE). It corrects so that certain
  103. >X#  dates shall not fall on certain days for religious convenience. The
  104. >X#  Jewish year has six possible lengths, 353, 354, 355, 383, 384, and
  105. >X#  385 days, according to day and time of new year lunation and
  106. >X#  position in Metonic cycle.  Time figures from 6pm previous night.
  107. >X#  The lunation of year 1 is calculated to be on a Monday (our Sunday
  108. >X#  night) at ll:11:20pm. Our data table begins with a hypothetical
  109. >X#  year 0, corresponding to 3762 B.C.E.  Calculations in this program
  110. >X#  are figured in the ancient Babylonian unit of halaqim "parts" of
  111. >X#  the hour = 1/1080 hour.
  112. >X#
  113. >X#  Startup syntax is simply hebcalen [date], where date is a year
  114. >X#  specification of the form 5750 for a Jewish year, +1990 or 1990AD
  115. >X#  or 1990CE or -1990 or 1990BC or 1990BCE for a civil year.
  116. >X#
  117. >X#  (Bugs:  Years over 6039 are calculated from scratch (slow).  I've
  118. >X#  also noticed that the dates are incorrect (e.g. hebcalen +7777
  119. >X#  will display civil year 7757).  I have not delved into the pro-
  120. >X#  gram deep enough to pinpoint the cause of the dating discrepancy.
  121. >X#  - RLG)
  122. >X#
  123. >X##########################################################################
  124. >X
  125. >X
  126. >Xrecord date(yr,mth,day)
  127. >Xrecord molad(day,halaqim)
  128. >Xglobal cyr,jyr,days_in_jyr,current_molad,current_day,infolist
  129. >X
  130. >X
  131. >X#------- the following sections of code have been modified  - RLG -------#
  132. >X
  133. >Xprocedure main(a)
  134. >X
  135. >X    iputs(getval("ti"))
  136. >X    display_startup_screen()
  137. >X
  138. >X    if *a = 0 then {
  139. >X    #put()'ing an asterisk means that user might need help
  140. >X    n := 1; put(a,"*")
  141. >X    }
  142. >X    else n := *a
  143. >X    every p := 1 to n do {
  144. >X    initialize(a[p]) | break
  145. >X    process() | break
  146. >X    }
  147. >X    iputs(getval("te"))
  148. >X
  149. >Xend
  150. >X
  151. >X
  152. >X
  153. >Xprocedure display_startup_screen()
  154. >X
  155. >X    local T
  156. >X
  157. >X    clear()
  158. >X    banner("PERPETUAL JEWISH/CIVIL CALENDAR","by","ALAN D. CORRE")
  159. >X    # Use a combination of tricks to be sure it will be up there a sec.
  160. >X    every 1 to 10000
  161. >X    T := &time; until &time > (T+450)
  162. >X
  163. >X    return
  164. >X
  165. >Xend
  166. >X
  167. >X
  168. >X
  169. >Xprocedure banner(l[])
  170. >X
  171. >X    # Creates a banner to begin hebcalen.  Leaves it on the screen for
  172. >X    # about a second.
  173. >X
  174. >X    local m, n, CM, COLS, LINES
  175. >X
  176. >X    CM    := getval("cm")
  177. >X    COLS  := getval("co")
  178. >X    LINES := getval("li")
  179. >X    (COLS > 55, LINES > 9) |
  180. >X    stop("\nSorry, your terminal just isn't big enough.")
  181. >X
  182. >X    if LINES > 20 then {
  183. >X    # Terminal is big enough for banner.
  184. >X    iputs(igoto(CM,1,3))
  185. >X    writes("+",repl("-",COLS-3),"+")
  186. >X    iputs(igoto(CM,1,4))
  187. >X    writes("|")
  188. >X    iputs(igoto(CM,COLS-1,4))
  189. >X    writes("|")
  190. >X
  191. >X    m := 0
  192. >X    every n := 5 to (*l * 3) + 4 by 3 do {
  193. >X        iputs(igoto(CM,1,n))
  194. >X        writes("|",center(l[m+:=1],COLS-3),"|")
  195. >X        every iputs(igoto(CM,1,n+(1|2))) & writes("|")
  196. >X        every iputs(igoto(CM,COLS-1,n+(1|2))) & writes("|")
  197. >X    }
  198. >X    
  199. >X    iputs(igoto(CM,1,n+3))
  200. >X    writes("+",repl("-",COLS-3),"+")
  201. >X    iputs(igoto(CM,1,n+4))
  202. >X    write(" Copyright (c) Alan D. Corre, 1990")
  203. >X    }
  204. >X    else {
  205. >X    # Terminal is extremely short
  206. >X    iputs(igoto(CM,1,(LINES/2)-1))
  207. >X    write(center(l[1],COLS))
  208. >X    write(center("Copyright (c) Alan D. Corre, 1990",COLS))
  209. >X    }    
  210. >X
  211. >X    return
  212. >X
  213. >Xend
  214. >X
  215. >X
  216. >X
  217. >Xprocedure get_paths()
  218. >X
  219. >X    local paths, p
  220. >X
  221. >X    suspend "./" | "/usr/local/lib/hebcalen/"
  222. >X    paths := getenv("PATH")
  223. >X    \paths ? {
  224. >X    tab(match(":"))
  225. >X    while p := 1(tab(find(":")), move(1))
  226. >X    do suspend "" ~== trim(p,'/ ') || "/"
  227. >X    return "" ~== trim(tab(0) \ 1,'/ ') || "/"
  228. >X    }
  229. >X
  230. >Xend
  231. >X
  232. >X
  233. >X
  234. >Xprocedure instructions(filename)
  235. >X
  236. >X    # Gives user access to a help file which is printed out in chunks
  237. >X    # by "more."
  238. >X
  239. >X    local helpfile, pager, ans
  240. >X
  241. >X    iputs(igoto(getval("cm"),1,2))
  242. >X    writes("Do you need instructions? [ny]  ")
  243. >X    ans := map(read())
  244. >X    "q" == ans & fail
  245. >X
  246. >X    if "y" == ans then {
  247. >X    if close(open(helpfile := (get_paths()||filename)))
  248. >X    then {
  249. >X        # Kludge, kludge, kludge.
  250. >X        close(open(
  251. >X        more_file := (
  252. >X            ("" ~== getenv("PAGER")) |
  253. >X            (("/bin/"|"/usr/ucb/"|"/usr/bin/")||"more"))))
  254. >X        system(more_file || " " || helpfile)
  255. >X    }
  256. >X    else write("Can't find your hebcalen.hlp file!")
  257. >X    iputs(igoto(getval("cm"),1,getval("li")))
  258. >X    boldface()
  259. >X    writes("Press return to continue.")
  260. >X    normal()
  261. >X    "q" == map(read()) & fail
  262. >X    }
  263. >X
  264. >X    return \helpfile | "no help"
  265. >X
  266. >Xend
  267. >X
  268. >X
  269. >X
  270. >Xprocedure clear()
  271. >X
  272. >X    # Clears the screen.  Tries several methods.
  273. >X
  274. >X    if not iputs(getval("cl"))
  275. >X    then iputs(igoto(getval("cm"),1,1))
  276. >X    if not iputs(getval("cd"))
  277. >X    then {
  278. >X    every i := 1 to getval("li") do {
  279. >X        iputs(igoto(getval("cm"),1,i))
  280. >X        iputs(getval("ce"))
  281. >X    }
  282. >X    iputs(igoto(getval("cm"),1,1))
  283. >X    }
  284. >X
  285. >Xend
  286. >X
  287. >X
  288. >X
  289. >Xprocedure initialize_list()
  290. >X
  291. >X    # Put info of hebcalen.dat into a global list
  292. >X
  293. >X    local infile,n
  294. >X
  295. >X    infolist := list(301)
  296. >X    if not (infile := open(get_paths()||"hebcalen.dat")) then
  297. >X    stop("\nError:  hebcalen.dat must be in your path or the current dir.")
  298. >X
  299. >X    # The table is arranged at twenty year intervals with 301 entries.
  300. >X    every n := 1 to 301 do
  301. >X    infolist[n] := read(infile)
  302. >X    close(infile)
  303. >X
  304. >Xend
  305. >X
  306. >X
  307. >X
  308. >Xprocedure initialize_variables()
  309. >X
  310. >X    # Get the closest previous year in the table.
  311. >X
  312. >X    local line, quotient
  313. >X
  314. >X    quotient := jyr.yr / 20 + 1
  315. >X    # Only 301 entries. Figure from last if necessary.
  316. >X    if quotient > 301 then quotient := 301
  317. >X    # Pull the appropriate info, put into global variables.
  318. >X    line := infolist[quotient]
  319. >X
  320. >X    line ? {
  321. >X    current_molad.day := tab(upto('%'))
  322. >X    move(1)
  323. >X    current_molad.halaqim := tab(upto('%'))
  324. >X    move(1)
  325. >X    cyr.mth := tab(upto('%'))
  326. >X    move(1)
  327. >X    cyr.day := tab(upto('%'))
  328. >X    move(1)
  329. >X    cyr.yr := tab(upto('%'))
  330. >X    days_in_jyr := line[-3:0]
  331. >X    }
  332. >X
  333. >X    # Begin at rosh hashana.
  334. >X    jyr.day := 1
  335. >X    jyr.mth := 7
  336. >X    return
  337. >X
  338. >Xend
  339. >X
  340. >X
  341. >X
  342. >Xprocedure initialize(yr)
  343. >X
  344. >X    local year
  345. >X    static current_year
  346. >X
  347. >X    # initialize global variables
  348. >X    initial {
  349. >X    cyr := date(0,0,0)
  350. >X    jyr := date(0,0,0)
  351. >X    current_molad := molad(0,0)
  352. >X    initialize_list()
  353. >X    current_year := get_current_year()
  354. >X    }
  355. >X
  356. >X    clear()
  357. >X    #user may need help
  358. >X    if yr == "*" then {
  359. >X    instructions("hebcalen.hlp") | fail
  360. >X    clear()
  361. >X    iputs(igoto(getval("cm"),1,2))
  362. >X    write("Enter a year.  By default, all dates are interpreted")
  363. >X    write("according to the Jewish calendar.  Civil years should")
  364. >X    write("be preceded by a + or - sign to indicate occurrence")
  365. >X    write("relative to the beginning of the common era (the cur-")
  366. >X    writes("rent civil year, ",current_year,", is the default):  ")
  367. >X    boldface()
  368. >X    year := read()
  369. >X    normal()
  370. >X    "q" == map(year) & fail
  371. >X    }
  372. >X    else year := yr
  373. >X
  374. >X    "" == year & year := current_year
  375. >X    until jyr.yr := cleanup(year) do {
  376. >X    writes("\nI don't consider ")
  377. >X    boldface()
  378. >X    writes(year)
  379. >X    normal()
  380. >X    writes(" a valid date.  Try again:  ")
  381. >X    boldface()
  382. >X    year := read()
  383. >X    normal()
  384. >X    "q" == map(year) & fail
  385. >X    "" == year & year := current_year
  386. >X    }
  387. >X
  388. >X    clear()
  389. >X    initialize_variables()
  390. >X    return
  391. >X
  392. >Xend
  393. >X
  394. >X
  395. >X
  396. >Xprocedure get_current_year()
  397. >X    &date ? c_date := tab(find("/"))
  398. >X    return "+" || c_date
  399. >Xend
  400. >X
  401. >X
  402. >X
  403. >Xprocedure cleanup(str)
  404. >X
  405. >X    # Tidy up the string. Bugs still possible.
  406. >X
  407. >X    if "" == trim(str) then return ""
  408. >X
  409. >X    map(Strip(str,~(&digits++'ABCDE+-'))) ? {
  410. >X
  411. >X    if find("-"|"bc"|"bcd")
  412. >X    then return (0 < (3761 - (0 ~= checkstr(str))))
  413. >X    else if find("+"|"ad"|"ce")
  414. >X    then return ((0 ~= checkstr(str)) + 3760)
  415. >X    else if 0 < integer(str)
  416. >X    then return str
  417. >X    else fail
  418. >X    
  419. >X    }
  420. >X
  421. >Xend
  422. >X
  423. >X
  424. >X
  425. >Xprocedure Strip(s,c)
  426. >X
  427. >X    s2 := ""
  428. >X    s ? {
  429. >X    while s2 ||:= tab(upto(c))
  430. >X    do tab(many(c))
  431. >X    s2 ||:= tab(0)
  432. >X    }
  433. >X    return s2
  434. >X
  435. >Xend
  436. >X
  437. >X
  438. >X
  439. >Xprocedure checkstr(s)
  440. >X
  441. >X    # Does preliminary work on string before cleanup() cleans it up.
  442. >X
  443. >X    local letter,n,newstr
  444. >X
  445. >X    newstr := ""
  446. >X    every newstr ||:= string(integer(!s))
  447. >X    if 0 = *newstr | "" == newstr
  448. >X    then fail
  449. >X    else return newstr
  450. >X
  451. >Xend
  452. >X
  453. >X
  454. >X
  455. >Xprocedure process()
  456. >X
  457. >X    # Extracts information about the specified year.
  458. >X
  459. >X    local msg, limit, dj, dc, month_count, done
  460. >X    static how_many_per_screen, how_many_screens
  461. >X    initial {
  462. >X    how_many_per_screen := how_many_can_fit()
  463. >X    (how_many_screens := seq()) * how_many_per_screen >= 12
  464. >X    }
  465. >X
  466. >X    # 6039 is last year handled by the table in the usual way.
  467. >X    if jyr.yr > 6039
  468. >X    then msg := "Calculating.  Years over 6039 take a long time."
  469. >X    else msg := "Calculating."
  470. >X    if jyr.yr <= 6039 then {
  471. >X    limit := jyr.yr % 20 
  472. >X    jyr.yr := ((jyr.yr / 20) * 20)} else {
  473. >X            # Otherwise figure from 6020 and good luck
  474. >X        limit := jyr.yr - 6020
  475. >X        jyr.yr := 6020
  476. >X    }
  477. >X
  478. >X    ans := "y"
  479. >X    establish_jyr()
  480. >X    iputs(igoto(getval("cm"),1,2))
  481. >X    writes(msg)
  482. >X    every 1 to limit do {
  483. >X    # Increment the years, establish the type of Jewish year
  484. >X    cyr_augment()
  485. >X    jyr_augment()
  486. >X    establish_jyr()
  487. >X    }
  488. >X
  489. >X    clear() 
  490. >X    while ("y"|"") == map(ans) do {
  491. >X
  492. >X    yj := jyr.yr
  493. >X    dj := days_in_jyr
  494. >X
  495. >X    month_count := 0
  496. >X    # On the variable how_many_screens, see initial { } above
  497. >X    every n := 1 to how_many_screens do {
  498. >X        clear()
  499. >X        every 1 to how_many_per_screen do {
  500. >X        write_a_month()
  501. >X        (month_count +:= 1) = 12 & break
  502. >X        }
  503. >X        if month_count < 12 | (12 % (13 > how_many_per_screen)) = 0
  504. >X        then {
  505. >X
  506. >X        iputs(igoto(getval("cm"),1,getval("li")-2))
  507. >X        boldface()
  508. >X        writes(status_line(yj,dj))
  509. >X        normal()
  510. >X
  511. >X        if month_count < 12 | jyr.mth = 6 then {
  512. >X            iputs(igoto(getval("cm"),1,getval("li")-1))
  513. >X            writes("Press return to continue.  ")
  514. >X            "q" == map(read()) & fail
  515. >X        }
  516. >X        }
  517. >X    }
  518. >X
  519. >X    if jyr.mth = 6 then {
  520. >X        if (12 % (13 > how_many_per_screen)) = 0
  521. >X        then clear()
  522. >X        write_a_month()
  523. >X    }
  524. >X    iputs(igoto(getval("cm"),1,getval("li")-2))
  525. >X    boldface()
  526. >X    writes(status_line(yj,dj))
  527. >X    normal()
  528. >X
  529. >X    iputs(igoto(getval("cm"),1,getval("li")-1))
  530. >X    writes("Display the next year? [yn]  ")
  531. >X    ans := read()
  532. >X
  533. >X    }
  534. >X    return
  535. >X
  536. >Xend
  537. >X
  538. >X
  539. >X
  540. >Xprocedure how_many_can_fit()
  541. >X
  542. >X    local LINES, how_many
  543. >X
  544. >X    LINES := getval("li") + 1
  545. >X    (((8 * (how_many := 1 to 14)) / LINES) = 1)
  546. >X
  547. >X    return how_many - 1
  548. >X
  549. >Xend
  550. >X
  551. >X
  552. >X
  553. >Xprocedure cyr_augment()
  554. >X
  555. >X    # Make civil year a year later, we only need consider Aug,Sep,Nov.
  556. >X
  557. >X    local days,newmonth,newday
  558. >X
  559. >X    if cyr.mth = 8 then
  560. >X    days := 0 else
  561. >X    if cyr.mth = 9 then
  562. >X    days := 31 else
  563. >X    if cyr.mth = 10 then
  564. >X    days := 61 else
  565. >X    stop("Error in cyr_augment")
  566. >X
  567. >X    writes(".")
  568. >X
  569. >X    days := (days + cyr.day-365+days_in_jyr)
  570. >X    if isleap(cyr.yr + 1) then days -:= 1
  571. >X
  572. >X    # Cos it takes longer to get there.
  573. >X    if days <= 31 then {newmonth := 8; newday := days} else
  574. >X    if days <= 61 then {newmonth := 9; newday := days-31} else
  575. >X    {newmonth := 10; newday := days-61} 
  576. >X
  577. >X    cyr.mth := newmonth
  578. >X    cyr.day := newday
  579. >X    cyr.yr +:= 1
  580. >X    if cyr.yr = 0 then cyr.yr := 1
  581. >X
  582. >X    return
  583. >X
  584. >Xend
  585. >X
  586. >X
  587. >X
  588. >Xprocedure header()
  589. >X
  590. >X    # Creates the header for Jewish and English side.  Bug:  This
  591. >X    # routine, as it stands, has to rewrite the entire screen, in-
  592. >X    # cluding blank spaces.  Many of these could be elminated by
  593. >X    # judicious line clears and/or cursor movement commands.  Do-
  594. >X    # ing so would certainly speed up screen refresh for lower
  595. >X    # baud rates.  I've utilized the ch command where available,
  596. >X    # but in most cases, plain old spaces must be output.
  597. >X
  598. >X    static make_whitespace, whitespace
  599. >X    initial {
  600. >X    COLS := getval("co")
  601. >X    if getval("ch") then {
  602. >X        # Untested, but it would offer a BIG speed advantage!
  603. >X        make_whitespace := create |iputs(igoto(getval("ch"),(COLS-53)+25))
  604. >X    }
  605. >X    else {
  606. >X        # Have to do things this way, since we don't know what line
  607. >X        # we are on (cm commands usually default to row/col 1).
  608. >X        whitespace := repl(" ",COLS-53)
  609. >X        make_whitespace := create |writes(whitespace)
  610. >X    }
  611. >X    }
  612. >X
  613. >X    writes(repl(" ",7),"S",repl(" ",2),"M",repl(" ",2),"T",repl(" ",2),"W",
  614. >X       repl(" ",2),"T",repl(" ",2),"F",repl(" ",2))
  615. >X    boldface()
  616. >X    writes("S")
  617. >X    normal()
  618. >X    @make_whitespace
  619. >X    writes("S",repl(" ",2),"M",repl(" ",2),"T",repl(" ",2),"W",
  620. >X        repl(" ",2),"T",repl(" ",2),"F",repl(" ",2))
  621. >X    boldface()
  622. >X    writes("S")
  623. >X    normal()
  624. >X    iputs(getval("ce"))
  625. >X    write()
  626. >X
  627. >Xend
  628. >X
  629. >X
  630. >X
  631. >Xprocedure write_a_month()
  632. >X
  633. >X    # Writes a month on the screen
  634. >X
  635. >X    header()
  636. >X    every 1 to 5 do {
  637. >X    writes(make_a_line())
  638. >X    iputs(getval("ce"))
  639. >X    write()
  640. >X    }
  641. >X    if jyr.day ~= 1 then {
  642. >X    writes(make_a_line())
  643. >X    iputs(getval("ce"))
  644. >X    write()
  645. >X    }
  646. >X    iputs(getval("ce"))
  647. >X    write()
  648. >X
  649. >X    return
  650. >X
  651. >Xend
  652. >X
  653. >X
  654. >X
  655. >Xprocedure status_line(a,b)
  656. >X
  657. >X    # Create the status line at the bottom of screen.
  658. >X
  659. >X    local sline,c,d
  660. >X
  661. >X    c := cyr.yr
  662. >X    if (cyr.day = 1) & (cyr.mth = 1) then c -:= 1
  663. >X    d := { if isleap(c) then 366 else 365 }
  664. >X    if getval("co") > 79 then {
  665. >X    sline := ("Year of Creation: " || a || "  Days in year: " || b ||
  666. >X          "  Civil year: " || c || "  Days in year: " || d)
  667. >X    }
  668. >X    else {
  669. >X    sline := ("Jewish year " || a || " (" || b || " days)," ||
  670. >X          " Civil year " || c || " (" || d || " days)")
  671. >X    }
  672. >X
  673. >X    return center(sline,getval("co"))
  674. >X
  675. >Xend
  676. >X
  677. >X
  678. >X
  679. >Xprocedure boldface()
  680. >X    
  681. >X    static bold_str, cookie_str
  682. >X    initial {
  683. >X    if bold_str := getval("so")
  684. >X    then cookie_str := repl(getval("bc") | "\b", getval("sg"))
  685. >X    else {
  686. >X        if bold_str := getval("ul")
  687. >X        then cookie_str := repl(getval("bc") | "\b", getval("ug"))
  688. >X    }
  689. >X    }        
  690. >X    
  691. >X    iputs(\bold_str)
  692. >X    iputs(\cookie_str)
  693. >X    return
  694. >X
  695. >Xend
  696. >X
  697. >X
  698. >X
  699. >Xprocedure normal()
  700. >X
  701. >X    static UN_bold_str, cookie_str
  702. >X    initial {
  703. >X    if UN_bold_str := getval("se")
  704. >X    then cookie_str := repl(getval("bc") | "\b", getval("sg"))
  705. >X    else {
  706. >X        if UN_bold_str := getval("ue")
  707. >X        then cookie_str := repl(getval("bc") | "\b", getval("ug"))
  708. >X    }
  709. >X    }        
  710. >X    
  711. >X    iputs(\UN_bold_str)
  712. >X    iputs(\cookie_str)
  713. >X    return
  714. >X
  715. >Xend
  716. >X
  717. >X
  718. >X#--------------------- end modified sections of code ----------------------#
  719. >X
  720. >X# Okay, okay a couple of things have been modified below, but nothing major.
  721. >X
  722. >Xprocedure make_a_line()
  723. >X#make a single line of the months
  724. >Xlocal line,blanks1,blanks2,start_point,end_point,flag,fm
  725. >Xstatic number_of_spaces
  726. >Xinitial number_of_spaces := getval("co")-55
  727. >X
  728. >X#consider the first line of the month
  729. >X  if jyr.day = 1 then {
  730. >X    line := mth_table(jyr.mth,1)
  731. >X#setting flag means insert civil month at end of line    
  732. >X    flag := 1 } else
  733. >X    line := repl(" ",3)
  734. >X#consider the case where first day of civil month is on Sunday    
  735. >X  if (cyr.day = 1) & (current_day = 1) then flag := 1
  736. >X#space between month name and beginning of calendar
  737. >X  line ||:= repl(" ",2)
  738. >X#measure indentation for first line
  739. >X  line ||:= blanks1 := repl(" ",3*(current_day-1))
  740. >X#establish start point for Hebrew loop
  741. >X  start_point := current_day
  742. >X#establish end point for Hebrew loop and run civil loop
  743. >X  every end_point := start_point to 7 do {
  744. >X    line ||:= right(jyr.day,3)
  745. >X    if not j_augment() then {jyr_augment(); establish_jyr(); current_day -:= 1; if current_day = 0 then current_day := 7}
  746. >X    d_augment()
  747. >X    if jyr.day = 1 then break }
  748. >X#measure indentation for last line
  749. >X  blanks2 := repl(" ",3*(7-end_point))
  750. >X  line ||:= blanks2; line ||:= repl(" ",number_of_spaces); line ||:= blanks1
  751. >X  every start_point to end_point do {
  752. >X    line ||:= right(cyr.day,3)
  753. >X    if (cyr.day = 1) then flag := 1 
  754. >X    augment()}
  755. >X  line ||:= blanks2 ||:= repl(" ",3)
  756. >X  fm := cyr.mth
  757. >X  if cyr.day = 1 then
  758. >X    if cyr.mth = 1 then fm := 12 else fm := cyr.mth - 1
  759. >X  if \flag then line ||:= mth_table(fm,2) else
  760. >X    line ||:= repl(" ",3)
  761. >Xreturn line
  762. >Xend
  763. >X
  764. >Xprocedure mth_table(n,p)
  765. >X#generates the short names of Jewish and Civil months. Get to civil side
  766. >X#by adding 13 (=max no of Jewish months)
  767. >Xstatic corresp
  768. >Xinitial corresp := ["NIS","IYA","SIV","TAM","AV ","ELU","TIS","HES","KIS",
  769. >X"TEV","SHE","ADA","AD2","JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP",
  770. >X"OCT","NOV","DEC"]
  771. >X  if (p ~= 1) & (p ~= 2) then stop("ERROR IN MTH-TABLE") else
  772. >X    if p = 2 then n +:= 13
  773. >Xreturn corresp[n]
  774. >Xend
  775. >X
  776. >Xprocedure d_augment()
  777. >X#increment the day of the week
  778. >X  current_day +:= 1
  779. >X  if current_day = 8 then current_day := 1
  780. >Xreturn
  781. >Xend
  782. >X
  783. >Xprocedure augment()
  784. >X#increments civil day, modifies month and year if necessary, stores in
  785. >X#global variable cyr
  786. >X  if cyr.day < 28 then
  787. >X    cyr.day +:= 1 else
  788. >X  if cyr.day = 28 then {
  789. >X    if (cyr.mth ~= 2) | ((cyr.mth = 2) & isleap(cyr.yr)) then
  790. >X      cyr.day := 29 else {
  791. >X        cyr.mth := 3
  792. >X    cyr.day  := 1}} else
  793. >X  if cyr.day = 29 then {
  794. >X    if cyr.mth ~= 2 then
  795. >X      cyr.day := 30 else {
  796. >X      cyr.mth := 3
  797. >X      cyr.day := 1}} else
  798. >X  if cyr.day = 30 then {
  799. >X    if is_31(cyr.mth) then
  800. >X      cyr.day := 31 else {
  801. >X      cyr.mth +:= 1
  802. >X      cyr.day := 1}} else {
  803. >X      cyr.day := 1
  804. >X      if cyr.mth ~= 12 then
  805. >X        cyr.mth +:= 1 else {
  806. >X        cyr.mth := 1
  807. >X        cyr.yr +:= 1
  808. >X        if cyr.yr = 0
  809. >X      then cyr.yr := 1}}
  810. >Xreturn
  811. >Xend
  812. >X
  813. >Xprocedure is_31(n)
  814. >X#civil months with 31 days
  815. >Xreturn n = 1 | n = 3 | n = 5 | n = 7 | n = 8 | n = 10 | n = 12
  816. >Xend
  817. >X
  818. >Xprocedure isleap(n)
  819. >X#checks for civil leap year
  820. >X  if n > 0 then
  821. >Xreturn (n % 400 = 0) | ((n % 4 = 0) & (n % 100 ~= 0)) else
  822. >Xreturn (n % 400 = -1) | ((n % 4 = -1) & (n % 100 ~= -1))
  823. >Xend
  824. >X
  825. >Xprocedure j_augment()
  826. >X#increments jewish day. months are numbered from nisan, adar sheni is 13.
  827. >X#procedure fails at elul to allow determination of type of new year
  828. >X  if jyr.day < 29 then
  829. >X    jyr.day +:= 1 else
  830. >X  if (jyr.day = 30) | always_29(jyr.mth) | ((jyr.mth = 8) & 
  831. >X    (days_in_jyr % 5 ~= 0)) | ((jyr.mth = 9) & ((days_in_jyr = 353) |
  832. >X    (days_in_jyr = 383))) then
  833. >X    jyr.mth +:= jyr.day := 1 else
  834. >X  if jyr.mth = 6 then fail else
  835. >X  if ((jyr.mth = 12) & (days_in_jyr < 383)) | (jyr.mth = 13) then
  836. >X    jyr.mth := jyr.day := 1 else
  837. >X  jyr.day := 30
  838. >Xreturn
  839. >Xend
  840. >X
  841. >Xprocedure always_29(n)
  842. >X#uncomplicated jewish months with 29 days
  843. >Xreturn n = 2 | n = 4 | n = 10
  844. >Xend
  845. >X
  846. >Xprocedure jyr_augment()
  847. >X#determines the current time of lunation, using the ancient babylonian unit
  848. >X#of 1/1080 of an hour. lunation of tishri determines type of year. allows
  849. >X#for leap year. halaqim = parts of the hour
  850. >Xlocal days, halaqim
  851. >X  days := current_molad.day + 4
  852. >X  if days_in_jyr <= 355 then {
  853. >X    halaqim :=  current_molad.halaqim + 9516
  854. >X    days := ((days +:= halaqim / 25920) % 7)
  855. >X    if days = 0 then days := 7
  856. >X    halaqim := halaqim % 25920} else {
  857. >X    days +:= 1
  858. >X    halaqim := current_molad.halaqim + 23269
  859. >X    days := ((days +:= halaqim / 25920) % 7)
  860. >X    if days = 0 then days := 7
  861. >X    halaqim := halaqim % 25920}
  862. >X  current_molad.day := days
  863. >X  current_molad.halaqim := halaqim
  864. >X#reset the global variable which holds the current jewish date
  865. >X  jyr.yr +:= 1 #increment year
  866. >X  jyr.day := 1
  867. >X  jyr.mth := 7
  868. >X  establish_jyr()
  869. >Xreturn
  870. >Xend
  871. >X
  872. >Xprocedure establish_jyr()
  873. >X#establish the jewish year from get_rh
  874. >Xlocal res
  875. >X  res := get_rh(current_molad.day,current_molad.halaqim,no_lunar_yr(jyr.yr))
  876. >X  days_in_jyr := res[2]
  877. >X  current_day := res[1]
  878. >Xreturn
  879. >Xend    
  880. >X
  881. >Xprocedure isin1(i)
  882. >X#the isin procedures are sets of years in the Metonic cycle
  883. >Xreturn i = (1 | 4 | 7 | 9 | 12 | 15 | 18)
  884. >Xend
  885. >X
  886. >Xprocedure isin2(i)
  887. >Xreturn i = (2 | 5 | 10 | 13 | 16)
  888. >Xend
  889. >X
  890. >Xprocedure isin3(i)
  891. >Xreturn i = (3 | 6 | 8 | 11 | 14 | 17 | 0)
  892. >Xend
  893. >X
  894. >Xprocedure isin4(i)
  895. >Xreturn i = (1 | 2 | 4 | 5 | 7 | 9 | 10 | 12 | 13 | 15 | 16 | 18)
  896. >Xend
  897. >X
  898. >Xprocedure isin5(i)
  899. >Xreturn i = (1 | 4 | 9 | 12 | 15)
  900. >Xend
  901. >X
  902. >Xprocedure isin6(i)
  903. >Xreturn i = (2 | 5 | 7 | 10 | 13 | 16 | 18)
  904. >Xend
  905. >X
  906. >Xprocedure no_lunar_yr(i)
  907. >X#what year in the metonic cycle is it?
  908. >Xreturn i % 19
  909. >Xend
  910. >X
  911. >Xprocedure get_rh(d,h,yr)
  912. >X#this is the heart of the program. check the day of lunation of tishri
  913. >X#and determine where breakpoint is that sets the new moon day in parts
  914. >X#of the hour. return result in a list where 1 is day of rosh hashana and
  915. >X#2 is length of jewish year
  916. >Xlocal c,result
  917. >X  c := no_lunar_yr(yr)
  918. >X  result := list(2)
  919. >X  if d = 1 then {
  920. >X          result[1] := 2
  921. >X                if (h < 9924) & isin4(c) then result[2] := 353 else
  922. >X        if (h < 22091) & isin3(c) then result[2] := 383 else
  923. >X        if (h > 9923) & (isin1(c) | isin2(c)) then result[2] := 355 else
  924. >X        if (h > 22090) & isin3(c) then result[2] := 385
  925. >X        } else
  926. >X  if d = 2 then {
  927. >X          if ((h < 16789) & isin1(c)) |
  928. >X           ((h < 19440) & isin2(c)) then {
  929. >X                                 result[1] := 2
  930. >X                             result[2] := 355
  931. >X                             } else
  932. >X        if (h < 19440) & isin3(c) then  {
  933. >X                                 result[1] := 2
  934. >X                             result[2] := 385
  935. >X                             } else
  936. >X          if ((h > 16788) & isin1(c)) |
  937. >X           ((h > 19439) & isin2(c)) then {
  938. >X                                 result[1] := 3
  939. >X                             result[2] := 354
  940. >X                             } else
  941. >X                if (h > 19439) & isin3(c) then  {
  942. >X                                 result[1] := 3
  943. >X                             result[2] := 384
  944. >X                             }
  945. >X        } else
  946. >X  if d = 3 then {
  947. >X          if (h < 9924) & (isin1(c) | isin2(c)) then {
  948. >X                               result[1] := 3
  949. >X                               result[2] := 354
  950. >X                               } else
  951. >X        if (h < 19440) & isin3(c) then {
  952. >X                           result[1] := 3
  953. >X                           result[2] := 384
  954. >X                           } else
  955. >X        if (h > 9923) & isin4(c) then {
  956. >X                          result[1] := 5
  957. >X                          result[2] := 354
  958. >X                          } else
  959. >X        if (h > 19439) & isin3(c) then {
  960. >X                           result[1] := 5
  961. >X                           result[2] := 383}
  962. >X        } else
  963. >X  if d = 4 then {
  964. >X          result[1] := 5
  965. >X        if isin4(c) then result[2] := 354 else
  966. >X        if h < 12575 then result[2] := 383 else
  967. >X        result[2] := 385
  968. >X        } else
  969. >X  if d = 5 then {
  970. >X                if (h < 9924) & isin4(c) then {
  971. >X                          result[1] := 5
  972. >X                          result[2] := 354} else
  973. >X        if (h < 19440) & isin3(c) then {
  974. >X                           result[1] := 5
  975. >X                           result[2] := 385
  976. >X                           } else
  977. >X        if (9923 < h < 19440) & isin4(c) then {
  978. >X                              result[1] := 5
  979. >X                              result[2] := 355
  980. >X                              } else
  981. >X        if h > 19439 then {
  982. >X                    result[1] := 7
  983. >X                          if isin3(c) then result[2] := 383 else
  984. >X                            result[2] := 353
  985. >X                  }
  986. >X        } else
  987. >X  if d = 6 then {
  988. >X            result[1] := 7
  989. >X            if ((h < 408) & isin5(c)) | ((h < 9924) & isin6(c)) then
  990. >X                              result[2] := 353 else
  991. >X            if ((h < 22091) & isin3(c)) then result[2] := 383 else
  992. >X            if ((h > 407) & isin5(c)) | ((h > 9923) & isin6(c)) then
  993. >X                              result[2] := 355 else
  994. >X            if (h > 22090) & isin3(c) then result[2] := 385
  995. >X            } else
  996. >X  if d = 7 then    if (h < 19440) & (isin5(c) | isin6(c)) then {
  997. >X                              result[1] := 7
  998. >X                              result[2] := 355
  999. >X                              } else
  1000. >X        if (h < 19440) & isin3(c) then {
  1001. >X                           result[1] := 7
  1002. >X                           result[2] := 385
  1003. >X                           } else {
  1004. >X                                  result[1] := 2
  1005. >X                              if isin4(c) then
  1006. >X                                result[2] := 353 else
  1007. >X                            result[2] := 383}
  1008. >Xreturn result
  1009. >Xend
  1010. >SHAR_EOF
  1011. ># ============= itlib.icn ==============
  1012. >echo "x - extracting itlib.icn (Text)"
  1013. >sed 's/^X//' << 'SHAR_EOF' > itlib.icn &&
  1014. >X########################################################################
  1015. >X#    
  1016. >X#    Name:    itlib.icn
  1017. >X#    
  1018. >X#    Title:    Icon termlib-type tools
  1019. >X#    
  1020. >X#    Author:    Richard L. Goerwitz
  1021. >X#
  1022. >X#    Date:    7/19/90 (version 1.3)
  1023. >X#
  1024. >X########################################################################
  1025. >X#
  1026. >X#  Copyright (c) 1990, Richard L. Goerwitz, III
  1027. >X#
  1028. >X#  This software is intended for free and unrestricted distribution.
  1029. >X#  I place only two conditions on its use:  1) That you clearly mark
  1030. >X#  any additions or changes you make to the source code, and 2) that
  1031. >X#  you do not delete this message therefrom.  In order to protect
  1032. >X#  myself from spurious litigation, it must also be stated here that,
  1033. >X#  because this is free software, I, Richard Goerwitz, make no claim
  1034. >X#  about the applicability or fitness of this software for any
  1035. >X#  purpose, and expressly disclaim any responsibility for any damages
  1036. >X#  that might be incurred in conjunction with its use.
  1037. >X#
  1038. >X########################################################################
  1039. >X#
  1040. >X#  The following library represents a series of rough functional
  1041. >X#  equivalents to the standard Unix low-level termcap routines.  They
  1042. >X#  are not meant as exact termlib clones.  Nor are they enhanced to
  1043. >X#  take care of magic cookie terminals, terminals that use \D in their
  1044. >X#  termcap entries, or, in short, anything I felt would not affect my
  1045. >X#  normal, day-to-day work with ANSI and vt100 terminals.
  1046. >X#
  1047. >X#  Requires:  A unix platform & co-expressions.  Certainly the
  1048. >X#  package could be altered for use with MS-DOS and other systems.
  1049. >X#  Please contact me if advice on how to do this is needed.
  1050. >X#
  1051. >X#  setname(term)
  1052. >X#    Use only if you wish to initialize itermlib for a terminal
  1053. >X#  other than what your current environment specifies.  "Term" is the
  1054. >X#  name of the termcap entry to use.  Normally this initialization is
  1055. >X#  done automatically, and need not concern the user.
  1056. >X#
  1057. >X#  getval(id)
  1058. >X#    Works something like tgetnum, tgetflag, and tgetstr.  In the
  1059. >X#  spirit of Icon, all three have been collapsed into one routine.
  1060. >X#  Integer valued caps are returned as integers, strings as strings,
  1061. >X#  and flags as records (if a flag is set, then type(flag) will return
  1062. >X#  "true").  Absence of a given capability is signalled by procedure
  1063. >X#  failure.
  1064. >X#
  1065. >X#  igoto(cm,destcol,destline) - NB:  default 1 offset (*not* zero)!
  1066. >X#    Analogous to tgoto.  "Cm" is the cursor movement command for
  1067. >X#  the current terminal, as obtained via getval("cm").  Igoto()
  1068. >X#  returns a string which, when output via iputs, will cause the
  1069. >X#  cursor to move to column "destcol" and line "destline."  Column and
  1070. >X#  line are always calculated using a *one* offset.  This is far more
  1071. >X#  Iconish than the normal zero offset used by tgoto.  If you want to
  1072. >X#  go to the first square on your screen, then input
  1073. >X#  "igoto(getval("cm"),1,1)."
  1074. >X#
  1075. >X#  iputs(cp,affcnt)
  1076. >X#    Equivalent to tputs.  "Cp" is a string obtained via getval(),
  1077. >X#  or, in the case of "cm," via igoto(getval("cm"),x,y).  Affcnt is a
  1078. >X#  count of affected lines.  It is only relevant for terminals which
  1079. >X#  specify proportional (starred) delays in their termcap entries.
  1080. >X#
  1081. >X##########################################################################
  1082. >X
  1083. >X
  1084. >Xglobal tc_table, tty_speed
  1085. >Xrecord true()
  1086. >X
  1087. >X
  1088. >Xprocedure check_features()
  1089. >X
  1090. >X    local in_params, yes_tabs, line
  1091. >X    # global tty_speed
  1092. >X
  1093. >X    initial {
  1094. >X    find("unix",map(&features)) |
  1095. >X        er("check_features","unix system required",1)
  1096. >X    find("o-expres",&features) |
  1097. >X        er("check_features","co-expressions not implemented - &$#!",1)
  1098. >X    system("/bin/stty tabs") |
  1099. >X        er("check_features","can't set tabs option",1)
  1100. >X    }
  1101. >X
  1102. >X    # clumsy, clumsy, clumsy, and probably won't work on all systems
  1103. >X    in_params := open("/bin/stty 2>&1","pr") | 
  1104. >X    (ospeed := &null, fail)
  1105. >X    every line := !in_params do {
  1106. >X    yes_tabs := find("tabs",line)
  1107. >X    line ? {
  1108. >X        tty_speed := (tab(find("speed")+5), tab(many(' ')),
  1109. >X               integer(tab(many(&digits))))
  1110. >X    }
  1111. >X    }
  1112. >X    close(in_params)
  1113. >X    return "term characteristics reset; features check out"
  1114. >X
  1115. >Xend
  1116. >X
  1117. >X
  1118. >X
  1119. >Xprocedure setname(name)
  1120. >X
  1121. >X    # Sets current terminal type to "name" and builds a new termcap
  1122. >X    # capability database (residing in tc_table).  Fails if unable to
  1123. >X    # find a termcap entry for terminal type "name."  If you want it
  1124. >X    # to terminate with an error message under these circumstances,
  1125. >X    # comment out "| fail" below, and uncomment the er() line.
  1126. >X
  1127. >X    #tc_table is global
  1128. >X    
  1129. >X    check_features()
  1130. >X
  1131. >X    tc_table := maketc_table(getentry(name)) | fail
  1132. >X    # er("setname","no termcap entry found for "||name,3)
  1133. >X    return "successfully reset for terminal " || name
  1134. >X
  1135. >Xend
  1136. >X
  1137. >X
  1138. >X
  1139. >Xprocedure getname()
  1140. >X
  1141. >X    # Getname() first checks to be sure we're running under Unix, and,
  1142. >X    # if so, tries to figure out what the current terminal type is,
  1143. >X    # checking successively the value of the environment variable
  1144. >X    # TERM, and then the output of "tset -".  Terminates with an error
  1145. >X    # message if the terminal type cannot be ascertained.
  1146. >X
  1147. >X    local term, tset_output
  1148. >X
  1149. >X    check_features()
  1150. >X
  1151. >X    if not (term := getenv("TERM")) then {
  1152. >X    tset_output := open("/bin/tset -","pr") |
  1153. >X        er("getname","can't find tset command",1)
  1154. >X    term := !tset_output
  1155. >X    close(tset_output)
  1156. >X    }
  1157. >X    return \term |
  1158. >X    er("getname","can't seem to determine your terminal type",1)
  1159. >X
  1160. >Xend
  1161. >X
  1162. >X
  1163. >X
  1164. >Xprocedure er(func,msg,errnum)
  1165. >X
  1166. >X    # short error processing utility
  1167. >X    write(&errout,func,":  ",msg)
  1168. >X    exit(errnum)
  1169. >X
  1170. >Xend
  1171. >X
  1172. >X
  1173. >X
  1174. >Xprocedure getentry(name)
  1175. >X
  1176. >X    # "Name" designates the current terminal type.  Getentry() scans
  1177. >X    # the current environment for the variable TERMCAP.  If the
  1178. >X    # TERMCAP string represents a termcap entry for a terminal of type
  1179. >X    # "name," then getentry() returns the TERMCAP string.  Otherwise,
  1180. >X    # getentry() will check to see if TERMCAP is a file name.  If so,
  1181. >X    # getentry() will scan that file for an entry corresponding to
  1182. >X    # "name."  If the TERMCAP string does not designate a filename,
  1183. >X    # getentry() will scan /etc/termcap for the correct entry.
  1184. >X    # Whatever the input file, if an entry for terminal "name" is
  1185. >X    # found, getentry() returns that entry.  Otherwise, getentry()
  1186. >X    # fails.
  1187. >X
  1188. >X    local termcap_string, f, getline, line, nm, ent1, ent2
  1189. >X
  1190. >X    termcap_string := getenv("TERMCAP")
  1191. >X
  1192. >X    if \termcap_string ? (not match("/"), pos(0) | tab(find("|")+1), =name)
  1193. >X    then return termcap_string
  1194. >X    else {
  1195. >X
  1196. >X    if find("/",\termcap_string)
  1197. >SHAR_EOF
  1198. >echo "End of  part 1"
  1199. >echo "File itlib.icn is continued in part 2"
  1200. >echo "2" > shar3_seq_.tmp
  1201. >exit 0
  1202. >
  1203. >   -Richard L. Goerwitz              goer%sophist@uchicago.bitnet
  1204. >   goer@sophist.uchicago.edu         rutgers!oddjob!gide!sophist!goer
  1205.  
  1206. ---- Cut Here and unpack ----
  1207. #!/bin/sh
  1208. # this is hebcalen.03 (part 3 of a multipart archive)
  1209. # do not concatenate these parts, unpack them in order with /bin/sh
  1210. # file cal.text continued
  1211. #
  1212. if test ! -r shar3_seq_.tmp; then
  1213.     echo "Please unpack part 1 first!"
  1214.     exit 1
  1215. fi
  1216. (read Scheck
  1217.  if test "$Scheck" != 3; then
  1218.     echo "Please unpack part $Scheck next!"
  1219.     exit 1
  1220.  else
  1221.     exit 0
  1222.  fi
  1223. ) < shar3_seq_.tmp || exit 1
  1224. echo "x - Continuing file cal.text"
  1225. sed 's/^X//' << 'SHAR_EOF' >> cal.text &&
  1226. X  write(repl(" ",7),"S",repl(" ",2),"M",repl(" ",2),"T",repl(" ",2),"W",
  1227. X        repl(" ",2),"T",repl(" ",2),"F",repl(" ",2),"\e[7mS\e[0m",repl(" ",27),
  1228. X        "S",repl(" ",2),"M",repl(" ",2),"T",repl(" ",2),"W",
  1229. X        repl(" ",2),"T",repl(" ",2),"F",repl(" ",2),"\e[7mS\e[0m")
  1230. Xend
  1231. X
  1232. Xprocedure write_a_month()
  1233. X#writes a month on the screen
  1234. X  header()
  1235. X  every 1 to 5 do 
  1236. X    write(make_a_line())
  1237. X  if jyr.day ~= 1 then
  1238. X    write(make_a_line())
  1239. X  write()
  1240. Xreturn
  1241. Xend
  1242. X
  1243. Xprocedure status_line(a,b)
  1244. X#create the status line at the bottom of screen
  1245. Xlocal sline,c,d
  1246. X  c := cyr.yr
  1247. X  if (cyr.day = 1) & (cyr.mth = 1) then c -:= 1
  1248. X  d := 365
  1249. X  if isleap(c) then d := 366
  1250. X#if ANSI not available omit "\e[7m" and "|| "\e[0m""
  1251. X  sline := ("\e[7mYear of Creation: " || a || "  Days in year: " || b ||
  1252. X    "  Civil year: " || c || "  Days in year: " || d || "\e[0m")
  1253. Xreturn sline
  1254. Xend
  1255. X
  1256. Xprocedure make_a_line()
  1257. X#make a single line of the months
  1258. Xlocal line,blanks1,blanks2,start_point,end_point,flag,fm
  1259. X
  1260. X#consider the first line of the month
  1261. X  if jyr.day = 1 then {
  1262. X    line := mth_table(jyr.mth,1)
  1263. X#setting flag means insert civil month at end of line    
  1264. X    flag := 1 } else
  1265. X    line := repl(" ",3)
  1266. X#consider the case where first day of civil month is on Sunday    
  1267. X  if (cyr.day = 1) & (current_day = 1) then flag := 1
  1268. X#space between month name and beginning of calendar
  1269. X  line ||:= repl(" ",2)
  1270. X#measure indentation for first line
  1271. X  line ||:= blanks1 := repl(" ",3*(current_day-1))
  1272. X#establish start point for Hebrew loop
  1273. X  start_point := current_day
  1274. X#establish end point for Hebrew loop and run civil loop
  1275. X  every end_point := start_point to 7 do {
  1276. X    line ||:= right(jyr.day,3)
  1277. X    if not j_augment() then {jyr_augment(); establish_jyr(); current_day -:= 1; if current_day = 0 then current_day := 7}
  1278. X    d_augment()
  1279. X    if jyr.day = 1 then break }
  1280. X#measure indentation for last line
  1281. X  blanks2 := repl(" ",3*(7-end_point))
  1282. X  line ||:= blanks2; line ||:= repl(" ",25); line ||:= blanks1
  1283. X  every start_point to end_point do {
  1284. X    line ||:= right(cyr.day,3)
  1285. X    if (cyr.day = 1) then flag := 1 
  1286. X    augment()}
  1287. X  line ||:= blanks2 ||:= repl(" ",3)
  1288. X  fm := cyr.mth
  1289. X  if cyr.day = 1 then
  1290. X    if cyr.mth = 1 then fm := 12 else fm := cyr.mth - 1
  1291. X  if \flag then line ||:= mth_table(fm,2) else
  1292. X    line ||:= repl(" ",3)
  1293. Xreturn line
  1294. Xend
  1295. X
  1296. Xprocedure mth_table(n,p)
  1297. X#generates the short names of Jewish and Civil months. Get to civil side
  1298. X#by adding 13 (=max no of Jewish months)
  1299. Xstatic corresp
  1300. Xinitial corresp := ["NIS","IYA","SIV","TAM","AV ","ELU","TIS","HES","KIS",
  1301. X"TEV","SHE","ADA","AD2","JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP",
  1302. X"OCT","NOV","DEC"]
  1303. X  if (p ~= 1) & (p ~= 2) then stop("ERROR IN MTH-TABLE") else
  1304. X    if p = 2 then n +:= 13
  1305. Xreturn corresp[n]
  1306. Xend
  1307. X
  1308. Xprocedure d_augment()
  1309. X#increment the day of the week
  1310. X  current_day +:= 1
  1311. X  if current_day = 8 then current_day := 1
  1312. Xreturn
  1313. Xend
  1314. X
  1315. Xprocedure augment()
  1316. X#increments civil day, modifies month and year if necessary, stores in
  1317. X#global variable cyr
  1318. X  if cyr.day < 28 then
  1319. X    cyr.day +:= 1 else
  1320. X  if cyr.day = 28 then {
  1321. X    if (cyr.mth ~= 2) | ((cyr.mth = 2) & isleap(cyr.yr)) then
  1322. X      cyr.day := 29 else {
  1323. X        cyr.mth := 3
  1324. X    cyr.day  := 1}} else
  1325. X  if cyr.day = 29 then {
  1326. X    if cyr.mth ~= 2 then
  1327. X      cyr.day := 30 else {
  1328. X      cyr.mth := 3
  1329. X      cyr.day := 1}} else
  1330. X  if cyr.day = 30 then {
  1331. X    if is_31(cyr.mth) then
  1332. X      cyr.day := 31 else {
  1333. X      cyr.mth +:= 1
  1334. X      cyr.day := 1}} else {
  1335. X      cyr.day := 1
  1336. X      if cyr.mth ~= 12 then
  1337. X        cyr.mth +:= 1 else {
  1338. X        cyr.mth := 1
  1339. X        cyr.yr +:= 1
  1340. X        if cyr.yr = 0
  1341. X      then cyr.yr := 1}}
  1342. Xreturn
  1343. Xend
  1344. X
  1345. Xprocedure is_31(n)
  1346. X#civil months with 31 days
  1347. Xreturn n = 1 | n = 3 | n = 5 | n = 7 | n = 8 | n = 10 | n = 12
  1348. Xend
  1349. X
  1350. Xprocedure isleap(n)
  1351. X#checks for civil leap year
  1352. X  if n > 0 then
  1353. Xreturn (n % 400 = 0) | ((n % 4 = 0) & (n % 100 ~= 0)) else
  1354. Xreturn (n % 400 = -1) | ((n % 4 = -1) & (n % 100 ~= -1))
  1355. Xend
  1356. X
  1357. Xprocedure j_augment()
  1358. X#increments jewish day. months are numbered from nisan, adar sheni is 13.
  1359. X#procedure fails at elul to allow determination of type of new year
  1360. X  if jyr.day < 29 then
  1361. X    jyr.day +:= 1 else
  1362. X  if (jyr.day = 30) | always_29(jyr.mth) | ((jyr.mth = 8) & 
  1363. X    (days_in_jyr % 5 ~= 0)) | ((jyr.mth = 9) & ((days_in_jyr = 353) |
  1364. X    (days_in_jyr = 383))) then
  1365. X    jyr.mth +:= jyr.day := 1 else
  1366. X  if jyr.mth = 6 then fail else
  1367. X  if ((jyr.mth = 12) & (days_in_jyr < 383)) | (jyr.mth = 13) then
  1368. X    jyr.mth := jyr.day := 1 else
  1369. X  jyr.day := 30
  1370. Xreturn
  1371. Xend
  1372. X
  1373. Xprocedure always_29(n)
  1374. X#uncomplicated jewish months with 29 days
  1375. Xreturn n = 2 | n = 4 | n = 10
  1376. Xend
  1377. X
  1378. Xprocedure jyr_augment()
  1379. X#determines the current time of lunation, using the ancient babylonian unit
  1380. X#of 1/1080 of an hour. lunation of tishri determines type of year. allows
  1381. X#for leap year. halaqim = parts of the hour
  1382. Xlocal days, halaqim
  1383. X  days := current_molad.day + 4
  1384. X  if days_in_jyr <= 355 then {
  1385. X    halaqim :=  current_molad.halaqim + 9516
  1386. X    days := ((days +:= halaqim / 25920) % 7)
  1387. X    if days = 0 then days := 7
  1388. X    halaqim := halaqim % 25920} else {
  1389. X    days +:= 1
  1390. X    halaqim := current_molad.halaqim + 23269
  1391. X    days := ((days +:= halaqim / 25920) % 7)
  1392. X    if days = 0 then days := 7
  1393. X    halaqim := halaqim % 25920}
  1394. X  current_molad.day := days
  1395. X  current_molad.halaqim := halaqim
  1396. X#reset the global variable which holds the current jewish date
  1397. X  jyr.yr +:= 1 #increment year
  1398. X  jyr.day := 1
  1399. X  jyr.mth := 7
  1400. X  establish_jyr()
  1401. Xreturn
  1402. Xend
  1403. X
  1404. Xprocedure establish_jyr()
  1405. X#establish the jewish year from get_rh
  1406. Xlocal res
  1407. X  res := get_rh(current_molad.day,current_molad.halaqim,no_lunar_yr(jyr.yr))
  1408. X  days_in_jyr := res[2]
  1409. X  current_day := res[1]
  1410. Xreturn
  1411. Xend    
  1412. X
  1413. Xprocedure isin1(i)
  1414. X#the isin procedures are sets of years in the Metonic cycle
  1415. Xreturn i = (1 | 4 | 7 | 9 | 12 | 15 | 18)
  1416. Xend
  1417. X
  1418. Xprocedure isin2(i)
  1419. Xreturn i = (2 | 5 | 10 | 13 | 16)
  1420. Xend
  1421. X
  1422. Xprocedure isin3(i)
  1423. Xreturn i = (3 | 6 | 8 | 11 | 14 | 17 | 0)
  1424. Xend
  1425. X
  1426. Xprocedure isin4(i)
  1427. Xreturn i = (1 | 2 | 4 | 5 | 7 | 9 | 10 | 12 | 13 | 15 | 16 | 18)
  1428. Xend
  1429. X
  1430. Xprocedure isin5(i)
  1431. Xreturn i = (1 | 4 | 9 | 12 | 15)
  1432. Xend
  1433. X
  1434. Xprocedure isin6(i)
  1435. Xreturn i = (2 | 5 | 7 | 10 | 13 | 16 | 18)
  1436. Xend
  1437. X
  1438. Xprocedure no_lunar_yr(i)
  1439. X#what year in the metonic cycle is it?
  1440. Xreturn i % 19
  1441. Xend
  1442. X
  1443. Xprocedure get_rh(d,h,yr)
  1444. X#this is the heart of the program. check the day of lunation of tishri
  1445. X#and determine where breakpoint is that sets the new moon day in parts
  1446. X#of the hour. return result in a list where 1 is day of rosh hashana and
  1447. X#2 is length of jewish year
  1448. Xlocal c,result
  1449. X  c := no_lunar_yr(yr)
  1450. X  result := list(2)
  1451. X  if d = 1 then {
  1452. X          result[1] := 2
  1453. X                if (h < 9924) & isin4(c) then result[2] := 353 else
  1454. X        if (h < 22091) & isin3(c) then result[2] := 383 else
  1455. X        if (h > 9923) & (isin1(c) | isin2(c)) then result[2] := 355 else
  1456. X        if (h > 22090) & isin3(c) then result[2] := 385
  1457. X        } else
  1458. X  if d = 2 then {
  1459. X          if ((h < 16789) & isin1(c)) |
  1460. X           ((h < 19440) & isin2(c)) then {
  1461. X                                 result[1] := 2
  1462. X                             result[2] := 355
  1463. X                             } else
  1464. X        if (h < 19440) & isin3(c) then  {
  1465. X                                 result[1] := 2
  1466. X                             result[2] := 385
  1467. X                             } else
  1468. X          if ((h > 16788) & isin1(c)) |
  1469. X           ((h > 19439) & isin2(c)) then {
  1470. X                                 result[1] := 3
  1471. X                             result[2] := 354
  1472. X                             } else
  1473. X                if (h > 19439) & isin3(c) then  {
  1474. X                                 result[1] := 3
  1475. X                             result[2] := 384
  1476. X                             }
  1477. X        } else
  1478. X  if d = 3 then {
  1479. X          if (h < 9924) & (isin1(c) | isin2(c)) then {
  1480. X                               result[1] := 3
  1481. X                               result[2] := 354
  1482. X                               } else
  1483. X        if (h < 19440) & isin3(c) then {
  1484. X                           result[1] := 3
  1485. X                           result[2] := 384
  1486. X                           } else
  1487. X        if (h > 9923) & isin4(c) then {
  1488. X                          result[1] := 5
  1489. X                          result[2] := 354
  1490. X                          } else
  1491. X        if (h > 19439) & isin3(c) then {
  1492. X                           result[1] := 5
  1493. X                           result[2] := 383}
  1494. X        } else
  1495. X  if d = 4 then {
  1496. X          result[1] := 5
  1497. X        if isin4(c) then result[2] := 354 else
  1498. X        if h < 12575 then result[2] := 383 else
  1499. X        result[2] := 385
  1500. X        } else
  1501. X  if d = 5 then {
  1502. X                if (h < 9924) & isin4(c) then {
  1503. X                          result[1] := 5
  1504. X                          result[2] := 354} else
  1505. X        if (h < 19440) & isin3(c) then {
  1506. X                           result[1] := 5
  1507. X                           result[2] := 385
  1508. X                           } else
  1509. X        if (9923 < h < 19440) & isin4(c) then {
  1510. X                              result[1] := 5
  1511. X                              result[2] := 355
  1512. X                              } else
  1513. X        if h > 19439 then {
  1514. X                    result[1] := 7
  1515. X                          if isin3(c) then result[2] := 383 else
  1516. X                            result[2] := 353
  1517. X                  }
  1518. X        } else
  1519. X  if d = 6 then {
  1520. X            result[1] := 7
  1521. X            if ((h < 408) & isin5(c)) | ((h < 9924) & isin6(c)) then
  1522. X                              result[2] := 353 else
  1523. X            if ((h < 22091) & isin3(c)) then result[2] := 383 else
  1524. X            if ((h > 407) & isin5(c)) | ((h > 9923) & isin6(c)) then
  1525. X                              result[2] := 355 else
  1526. X            if (h > 22090) & isin3(c) then result[2] := 385
  1527. X            } else
  1528. X  if d = 7 then    if (h < 19440) & (isin5(c) | isin6(c)) then {
  1529. X                              result[1] := 7
  1530. X                              result[2] := 355
  1531. X                              } else
  1532. X        if (h < 19440) & isin3(c) then {
  1533. X                           result[1] := 7
  1534. X                           result[2] := 385
  1535. X                           } else {
  1536. X                                  result[1] := 2
  1537. X                              if isin4(c) then
  1538. X                                result[2] := 353 else
  1539. X                            result[2] := 383}
  1540. Xreturn result
  1541. Xend
  1542. X
  1543. X
  1544. X#If the following help file doesnt quite look right try throwing in a
  1545. X#few blank lines here or there, or take them out.
  1546. X#End of section one------------CUT HERE----------------------------------
  1547. X
  1548. XThis program accepts a year of the Jewish calendar, for example
  1549. X"5750", and produces on the screen a calendar of that year with a 
  1550. Xvisually equivalent civil calendar opposite it for easy conversion of 
  1551. Xdates. The months of the civil year are abbreviated to
  1552. X
  1553. XJAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC
  1554. X
  1555. Xand of the Jewish calendar to
  1556. X
  1557. XNIS IYA SIV TAM AV ELU TIS HES KIS TEV SHE ADA AD2.
  1558. X
  1559. XMonths are normally displayed three at a time. You call up the next
  1560. Xthree by hitting return. At the end of the year you can indicate if
  1561. Xyou wish the program to conclude, by hitting return again. If in
  1562. Xresponse to the question, Do you wish to continue? you enter "y" and
  1563. Xhit return, the next year will be displayed.
  1564. X
  1565. XEach Jewish month has its name on the left. The corresponding secular
  1566. Xdates will have the name of the month on the right, and when the month
  1567. Xchanges it will be indicated on the right also.
  1568. X
  1569. X
  1570. X
  1571. X
  1572. XIf you wish, you may enter a civil year in the form -70 for BCE dates
  1573. Xand +70 for CE dates. The Jewish year beginning prior to Jan 1 of that
  1574. Xyear will be displayed, and you can continue with the next Jewish year
  1575. Xif you wish to complete the desired civil year.
  1576. X
  1577. XYou may enter CE or AD instead of + or BC or BCE instead of the minus
  1578. Xsign if you wish. It is best to avoid spaces, so enter 1987AD, for
  1579. Xexample.
  1580. X
  1581. XThe year 0 is not meaningful in either calendar. No date prior to 1 
  1582. Xin the Jewish calendar should be entered. The program will calculate
  1583. Xany future year, but will take longer for years much beyond the year
  1584. X6020 in the Jewish reckoning. For example, the year 7000 will take
  1585. Xthree minutes or so to appear. Earlier years should appear in a few
  1586. Xseconds.
  1587. X
  1588. XA status line at the bottom of the screen indicates the civil and
  1589. XJewish year, and the number of days in each. Jewish years may contain
  1590. X354, 355, 356, 384, 385 or 386 days according to circumstances.
  1591. X
  1592. X
  1593. X
  1594. X
  1595. XWhen you are familiar with this program you can enter the years you
  1596. Xwish to see on the command line. For example, if you call the program
  1597. X           iconx calendar 5704 +1987 1BC
  1598. Xyou will see in turn the Jewish year 5704, the Jewish year commencing
  1599. Xin 1986 and the Jewish year commencing in 2 B.C.E. You still have the
  1600. Xoption of seeing the years subsequent to these years if you wish. Just
  1601. Xenter "y" when asked if you want to continue. When you enter "n", you
  1602. Xwill get the next year of your list.
  1603. X
  1604. XAll civil dates are according to the Gregorian Calendar which first
  1605. Xcame into use in 1582 and was accepted in different places at
  1606. Xdifferent times. Prior to that date the Julian calendar was in use. At
  1607. Xthe present time the Julian calendar is 13 days behind the Gregorian
  1608. XCalendar, so that March 15 1917 in our reckoning is March 2 in the
  1609. XJulian Calendar. The following table shows the number of days that
  1610. Xmust be subtracted from the Gregorian date given here to find the Julian
  1611. Xdate. In the early centuries of this table and before the calendar was
  1612. Xintercalated erratically, so a simple subtraction is not possible. Note that
  1613. Xthe change in the number to subtract applies from March 1 in the century
  1614. Xyear, since in the Julian Calendar that will be February 29 except in years
  1615. Xdivisible by 400 which are leap years in the Gregorian calendar also.
  1616. X
  1617. XCentury        # to subtract        Century        # to subtract
  1618. X  21            13          11            6
  1619. X  20            13          10            5
  1620. X  19            12           9            4
  1621. X  18            11           8            4
  1622. X  17            10           7            3
  1623. X  16            10           6            2
  1624. X  15             9           5            1
  1625. X  14             8           4            1
  1626. X  13             7           3            0
  1627. X  12             7           2               -1
  1628. X                         1               -2
  1629. X#End of section two-----------CUT HERE----------------------------------
  1630. X3%8255%8%20%-3762%384
  1631. X4%23479%9%8%-3742%354
  1632. X4%24950%8%28%-3722%354
  1633. X5%501%8%17%-3702%385
  1634. X6%15725%9%6%-3682%355
  1635. X6%17196%8%26%-3662%355
  1636. X6%18667%8%15%-3642%383
  1637. X1%7971%9%3%-3622%353
  1638. X1%9442%8%23%-3602%383
  1639. X2%24666%9%10%-3582%354
  1640. X3%217%8%30%-3562%354
  1641. X3%1688%8%19%-3542%384
  1642. X4%16912%9%7%-3522%354
  1643. X4%18383%8%27%-3502%354
  1644. X4%19854%8%17%-3482%385
  1645. X6%9158%9%5%-3462%355
  1646. X6%10629%8%25%-3442%355
  1647. X6%12100%8%14%-3422%383
  1648. X1%1404%9%2%-3402%353
  1649. X1%2875%8%23%-3382%383
  1650. X2%18099%9%10%-3362%354
  1651. X2%19570%8%30%-3342%354
  1652. X2%21041%8%19%-3322%384
  1653. X4%10345%9%7%-3302%354
  1654. X4%11816%8%28%-3282%354
  1655. X4%13287%8%17%-3262%385
  1656. X6%2591%9%5%-3242%353
  1657. X6%4062%8%25%-3222%383
  1658. X7%19286%9%11%-3202%355
  1659. X7%20757%9%2%-3182%353
  1660. X7%22228%8%22%-3162%383
  1661. X2%11532%9%8%-3142%355
  1662. X2%13003%8%28%-3122%355
  1663. X2%14474%8%17%-3102%385
  1664. X4%3778%9%7%-3082%354
  1665. X4%5249%8%27%-3062%354
  1666. X4%6720%8%16%-3042%383
  1667. X5%21944%9%4%-3022%353
  1668. X5%23415%8%24%-3002%383
  1669. X7%12719%9%11%-2982%355
  1670. X7%14190%8%31%-2962%355
  1671. X7%15661%8%20%-2942%385
  1672. X2%4965%9%8%-2922%355
  1673. X2%6436%8%28%-2902%355
  1674. X2%7907%8%18%-2882%385
  1675. X3%23131%9%7%-2862%354
  1676. X3%24602%8%27%-2842%383
  1677. X5%13906%9%13%-2822%355
  1678. X5%15377%9%2%-2802%355
  1679. X5%16848%8%22%-2782%385
  1680. X7%6152%9%10%-2762%355
  1681. X7%7623%8%30%-2742%355
  1682. X7%9094%8%19%-2722%385
  1683. X1%24318%9%7%-2702%355
  1684. X1%25789%8%28%-2682%355
  1685. X2%1340%8%17%-2662%385
  1686. X3%16564%9%6%-2642%354
  1687. X3%18035%8%24%-2622%384
  1688. X5%7339%9%12%-2602%354
  1689. X5%8810%9%2%-2582%354
  1690. X5%10281%8%22%-2562%385
  1691. X6%25505%9%10%-2542%355
  1692. X7%1056%8%30%-2522%355
  1693. X7%2527%8%19%-2502%385
  1694. X1%17751%9%8%-2482%355
  1695. X1%19222%8%28%-2462%383
  1696. X3%8526%9%15%-2442%354
  1697. X3%9997%9%6%-2422%354
  1698. X3%11468%8%24%-2402%384
  1699. X5%772%9%12%-2382%354
  1700. X5%2243%9%1%-2362%354
  1701. X5%3714%8%21%-2342%385
  1702. X6%18938%9%9%-2322%355
  1703. X6%20409%8%29%-2302%355
  1704. X6%21880%8%19%-2282%383
  1705. X1%11184%9%7%-2262%355
  1706. X1%12655%8%27%-2242%383
  1707. X3%1959%9%14%-2222%354
  1708. X3%3430%9%3%-2202%354
  1709. X3%4901%8%24%-2182%384
  1710. X4%20125%9%12%-2162%354
  1711. X4%21596%9%1%-2142%354
  1712. X4%23067%8%21%-2122%385
  1713. X6%12371%9%9%-2102%355
  1714. X6%13842%8%30%-2082%383
  1715. X1%3146%9%18%-2062%353
  1716. X1%4617%9%7%-2042%353
  1717. X1%6088%8%27%-2022%383
  1718. X2%21312%9%14%-2002%354
  1719. X2%22783%9%3%-1982%354
  1720. X2%24254%8%23%-1962%384
  1721. X4%13558%9%11%-1942%354
  1722. X4%15029%8%31%-1922%354
  1723. X4%16500%8%20%-1902%385
  1724. X6%5804%9%9%-1882%353
  1725. X6%7275%8%29%-1862%383
  1726. X7%22499%9%17%-1842%353
  1727. X7%23970%9%6%-1822%353
  1728. X7%25441%8%26%-1802%383
  1729. X2%14745%9%13%-1782%355
  1730. X2%16216%9%2%-1762%355
  1731. X2%17687%8%22%-1742%385
  1732. X4%6991%9%11%-1722%354
  1733. X4%8462%8%31%-1702%383
  1734. X5%23686%9%20%-1682%353
  1735. X5%25157%9%9%-1662%353
  1736. X6%708%8%29%-1642%383
  1737. X7%15932%9%15%-1622%355
  1738. X7%17403%9%4%-1602%355
  1739. X7%18874%8%24%-1582%385
  1740. X2%8178%9%12%-1562%355
  1741. X2%9649%9%1%-1542%355
  1742. X2%11120%8%21%-1522%385
  1743. X4%424%9%10%-1502%354
  1744. X4%1895%8%31%-1482%383
  1745. X5%17119%9%17%-1462%355
  1746. X5%18590%9%6%-1442%355
  1747. X5%20061%8%28%-1422%383
  1748. X7%9365%9%14%-1402%355
  1749. X7%10836%9%4%-1382%355
  1750. X7%12307%8%24%-1362%385
  1751. X2%1611%9%12%-1342%355
  1752. X2%3082%9%1%-1322%385
  1753. X3%18306%9%21%-1302%354
  1754. X3%19777%9%11%-1282%354
  1755. X3%21248%8%31%-1262%383
  1756. X5%10552%9%17%-1242%355
  1757. X5%12023%9%6%-1222%355
  1758. X5%13494%8%26%-1202%385
  1759. X7%2798%9%14%-1182%355
  1760. X7%4269%9%3%-1162%355
  1761. X7%5740%8%23%-1142%385
  1762. X1%20964%9%11%-1122%355
  1763. X1%22435%8%31%-1102%385
  1764. X3%11739%9%21%-1082%354
  1765. X3%13210%9%10%-1062%354
  1766. X3%14681%8%28%-1042%384
  1767. X5%3985%9%16%-1022%354
  1768. X5%5456%9%5%-1002%354
  1769. X5%6927%8%26%-982%385
  1770. X6%22151%9%14%-962%355
  1771. X6%23622%9%3%-942%385
  1772. X1%12926%9%22%-922%355
  1773. X1%14397%9%11%-902%355
  1774. X1%15868%9%1%-882%383
  1775. X3%5172%9%19%-862%354
  1776. X3%6643%9%8%-842%354
  1777. X3%8114%8%28%-822%384
  1778. X4%23338%9%16%-802%354
  1779. X4%24809%9%5%-782%354
  1780. X5%360%8%25%-762%385
  1781. X6%15584%9%13%-742%355
  1782. X6%17055%9%2%-722%383
  1783. X1%6359%9%21%-702%353
  1784. X1%7830%9%11%-682%353
  1785. X1%9301%8%31%-662%383
  1786. X2%24525%9%18%-642%354
  1787. X3%76%9%7%-622%354
  1788. X3%1547%8%27%-602%384
  1789. X4%16771%9%16%-582%354
  1790. X4%18242%9%5%-562%385
  1791. X6%7546%9%24%-542%355
  1792. X6%9017%9%13%-522%353
  1793. X6%10488%9%2%-502%383
  1794. X7%25712%9%22%-482%353
  1795. X1%1263%9%11%-462%353
  1796. X1%2734%8%31%-442%383
  1797. X2%17958%9%18%-422%354
  1798. X2%19429%9%6%-402%355
  1799. X2%20900%8%27%-382%384
  1800. X4%10204%9%15%-362%354
  1801. X4%11675%9%4%-342%383
  1802. X6%979%9%23%-322%355
  1803. X6%2450%9%12%-302%353
  1804. X6%3921%9%2%-282%383
  1805. X7%19145%9%19%-262%355
  1806. X7%20616%9%10%-242%353
  1807. X7%22087%8%30%-222%383
  1808. X2%11391%9%16%-202%355
  1809. X2%12862%9%6%-182%385
  1810. X4%2166%9%26%-162%354
  1811. X4%3637%9%15%-142%354
  1812. X4%5108%9%4%-122%383
  1813. X5%20332%9%23%-102%353
  1814. X5%21803%9%13%-82%353
  1815. X5%23274%9%2%-62%383
  1816. X7%12578%9%19%-42%355
  1817. X7%14049%9%8%-22%355
  1818. X7%15520%8%28%-2%385
  1819. X2%4824%9%16%19%355
  1820. X2%6295%9%5%39%385
  1821. X3%21519%9%25%59%354
  1822. X3%22990%9%14%79%354
  1823. X3%24461%9%3%99%383
  1824. X5%13765%9%21%119%355
  1825. X5%15236%9%10%139%355
  1826. X5%16707%8%30%159%385
  1827. X7%6011%9%18%179%355
  1828. X7%7482%9%7%199%385
  1829. X1%22706%9%27%219%355
  1830. X1%24177%9%16%239%355
  1831. X1%25648%9%5%259%385
  1832. X3%14952%9%25%279%354
  1833. X3%16423%9%14%299%354
  1834. X3%17894%9%2%319%384
  1835. X5%7198%9%21%339%354
  1836. X5%8669%9%10%359%354
  1837. X5%10140%8%30%379%385
  1838. X6%25364%9%18%399%355
  1839. X7%915%9%7%419%385
  1840. X1%16139%9%26%439%355
  1841. X1%17610%9%15%459%355
  1842. X1%19081%9%4%479%383
  1843. X3%8385%9%22%499%354
  1844. X3%9856%9%12%519%354
  1845. X3%11327%9%1%539%384
  1846. X5%631%9%20%559%354
  1847. X5%2102%9%9%579%385
  1848. X6%17326%9%28%599%355
  1849. X6%18797%9%18%619%355
  1850. X6%20268%9%7%639%383
  1851. X1%9572%9%26%659%353
  1852. X1%11043%9%15%679%355
  1853. X1%12514%9%4%699%383
  1854. X3%1818%9%23%719%354
  1855. X3%3289%9%12%739%354
  1856. X3%4760%9%1%759%384
  1857. X4%19984%9%20%779%354
  1858. X4%21455%9%9%799%385
  1859. X6%10759%9%28%819%355
  1860. X6%12230%9%17%839%355
  1861. X6%13701%9%6%859%383
  1862. X1%3005%9%25%879%353
  1863. X1%4476%9%14%899%353
  1864. X1%5947%9%4%919%383
  1865. X2%21171%9%22%939%354
  1866. X2%22642%9%11%959%384
  1867. X4%11946%9%30%979%354
  1868. X4%13417%9%19%999%354
  1869. X4%14888%9%9%1019%385
  1870. X6%4192%9%28%1039%355
  1871. X6%5663%9%17%1059%353
  1872. X6%7134%9%6%1079%383
  1873. X7%22358%9%25%1099%353
  1874. X7%23829%9%15%1119%353
  1875. X7%25300%9%4%1139%383
  1876. X2%14604%9%21%1159%355
  1877. X2%16075%9%10%1179%385
  1878. X4%5379%9%30%1199%354
  1879. X4%6850%9%19%1219%354
  1880. X4%8321%9%8%1239%383
  1881. X5%23545%9%27%1259%353
  1882. X5%25016%9%16%1279%353
  1883. X6%567%9%5%1299%383
  1884. X7%15791%9%23%1319%355
  1885. X7%17262%9%12%1339%385
  1886. X2%6566%10%1%1359%355
  1887. X2%8037%9%20%1379%355
  1888. X2%9508%9%9%1399%385
  1889. X3%24732%9%30%1419%354
  1890. X4%283%9%19%1439%354
  1891. X4%1754%9%8%1459%383
  1892. X5%16978%9%25%1479%355
  1893. X5%18449%9%14%1499%355
  1894. X5%19920%9%6%1519%383
  1895. X7%9224%9%23%1539%355
  1896. X7%10695%9%12%1559%385
  1897. X1%25919%10%1%1579%355
  1898. X2%1470%9%20%1599%355
  1899. X2%2941%9%9%1619%385
  1900. X3%18165%9%29%1639%354
  1901. X3%19636%9%18%1659%354
  1902. X3%21107%9%7%1679%383
  1903. X5%10411%9%24%1699%355
  1904. X5%11882%9%14%1719%385
  1905. X7%1186%10%3%1739%355
  1906. X7%2657%9%22%1759%355
  1907. X7%4128%9%11%1779%385
  1908. X1%19352%9%30%1799%355
  1909. X1%20823%9%20%1819%355
  1910. X1%22294%9%9%1839%385
  1911. X3%11598%9%29%1859%354
  1912. X3%13069%9%18%1879%354
  1913. X3%14540%9%5%1899%384
  1914. X5%3844%9%25%1919%354
  1915. X5%5315%9%14%1939%385
  1916. X6%20539%10%3%1959%355
  1917. X6%22010%9%22%1979%355
  1918. X6%23481%9%11%1999%385
  1919. X1%12785%9%30%2019%355
  1920. X1%14256%9%19%2039%355
  1921. X1%15727%9%8%2059%383
  1922. X3%5031%9%26%2079%354
  1923. X3%6502%9%15%2099%384
  1924. X4%21726%10%5%2119%354
  1925. X4%23197%9%24%2139%354
  1926. X4%24668%9%13%2159%385
  1927. X6%13972%10%2%2179%355
  1928. X6%15443%9%21%2199%355
  1929. X6%16914%9%11%2219%383
  1930. X1%6218%9%30%2239%353
  1931. X
  1932. X
  1933. X
  1934. SHAR_EOF
  1935. echo "File cal.text is complete" &&
  1936. rm -f shar3_seq_.tmp
  1937. echo "You have unpacked the last part"
  1938. exit 0
  1939.  
  1940.    -Richard L. Goerwitz              goer%sophist@uchicago.bitnet
  1941.    goer@sophist.uchicago.edu         rutgers!oddjob!gide!sophist!goer
  1942.