Hamilton Temple's wish and the chess queen puzzle