Last active
July 8, 2018 08:29
-
-
Save KamilLelonek/b2775a8e28a14cf4bca6e2bfc9eb6598 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def compress(<<0x04::8, x_coordinate::256, y_coordinate::256>>) do | |
y_coordinate | |
|> rem(2) | |
|> compress(x_coordinate) | |
end | |
def compress(0, x_coordinate), do: <<0x02::8, x_coordinate::256>> | |
def compress(1, x_coordinate), do: <<0x03::8, x_coordinate::256>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment