Friday, 19 June 2020

Chapter 14 // Exercise 13 - Principles & Practice Using C++

In this exercise I am using Visual Studio 2017 and the graphics files found here:
https://github.com/l-paz91/principles-practice/tree/master/Graphics%20Files

Chapter 14 // Exercise 13

Modify Binary_tree to take a parameter (or parameters) to indicate what kind of line to use to connect the nodes (e.g., an arrow pointing down or a red arrow pointing up). Note how this exercise and the last use two alternative ways of making a class hierarchy more flexible and useful.

Github: https://github.com/l-paz91/principles-practice/tree/master/Chapter%2014/Exercise%2013


Like in the last exercise, I already have the information for the lines vector. So I added a function that allows you to change the line to arrow with a direction and colour. I also added the ability to change the size of the tree.

Chapter 14 // Exercise 13 - Principles & Practice Using C++

This class is starting to get a bit hacky/hardcoded.

No comments:

Post a Comment