Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/mukybaby/Simple-Shop-Sim/llms.txt

Use this file to discover all available pages before exploring further.

Bargaining is the central risk/reward mechanic of Simple Shop Sim. Every time a customer steps up to the counter you are offered the chance to push for a higher price — or play it safe and sell at face value. Getting the call right separates a thriving shop from one that slowly bleeds cash.

How bargaining works

After a customer is popped from the queue and their desired item is shown, the game prompts:
Emma Martinez wants to buy Apple for 5.
Would you like to bargin with them? (Y/n): 
  • Enter Y to attempt a bargain.
  • Enter n to skip bargaining — however, see the warning below about a source-code bug that affects this choice.
When you choose Y, the game generates a random float between 0 and 100 (chance = random.uniform(0, 100)). This is compared against the customer’s hidden bargain threshold (customer.bargin):
def bargin_with(self, chance: float) -> bool:
    return self.bargin <= chance
If customer.bargin <= chance, the bargain succeeds. Otherwise it fails.

Outcomes

OutcomeConditionPrice effectCustomer buys?
Successcustomer.bargin <= random(0, 100)Price increased by 90% (price += price * 0.9)No — customer was already removed from queue and leaves without purchasing
Failurecustomer.bargin > random(0, 100)Price decreased by 10% (price -= price * 0.1)Yes — customer buys automatically at the discounted price
Skip (n)Player enters nNo changeNo — see bug note below
Bug: success applies a 90% markup, not 10%. The in-code comment on the success branch reads # Apply a 10% markup to the price, but the actual code is customer.wants.price += customer.wants.price * 0.9 — which increases the price by 90%, not 10%. For example, a 10itembecomes10 item becomes 19 after a successful bargain. This is a known bug in the source. The failure path (price -= price * 0.1) is correct and applies a genuine 10% discount.
Bug: entering n does not complete the sale. The bargain prompt input is processed with a walrus-operator expression: bargin_choice := input().lower() == "y". Due to Python operator precedence, bargin_choice is assigned the boolean result of the comparison (True or False), never the string "n". The subsequent elif bargin_choice == "n" check compares a boolean to the string "n", which is always False — so that branch is unreachable. When you enter n, the code falls through to the else branch and prints “Invalid choice. Please try again.” — the customer is still removed from the queue and leaves without buying anything.

Bargain strategy

The customer’s bargain threshold is never shown to you, making every attempt a gamble. However, understanding the distribution helps:
  • The threshold is drawn from random.uniform(0, 100), so values are spread evenly across the full range.
  • A customer with a low threshold (e.g., 5) requires chance >= 5 to succeed — that is a 95% success rate; these customers are easy to bargain with.
  • A customer with a high threshold (e.g., 95) requires chance >= 95 to succeed — only a 5% chance; these are very hard to bargain with successfully.
  • Because the threshold is hidden, you cannot distinguish the two cases before committing.
On a successful bargain the price jumps by 90% (due to the bug described above), which dramatically inflates the item’s price for future customers — but note the customer who triggered the success does not buy. They were already removed from the queue when popped for serving, so they simply leave and the next customer will encounter the new higher price. On a failed bargain the price drops by 10% and the customer buys immediately, so you still close the sale, just at a slight discount.

When not to bargain

Due to the n input bug described above, the only safe choices at the bargain prompt are Y (attempt a bargain) or any input that you accept losing the sale on. Consider the trade-offs carefully:
  • Attempting a bargain always risks a failed outcome. Failure closes the sale at -10%, which is usually acceptable.
  • A successful bargain raises the item price by 90% and the current customer leaves without buying. This benefits future customers who want the same item — if they can afford the new price.
  • If the item price is already near a customer’s budget limit, a successful bargain (90% increase) will push the price beyond what most customers can afford, potentially killing multiple future sales.
Because of the walrus-operator bug, there is no in-game way to silently skip a bargain and guarantee the current customer buys at face value. Entering Y is the only input that actually triggers a defined code path (bargain attempt). Any other input, including n, falls through to “Invalid choice” and the customer leaves without purchasing.

Build docs developers (and LLMs) love