Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I don't think there would ever be an issue, no matter how crazy inbred the family is.
Every kid is born of two parents, and every parent has zero or more kids. How those relate doesn't really matter -- although you might get duplication of parts of the tree (the same grandparent showing up on both sides of the tree).
Also, I'm pretty sure this would occur for everyone pretty quickly. The Most Recent Common Ancestor for most countries/continents lived only a few hundred years ago....
https://youtube.com/watch/... -
@bittersweet
Oedipus would incur in infinite recursion with this method and unincestuous families wouldn't.
DrawChildren(Person * p)
{
for( child : p->children )
{
child->draw();
for( spouse : child->spouses )
DrawChildren(spouse);
}
} -
@OneOfSimpleMind I agree, this would make for a funky tree, especially if your function has no exit condition, like tree rendering depth.
Solution could be a lookup function, check people by a unique ID, drawing lines to people already on the canvas and breaking out of the loop there. -
Assuming that every child is born later than their parents there will never be a circular reference.
-
@OneOfSimpleMind Utilizing spouse data for drawing a family tree invalidates unlawful children, whereas adultery is quite common.
Related Rants
oh no.
joke/meme
software
recursion