Created
August 16, 2022 21:55
-
-
Save jquast/6d31acbfe08e22c7ca23bf9c3ae1823b to your computer and use it in GitHub Desktop.
how to drain the world's economy in less than one year
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# inspired by https://www.theverge.com/2020/5/18/21262316/doordash-pizza-profits-venture-capital-the-margins-ranjan-roy | |
import math | |
starting_cash = 16 | |
cost_to_order = 16 | |
doordash_pays = 24 | |
cost_of_pizza = 4 | |
cash = starting_cash | |
iteration = 1 | |
total_pizzas = 0 | |
while True: | |
# how many pizzas can we afford to order? | |
no_pizzas = int(math.floor(cash / cost_to_order)) | |
# outflow, order & make the pizza | |
cash -= (cost_to_order + cost_of_pizza) * no_pizzas | |
# inflow, doordash sends us $24 ! | |
cash += doordash_pays * no_pizzas | |
total_pizzas += no_pizzas | |
print('at iteration', iteration, 'you will have ordered', | |
total_pizzas, 'pizzas, with', cash, 'cash on hand') | |
iteration += 1 | |
if cash > 86_000_000_000_000: | |
print("You have drained the world's economy") | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment