CMSC 162 -- Lab 3

Lab 3

Getting Started

Log onto a computer science server making sure to change the port number.

Follow these instructions to get your files ready to start lab.
  • Use wget to download the file at http://cs.longwood.edu/courses/cmsc162/f18/files/lab3.tgz
  • Uncompress the lab3.tgz file by using tar -xvzf lab3.tgz
  • Use ls to see that there is a new directory called lab3
  • Use cd lab3 to change directory to the lab3 directory

The Problem

Recursive calls are often displayed as a branching tree. We will take this form to heart and draw trees (in svg) using recursion.
  1. using recursion
  2. write a README
  3. practice using structs

Implementation

You have been given a file named plant.cpp which contains almost all of the code you will need.

  • You must complete the recursive drawPlant function.
  • Your function must return the number of branches it has drawn.
  • The lines of your tree should change width with "height" of the tree. (example)
  • Your branches should be at random angles but should still produce a tree. (example)
  • You will need to add an additional feature.(colors, leaves, something else!)

You can use make copy to copy your plant.svg to public_html.

Handin

When you are done you need to hand in your lab. The easiest way is to type make handin.

If you have changed file names or directory names you will need to change to the directory which contains the directory you wish to hand in. We will use the handin cmsc162 assignment directory command. In this case you will type: handin cmsc162 lab3 lab3

You lab is due at 11:59pm Sept. 11th 2018.