Butterfly
Write a class Butterfly
that extends the Critter
class, along with its movement behavior.
All unspecified aspects of Butterfly
use the default behavior.
A Butterfly
should be yellow in color.
Its toString
should alternate between being an x
character and a -
character each move.
A Butterfly
flies upward in the following pattern: N, W, N, E, repeat.
Solve this program in jGRASP using the CritterMain
simulator.
Test it in Practice-it.