File: ahnentafel.ll

package info (click to toggle)
lifelines 3.0.50-2
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 11,140 kB
  • ctags: 6,517
  • sloc: ansic: 57,468; xml: 8,014; sh: 4,255; makefile: 848; yacc: 601; perl: 170; sed: 16
file content (60 lines) | stat: -rw-r--r-- 2,041 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* 
 * @progname       ahnentafel.ll
 * @version        1
 * @author         Wetmore
 * @category       
 * @output         Text
 * @description    
 *
 * Generate an ahnentafel chart for the selected person.
 * 
 * ahnentafel -- Generate an ahnentafel chart */
/* Tom Wetmore        */
/* Version 1, 4/27/95 */

proc main ()
{
        getindimsg(indi, "Whose Ahnentafel do you want?")
        if (not(indi)) { return() }
        "Ahnentafel of " name(indi) "\n\n"
        print("Computing ahnentafel of ", name(indi), "\n",
                "  Dots show persons per generation\n\n")
        list(ilist)
        list(alist)
        list(glist)
        table(ktab)
        enqueue(ilist,indi)
        enqueue(alist,1)
        enqueue(glist,1)
        set(gen, 0)
        while(indi,dequeue(ilist)) {
                set(ahnen, dequeue(alist))
                set (newgen, dequeue(glist))
                if (ne(gen, newgen)) {
                        "Generation " upper(roman(newgen)) ".\n\n"
                        print("\n", roman(newgen), " ")
                        set(gen, newgen)
                }
                set(before, lookup(ktab, key(indi)))
                if (before) {
                        d(ahnen) ". Same as " d(before) ".\n"
                } else {
                        print(".")
                        insert(ktab, save(key(indi)), ahnen)
                        d(ahnen) ". " name(indi) "\n"
                        if (e, birth(indi)) { "    b. " long(e) "\n" }
                        if (e, death(indi)) { "    d. " long(e) "\n" }
                }
                "\n"
                if (par,father(indi)) {
                        enqueue(ilist, par)
                        enqueue(alist, mul(2,ahnen))
                        enqueue(glist, add(gen, 1))
                }
                if (par,mother(indi)) {
                        enqueue(ilist, par)
                        enqueue(alist, add(1,mul(2,ahnen)))
                        enqueue(glist, add(gen, 1))
                }
        }
}