Advertisement
Guest User

Untitled

a guest
Nov 30th, 2015
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. At=Struct.new(:a, :al, :b) do
  2.   def +(other)
  3.     At.new(
  4.       self.a + other.a,
  5.       self.al + other.al,
  6.       self.b + other.b
  7.     )
  8.   end
  9. end
  10.  
  11. alph = At.new(4.0, 3.0, 1.0)
  12. blph = At.new(6.0, 3.0, 1.0)
  13.  
  14. clph = alph + blph
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement