Skip to content

Instantly share code, notes, and snippets.

@jquast
Created August 16, 2022 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jquast/6d31acbfe08e22c7ca23bf9c3ae1823b to your computer and use it in GitHub Desktop.
Save jquast/6d31acbfe08e22c7ca23bf9c3ae1823b to your computer and use it in GitHub Desktop.
how to drain the world's economy in less than one year
# 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