import rebelsky.fun.balloons.Balloon; import rebelsky.fun.balloons.Strategist; import rebelsky.fun.balloons.Wind; /** * A completely random strategy for winning balloon races. * Inflate the balloon with a 10% probability. Deflate the balloon * with a 10% probability. Drop a sandbag with a 3% probability. */ public class CoinFlipper extends Strategist { /** * Decide what to do based on knowledge of the balloon status. * Ignore the wind. */ public void decide(Balloon b, int maxheight, Wind w) { if (Math.random() < 0.10) { b.inflate(); } if (Math.random() < 0.10) { b.deflate(); } if (Math.random() < 0.02) { b.drop(); } } // decide() } // CoinFlipper