In (a) the firm starts on demand curve D₀. Marginal revenue MR₀ meets marginal cost at S, fixing the output Q₀, and the demand curve gives the price P₀ at T. Since P₀ is above average cost, the firm earns a profit, and that profit attracts competitors. Every firm that enters takes some of its customers, so its perceived demand curve slides left to D₁ and marginal revenue to MR₁. The new output is Q₁ at U and the new price is P₁ at Y, where the demand curve just touches the average cost curve, so profit is zero and entry stops.
In (b) the firm starts out losing money: at Q₀ the price P₀ at X is below average cost. Firms leave the industry, and the customers they release shift this firm's demand curve right to D₁, until at Z the price P₁ again just equals average cost. Either way the long run ends with price equal to average cost, at a quantity below the lowest point of the average cost curve. The slider sets how far the starting demand curve sits from the long-run one.