Skip to content

Instantly share code, notes, and snippets.

@harleyholt
Forked from splee/gist:1133099
Created August 9, 2011 00:13
Show Gist options
  • Save harleyholt/1133110 to your computer and use it in GitHub Desktop.
Save harleyholt/1133110 to your computer and use it in GitHub Desktop.
The Soda Algorithm
import random
from imagination import count_soda, restock_soda
available_sodas = ['Sprite', 'Coke', 'Diet Coke', 'Dr. Pepper']
def take_soda(consumer):
soda = random.choice(available_sodas)
if count_soda(soda) < 2 and not consumer.is_dick():
restock_soda(soda)
else:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment