Weekly Programming Challenge #12
I’ve been a genealogy nut for years–perhaps back as far as nearly 20 years, when I discovered that I was descended from many of royal houses of medieval Europe. (Of course, at the time, I took that information at face value…I now know better, but it was still fun to contemplate!)
One of my favorite programming projects was taking a lineage-linked list of my ancestors and building an enormous pedigree chart, going back dozens of generations. I had to get creative in printing it out (chopping it up, printing it piecemeal on standard printer sheets, and then pasting it all back together), but the result was impressive.
This week, let’s give pedigree charts a go!
First, though, a recap of week #11…
Week #11 Recap
For the 11th weekly programming challenge, we explored the midpoint circle algorithm and drew some circles.
- Martin Moberg got normal mode working, as well as line styles, for two points! You can see his implementation here: https://github.com/indifferen7/casual-drawing.
- Lasse Ebert implemented normal mode this week, earning one point. His code is here: https://github.com/lasseebert/jamis_challenge/tree/master/011_circle.
- Jérôme De Cuyper also nailed normal mode and earned one point. You can play with his solution here: http://jdecuyper.github.io/jamis-buck/Midpoint-Circle-Algorithm.html, and the code itself is here: https://github.com/jdecuyper/jamisbuck-11.
- Marcus Edvinsson did normal mode, too, with a nice interactive interface. His Elm implementation can be seen here: https://github.com/MarEdv/wpc-week11.
My solution this week was minimal, as we’re moving houses and things are crazy. I went with a dead simple Ruby implementation, drawing the image via ChunkyPNG. That’s one point for me! You can see what I’ve got here: https://github.com/jamis/weekly-challenges/tree/master/011-draw-circles.
Awesome work, everyone!
Weekly Challenge #12
There are a lot of different ways to draw a pedigree chart. Just Google it, to see what I mean.
To give this challenge some structure, though, we’re going to focus on a traditional pedigree style, where the tree moves left to right, like this:
For normal mode, we’ll generate at least a four-generation pedigree chart. (The preceding image is five generations–feel free to go that route if you wish, but it isn’t necessary for normal mode). You may hard-code the data itself, using either your own pedigree, or inventing one. (The tree for the British Royal Family is always fun, too.)
For one point, then:
- Construct and render at least four generations of a pedigree of your choice, in the style given above.
- You do not need to include any information other than names. No dates, no places–let’s keep normal mode simple!
- The tree need not be produced as an image–you can render it however you like, so long as it is recognizable as a pedigree chart. HTML elements, SVG, PDF–whatever works.
For hard mode, you should be ready to stretch yourself a bit. Each of these will add one point to your score.
- Metadata. For at least the first three generations, display corresponding birth and death information (dates and places). This is traditionally displayed below the line containing the person’s name, but you may do whatever you like, so long as the information is legible.
- Additional generations. Present (legibly!) up to 7 generations in a single chart.
- Efficient display of aribitrarily many generations. Not every line in a tree is known, and some actually intersect with others. (Intentionally or not, sometimes our ancestors intermarried!) You can make most trees more managable by removing unknowns (blank entries), and by collapsing duplicate trees.
- Accept GEDCOM files. GEDCOM (Genealogical Data Communication) files are a standard way for encoding genealogical data. Make your program able to parse these files, and build a pedigree chart for a given individual. (Check out Famous Family Trees for some sample GEDCOM files to play with.)
- Other chart formats. In addition to the traditional pedigree format required by normal mode, see if you can generate additional chart formats, like sun charts, or fan charts, or bowtie charts, or hourglass trees. Earn one point for each additional chart format.
Feel free to shoot for “surprise me” mode, too! It doesn’t have to be any harder than normal mode, but it ought to implement the challenge (either normal mode or hard mode) in some surprising, clever, or otherwise delightful way. See what you can come up with!
This challenge will run until Saturday, October 22th, at 12:00pm MDT (18:00 UTC).
The deadline for this challenge has passed, but feel free to try your hand at it anyway! Go ahead and submit a link to your solution in the comments, anytime. If you’re following along, the next week’s challenge is “Poisson Disk Sampling with Bridson’s Algorithm”. See you there!