Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {CarPid, X, Y, moved} ->
- UpdatedCars = orddict:update(CarPid, fun ({Position, Direction, _, _}) -> {Position, Direction, X, Y} end, Cars),
- main_crossroad_loop({UpdatedCars}, GuiPid);
- {CarPid, X, Y, getinfo} ->
- orddict:update(CarPid,
- fun
- ({_, _, A, B}) ->
- if
- A =:= X and B =:= Y -> CarPid ! {self(), stop};
- true -> CarPid ! {self(), ok}
- end
- end,
- Cars)
Advertisement
Add Comment
Please, Sign In to add comment