Skip to content

Instantly share code, notes, and snippets.

@splee
Created August 9, 2011 00:07
Show Gist options
  • Save splee/1133099 to your computer and use it in GitHub Desktop.
Save splee/1133099 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():
soda = random.choice(available_sodas)
if count_soda(soda) < 2:
restock_soda(soda)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment