Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def chessBoardCellColor(cell1, cell2)
- distance_1 = (cell2[0].ord - cell1[0].ord).abs
- distance_2 = (cell2[1].ord - cell1[1].ord).abs
- if distance_1 == distance_2 then
- return true
- else
- return false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment