Compare commits
No commits in common. "17a2b867fe041c85dd5780fa3847a4bd3f479ff0" and "b719c946ef32f42fc8b865f82ca7289b8651f8e6" have entirely different histories.
17a2b867fe
...
b719c946ef
@ -553,6 +553,7 @@ read_w_gajus([32, $G], A) ->
|
|||||||
read_w_gajus([32, $P], A) ->
|
read_w_gajus([32, $P], A) ->
|
||||||
calc([], [{$P, A}]);
|
calc([], [{$P, A}]);
|
||||||
read_w_gajus(A, B) ->
|
read_w_gajus(A, B) ->
|
||||||
|
io:format("A: ~ts, B: ~p~n", [A, B]),
|
||||||
error.
|
error.
|
||||||
|
|
||||||
read_w_pucks([C | Rest], A) when $0 =< C andalso C =< $9 ->
|
read_w_pucks([C | Rest], A) when $0 =< C andalso C =< $9 ->
|
||||||
@ -598,23 +599,10 @@ read([32, $P], A, P) ->
|
|||||||
calc([], [{$P, A} | P]);
|
calc([], [{$P, A} | P]);
|
||||||
read([C, 32 | Rest], A, G) ->
|
read([C, 32 | Rest], A, G) ->
|
||||||
read(Rest, [], [{C, A} | G]);
|
read(Rest, [], [{C, A} | G]);
|
||||||
read([$, | Rest], A, []) ->
|
|
||||||
read_w_gajus(Rest, A);
|
|
||||||
read([$_ | Rest], A, []) ->
|
|
||||||
read_w_gajus(Rest, A);
|
|
||||||
read([$. | Rest], A, []) ->
|
|
||||||
case read_w_pucks(Rest, []) of
|
|
||||||
{ok, P} ->
|
|
||||||
G = list_to_integer(lists:reverse(A)) * one(gaju),
|
|
||||||
{ok, G + P};
|
|
||||||
Error ->
|
|
||||||
Error
|
|
||||||
end;
|
|
||||||
read([C | Rest], A, G) ->
|
read([C | Rest], A, G) ->
|
||||||
read(Rest, [], [{C, A} | G]);
|
read(Rest, [], [{C, A} | G]);
|
||||||
read([], A, []) ->
|
|
||||||
read_w_gajus([], A);
|
|
||||||
read(Rest, A, G) ->
|
read(Rest, A, G) ->
|
||||||
|
io:format("read(\"~ts\", ~tp, ~tp) -> died!~n", [Rest, A, G]),
|
||||||
error.
|
error.
|
||||||
|
|
||||||
|
|
||||||
@ -634,6 +622,7 @@ read([C, 32 | Rest], A, G, P) ->
|
|||||||
read([C | Rest], A, G, P) ->
|
read([C | Rest], A, G, P) ->
|
||||||
read(Rest, [], G, [{C, A} | P]);
|
read(Rest, [], G, [{C, A} | P]);
|
||||||
read(_, _, _, _) ->
|
read(_, _, _, _) ->
|
||||||
|
io:format("read/4 died!~n"),
|
||||||
error.
|
error.
|
||||||
|
|
||||||
calc(G, P) ->
|
calc(G, P) ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user