Guest User

Untitled

a guest
Jan 17th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. {CarPid, X, Y, moved} ->
  2. UpdatedCars = orddict:update(CarPid, fun ({Position, Direction, _, _}) -> {Position, Direction, X, Y} end, Cars),
  3. main_crossroad_loop({UpdatedCars}, GuiPid);
  4.  
  5. {CarPid, X, Y, getinfo} ->
  6. orddict:update(CarPid,
  7. fun
  8. ({_, _, A, B}) ->
  9. if
  10. A =:= X and B =:= Y -> CarPid ! {self(), stop};
  11. true -> CarPid ! {self(), ok}
  12. end
  13. end,
  14. Cars)
Advertisement
Add Comment
Please, Sign In to add comment