Improved assignments for 2020

This commit is contained in:
Michael
2020-01-31 17:03:40 +01:00
committed by Michael H. Gimle
parent bb8c4d8625
commit fca107c75b
18 changed files with 321 additions and 338 deletions

View File

@@ -10,6 +10,14 @@ void addChild(SceneNode* parent, SceneNode* child) {
parent->children.push_back(child);
}
int totalChildren(SceneNode* parent) {
int count = parent->children.size();
for (SceneNode* child : parent->children) {
count += totalChildren(child);
}
return count;
}
// Pretty prints the current values of a SceneNode instance to stdout
void printNode(SceneNode* node) {
printf(