Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
11
Task/Gray-code/Erlang/gray-code-2.erl
Normal file
11
Task/Gray-code/Erlang/gray-code-2.erl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
-module(testgray).
|
||||
|
||||
test_encode(N) ->
|
||||
G = gray:encode(N),
|
||||
D = gray:decode(G),
|
||||
io:fwrite("~2B : ~5.2.0B : ~5.2.0B : ~5.2.0B : ~2B~n", [N, N, G, D, D]).
|
||||
|
||||
test_encode(N, N) -> [];
|
||||
test_encode(I, N) when I < N -> test_encode(I), test_encode(I+1, N).
|
||||
|
||||
main(_) -> test_encode(0,32).
|
||||
Loading…
Add table
Add a link
Reference in a new issue