From: sureshvv@... (suresh vv) Date: 2001-12-11T19:42:50+09:00 Subject: [ruby-talk:28198] Re: John Roth dolt ( Re: A challenge to proponents of Unit Testing. ) Robert C. Martin wrote in message news:... > >> >Set sides; // data structure allows no duplicates. > >> >sides.add(a); > >> >sides.add(b); > >> >sides.add(c); > >> >return sides.length(); // 1 = equilateral, 2=isoceles, 3=scalene. > ^^^^^^^^^--oops. > >> > > >> >What am I missing? > > > > The intent was to return a 1 for equilateral, 2 for isoceles, and 3 > for scalene. Representing the triangle was not part of the job. > Sounds like a cop out. You forgot/ignored the "triangle" part of the problem and just dealt with 3 numbers, returning the number of unique numbers. There is a lesson in there somwhere for what happens when you get away from the "real world". suresh