From 12028cee222e6ad717654cdc879daf7c5d1db0b2 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Tue, 9 Dec 2025 17:03:47 +0900 Subject: [PATCH] fixup! WIP: docs/economy --- docs/economics.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/economics.md b/docs/economics.md index f6f73bc..9c8792c 100644 --- a/docs/economics.md +++ b/docs/economics.md @@ -18,7 +18,7 @@ This section covers what happens to the stock count and price of a product when When the product count is `0`, adding more of that product sets the product count to the amount added, and the product price will be set to the price of all products added divided by the number of products added, rounded up to the nearest integer. ```python -new_product_count += products_added +new_product_count = products_added new_product_price = math.ceil(total_value_of_products_added / products_added) ``` @@ -174,11 +174,15 @@ TODO ## Who owns a product -When adding a product +When throwing away products, it can be useful to know who added the products in the first place. Dibbler will look back at its event log to determine who added the products that are being thrown away, and pull the money from their balance in order for the economy to stay sane. -When buying a product +The algorithm is based on FIFO (first in, first out), meaning that the products that were added first are the ones that will be considered thrown away first. This might not always be accurate in real life (someone could buy a newer product and add it to the shelf before an older product is added and then considered newer by the system), but it is an overall reasonable approximation. -When adjusting the product count +### When adding a product + +### When buying a product + +### When adjusting the product count ## Other actions