In 1995, I made my first webpage and fell in love with the web. Since then, I've made my career creating fun, professional websites and web applications of all kinds. I work as a project leader, team member or sub contractor depending on your needs. I'd love to help you with your project.
Time to learn Ruby
What better time is there to learn ruby than on one’s vacation? I’m considering using it to develop a very exciting secret project involving web typography. Like many programmers, I’m going through the ruby koans Exercises to get used to using the language.
about_triangle_project.rb
Sofar, my favorite problems are the about_triangle_project.rb and about_triangle_project2.rb problems. Here’s my solution:
def triangle(a, b, c) # important for efficient triangle testing ar = [a,b,c].sort # test for impossible triangles from sorted array of sides raise TriangleError, "Impossible!" unless ar[0] > 0 and ar[0] + ar[1] > ar[2] # identify triangle type with some stringy magic case [a,b,c].uniq.size when 1 then :equilateral when 2 then :isosceles when 3 then :scalene end end
Isn’t unless a fun operator?
(more…)