-module(calc).
-export([rpn/1]).
rpn(L) when is_list(L) ->
[Res] = lists:foldl(fun rpn/2, [], string:tokens(L, " ")),
Res.
to_num(N) ->
case string:to_float(N) of
{error, no_float} -> list_to_integer(N);
{F,_} -> F
end.
rpn("+", [A,B|S]) ->
[A + B|S];
rpn("-", [A,B|S]) ->
[A - B|S];
rpn("*", [A,B|S]) ->
[A * B|S];
rpn("/", [A,B|S]) ->
[A / B|S];
rpn(X, Stack) -> [to_num(X)|Stack].
TILEFLAG_VFLIP
-> TILEFLAG_FLIP_HORIZONTAL
TILEFLAG_HFLIP
-> TILEFLAG_FLIP_VERTICAL
H
and V
to create compiler errors where the original constants are used.
Whenever I was working with tileflags, the naming caused me to have no idea what I was doing. I mostly had to res...cur += i32::from_str(line).unwrap();
cur += line.parse()?;
(edited)BetterEndpoint : Endpoint
or some function in a class that got a this parameter? (edited)tune grenade_speed
from 1000 to just 100. They fly off, and through the wall, but explode where they should explode in-game.
https://user-images.githubusercontent.com/95713843/207716576-eeca55db-53fa-49...