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.

The res/ directory holds two JSON files that seed the game with items and customer names. Both are plain JSON — you can edit them in any text editor without touching any Python code. Changes take effect the next time you launch the game.

res/items.json

Defines the shop’s product catalogue. Each entry is a two-element array [name, price]. Stock is not stored in this file. Every item is initialised with a stock of 5 when the game starts — this value is hardcoded in main.py, not here.

Format

[
  ["Apple", 5],
  ["Bread", 10],
  ["Potion", 25]
]
FieldTypeDescription
item[0]stringThe item’s display name.
item[1]numberThe item’s base sale price (integer).

How it is loaded

main.py reads this file once at startup and appends an Item object to shop.inventory for every entry:
with open("res/items.json") as f:
    for item in json.load(f):
        shop.inventory.append(Item(item[0], item[1], 5))
  • item[0]Item.name
  • item[1]Item.price
  • 5Item.stock (initial stock, hardcoded)

res/customer_names.json

A flat array of strings used as the name pool for all customers. Each day, make_customers() samples names from this list to populate that day’s customer roster.

Format

[
  "Liam Johnson",
  "Emma Martinez",
  "Noah Smith",
  "Olivia Brown",
  "Ethan Davis",
  "..."
]
Names are sampled with random.choice() inside make_customers(). The function attempts to avoid repeating names within a single day’s roster.

Pool size and day limits

The pool currently contains 71 names. Customer count per day is day × 3, so:
DayCustomers neededFits in pool?
13
1030
2369✅ (barely)
2472⚠️ exceeds pool
Days beyond Day 23 require more customers than names in the default pool. If the uniqueness bug were fixed and the pool were exhausted, the uniqueness loop inside make_customers() would hang indefinitely because no fresh name could ever be found.
The uniqueness check in make_customers() reads:
while new_customer_name in customers:
However, customers is a list[Customer] — a list of objects, not strings. Comparing a name string against a list of Customer objects will never be True, so the guard does not actually prevent duplicate names. For long games with a small name pool, extend customer_names.json with additional entries to reduce accidental repetition, and see Customization for a proper code fix.

Build docs developers (and LLMs) love