Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- true ->
- if OurPrice == undefined ->
- do_bid(S#state.other, Item, Price),
- notice(S, "bidding $~p on ~p", [Price, Item]),
- {next_state, negotiate, S#state{ourprice=Price}};
- OurPrice - 0.1 * FirstPrice >= Price ->
- do_bid(S#state.other, Item, Price),
- notice(S, "bidding $~p on ~p", [Price, Item]),
- {next_state, negotiate, S#state{ourprice=Price}};
- true ->
- io:format("~p: Cannot set price ~p than previous one: ~p \n",[Name,Price,OurPrice]),
- {next_state, negotiate, S}
- end
- end;
- true ->
- io:format("~p: Cannot bid. Item ~p is not connected with any offer.~n", [S#state.name, Item]),
- {next_state, negotiate, S#state{}}
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement