Eagle

Category: Critters
Author: Stuart Reges
Book Chapter: 9.2
Problem: Eagle
  Write a class called Eagle that extends the Critter
   class.  The instances of the Eagle class switch back and forth between red
   and blue in an increasing pattern.  They should be red for their first move
   and then blue for one move.  Then they should be red for two moves and then
   blue for two moves.  Then they should be red for three moves and then blue
   for three moves.  Then they should be red for four moves and then blue for
   four moves.  And so on, each time increasing the number of moves at a
   particular color by one.  They should be displayed using a less-than
   character followed by a greater-than character (<>).  They should always hop
   whenever possible.  If they can't hop, they should turn right if there is a
   wall in front of them and otherwise they should infect.