Creature: Ladybug
Project Specifications:
Ladybug extends class Critter. It changes to the color of another critter (and only critters) that it approaches. When encountering a flower, it will change all of the flower colors to the ladybug's current color - if ladybug changes to a critter's green color, the flowers it touches thereafter will be green. When ladybug approaches a rock or the edge of the grid, it will turn 180 degrees around and go straight back.
Defaults:
- Starts at (5,5) on grid
- Color is RED
Test Cases:
Test Case 1 - Operates like Critter
Test to see if it will run and move like a critter
Test Case 2 - Changing color to neighboring critter
It should change to its color once approaching it and remain its color until encountering another critter
Test Case 3 - Changing flower colors to current color
Ladybug should change all flowers that it encounters to the current color of the ladybug. Therefore, if ladybug previously encounters a blue critter and changes to blue, all of the flowers thereafter will be blue.
Test Case 4 - Turning 180 degrees around
Once ladybug hits the edge of grid or a rock, it will turn 180 degrees around and head straight back.