The goal of this assignment is to understand inheritance in javascript.
- Look at the source files for shape.js, square.js, rectangle.js. The shape.js file will have all the functions that need to be implemented. Do not write code yet!
- Write your tests first. Implement tests for shape, square and rectangle.
- Once your tests are written, start implementing the functions in shape, square and rectangle.
- Square and rectangle should inherit from shape.
- The getRGB function should only be written once.
- Implement an equilateral triangle object. Have it inherit from shape as well.
- When you implement draw, try to figure out how to print the shape to the screen including color. You can change the color of a symbol like
*
and fill the entire shape with those symbols. For example
-------
|* * *|
|* * *|
|* * *|
-------
The * should be in the color of the shape!