brewersfan1976

rectangle_rotation.rb

Sep 26th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.15 KB | None | 0 0
  1. def rectangleRotation(a, b)
  2.     c = 1.414
  3.     a = (a / c).to_i
  4.     b = (b / c).to_i
  5.     c = ~(a ^ b) & 1
  6.    
  7.     return 2 * a * b + a + b + c
  8. end
Advertisement
Add Comment
Please, Sign In to add comment