Advertisement
Guest User

Untitled

a guest
Dec 16th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Erlang 0.40 KB | None | 0 0
  1. negotiate({make_bid, Item, Price}, S=#state{}) ->
  2.   if
  3.     (S#state.tradeditem == Item) ->
  4.       do_bid(S#state.other, Item, Price),
  5.       notice(S, "bidding $~p on ~p", [Price, Item]),
  6.       {next_state, negotiate, S#state{ourprice=Price}};
  7.     true ->
  8.       io:format("~p: Cannot bid. Item ~p is not connected with any offer.~n", [S#state.name, Item]),
  9.       {next_state, negotiate, S#state{}}
  10.   end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement