News for hackers. Stuff that matters.
Re:Coding - the new Latin by Bostwick on Monday November 28, 2011 @10:52AM (#3286327)
I would argue that dodgeball is better expressed as an iterative algorithm. Consider the following pseudocode:

  def dodgeball(players, balls)
    until players.all? { |p| p.is_hit? }
      throw(nearest_ball(balls), nearest_player(players))
    end
  end
Most people think like this. Dodgeball teaches while loops, not recursion.

There are no comments on this comment yet.