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.

Customers are the only source of revenue in Simple Shop Sim. Each day a fresh queue of shoppers arrives with their own budgets and specific items they want to buy. Your job is to open the shop, serve every customer in order, and close up before paying rent. How you handle each interaction — especially whether you bargain — directly affects your end-of-day cash.

Opening for the day

When the shop is closed, choose option 2 (“Open for the day”) to begin trading. This calls open_for_day() internally, which:
  1. Sets shop.open = True.
  2. Calls make_customers(day, shop, customer_names) to generate a full customer queue.
  3. Prints each customer’s name so you know who is coming.
The number of customers scales with the current day using the formula day × 3:
DayCustomers generated
13
26
39
412
After opening, the terminal confirms the shop is now open and lists today’s visitors:
Sunny's Emporium is now open for the day!

Emma Martinez
Liam Chen
Sofia Patel
These are the customers for the day.

The customer queue

Customers are served in first-in, first-out (FIFO) order. Each time you choose option 2 (“Serve a customer”) while the shop is open, the first customer in the queue is popped and presented to you:
Emma Martinez wants to buy Apple for 5.
Would you like to bargin with them? (Y/n):
You then decide whether to bargain or let the customer buy at the listed price. See the Bargaining guide for the full breakdown of that mechanic. Once a customer has been served (successfully or not), they leave the queue permanently. You cannot go back to a previous customer.

Customer attributes

Every customer is generated with four randomised properties:
  • Name — drawn at random from the customer_names.json pool. The game avoids duplicates within a single day’s queue.
  • Budget — a random integer between 17and17 and 286 (inclusive). Customers will not buy an item that costs more than their current budget.
  • Wants — a randomly chosen Item object from shop.inventory. Each customer targets exactly one item type.
  • Bargain threshold — a random float between 0 and 100. This hidden value determines how likely the customer is to accept a bargain. See Bargaining for details.

When a sale fails

The customer.buy() method checks four conditions before completing a purchase. All four must be true for the sale to go through:
  1. The item being sold matches what the customer wants (item == customer.wants).
  2. The item has stock remaining (item.stock > 0).
  3. The customer’s budget covers the current price (customer.budget >= item.price).
  4. The item is present in the shop’s inventory (item in shop.inventory).
If any condition fails, the game prints an error and the customer leaves empty-handed:
Error: Emma Martinez cannot buy Apple.
The customer is still removed from the queue, so you do not get a second attempt with them.
When the queue is empty while the shop is still open, the main menu displays “There are no more customers for the day.” at the top. Choose option 3 to close the shop, pay rent, and advance to the next day.

Build docs developers (and LLMs) love