Z-Curve Encoding in Erlang