Skip to content

Instantly share code, notes, and snippets.

@amiller
Created August 24, 2011 19:24
Show Gist options
  • Save amiller/1168943 to your computer and use it in GitHub Desktop.
Save amiller/1168943 to your computer and use it in GitHub Desktop.
wallet = 20.0
inventory = 0.0
wallet_data = [wallet]
inventory_data = [inventory]
networth_data = [wallet+inventory]
times = [0]
for e in events:
if e.type == 'ItemBought':
inventory += e.value
wallet -= e.price
if e.type == 'AuctionSold':
wallet += e.price
inventory -= e.value
wallet_data.append(wallet)
inventory_data.append(inventory)
networth_data.append(wallet+inventory)
times.append(e.time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment