This code challenge is about OO design principles and was presented by Floyd May
- The solution should meet the requirements.
- The solution should be as DRY (don’t repeat yourself) as possible.
- Not looking for "clever" solutions, but for designs that you’d feel confident to put into production code.
- All soldiers of the imperial army must know their rank.
- A soldier can be ordered to fight to the death, and no one but a soldier can receive such an order.
- Some soldiers are archers; all archers are soldiers
- Archers must know the number of arrows in their possession.
- An archer may be ordered to shoot a distant foe, and no one but an archer can receive such an order.
- Some soldiers are horsemen; all horseman are soldiers.
- Horsemen must know the horse that has been assigned to them.
- A horseman may be ordered to trample the enemies in his path, and no one but a horseman can receive such an order.
- Some soldiers belong to the Flying Rain of Fire, whose members are both horsemen and archers in every respect.
- A member of the Flying Rain may be ordered to lead the charge, and no one but a member of the Flying Rain can receive such an order.