brewersfan1976

chess_board_cell_color.rb

May 23rd, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.25 KB | None | 0 0
  1. def chessBoardCellColor(cell1, cell2)
  2.     distance_1 = (cell2[0].ord - cell1[0].ord).abs
  3.     distance_2 = (cell2[1].ord - cell1[1].ord).abs
  4.    
  5.     if distance_1 == distance_2 then
  6.        return true
  7.     else
  8.        return false
  9.     end
  10. end
Advertisement
Add Comment
Please, Sign In to add comment