Made super dumb mistake in rock-paper-scissors logic on the edge case and almost convinced myself that there was an error in the input since my answer was not going through T_T, anyway here’s my solution:
main(File) ->
{ok, RawData} = file:read_file(File),
Data = [ begin
[A, B] = binary:split(N, <<" ">>, [global, trim]),
{b2a(A), b2a(B), b2s(B)}
end || N <- binary:split(RawData, <<"\n">>, [global, trim]) ],
io:format("part 1: ~p~n", [solve1(Data)]),
io:format("part 2: ~p~n", [solve2(Data)]).
solve1(Data) ->
lists:sum([ rock_paper_scissors(A, B) || {A, B, _} <- Data ]).
solve2(Data) ->
lists:sum([ rock_paper_scissors(A, strategy(A, C)) || {A, _, C} <- Data ]).
b2a(<<"A">>) -> 1;
b2a(<<"B">>) -> 2;
b2a(<<"C">>) -> 3;
b2a(<<"X">>) -> 1;
b2a(<<"Y">>) -> 2;
b2a(<<"Z">>) -> 3.
rock_paper_scissors(A, B) when A =:= B -> 3 + B;
rock_paper_scissors(A, B) when A =:= 3, B =:= 1; B - A =:= 1 -> 6 + B;
rock_paper_scissors(_, B) -> 0 + B.
b2s(<<"X">>) -> lose;
b2s(<<"Y">>) -> draw;
b2s(<<"Z">>) -> win.
strategy(A, lose) -> lists:nth(A, [3, 1, 2]);
strategy(A, draw) -> A;
strategy(A, win) -> lists:nth(A, [2, 3, 1]).