Advertisement
Guest User

Untitled

a guest
Jan 13th, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Erlang 0.76 KB | None | 0 0
  1. true ->
  2.         if OurPrice == undefined ->
  3.             do_bid(S#state.other, Item, Price),
  4.             notice(S, "bidding $~p on ~p", [Price, Item]),
  5.             {next_state, negotiate, S#state{ourprice=Price}};
  6.         OurPrice - 0.1 * FirstPrice >= Price ->
  7.             do_bid(S#state.other, Item, Price),
  8.             notice(S, "bidding $~p on ~p", [Price, Item]),
  9.             {next_state, negotiate, S#state{ourprice=Price}};
  10.         true ->
  11.             io:format("~p: Cannot set price ~p than previous one: ~p \n",[Name,Price,OurPrice]),
  12.             {next_state, negotiate, S}
  13.         end
  14.       end;
  15.     true ->
  16.       io:format("~p: Cannot bid. Item ~p is not connected with any offer.~n", [S#state.name, Item]),
  17.       {next_state, negotiate, S#state{}}
  18.   end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement