Fix It - Modify It

Introduction

There will be times you will be asked to fix or modify someone's code. In this project you are asked to fix and modify a demo program (link below.)

Project #1

Fix the bugs in the code used by this projects. Modify the code to replicate the output (link below).

After the program is working, substitute The UTF-8 strings (elbow, tee, pipe, blank) found HERE .

Project #2

Document the code by adding comments in the code. They should say what the code is doing. The code itself is the low level documentation.

Project #3

a. Modify the function "print_dash_tree()" to

b. Modify the program (or create a new one) to allow a user to select the modifications and display the results of the function "print_dash_tree()".

Project #4

Fix the code to support single characters and integers as the input list. (Only characters or integers. Not both at the same time.)

Fix the code to support an input list of strings. (words?)

Project #5

Randomly generate an input list. Set reasonable limits of length, type, etc.

Display a balanced tree of the random input list

Read the list from a file? Read a text file, find the unique words, and use them as the input list?

Project #6

Can you printed trees vertically instead of horizontally? (Limit the maximum width of a line (row) to 80 characters.) For example:

e +-------+-------+ b h +---+---+ +---+---+ a c f i +---+ +---+ +---+ d g j

Note:

  1. The minimum space between two "things" on a line (row) is 3 spaces
  2. this will require using a mono-space font
  3. based on the tree structure, the root node may not be in the center of a line (row).
  4. what about words (string length varies) as leaf nodes

Code Used by Projects

Code Results

Python Bisect Module