Created
August 9, 2011 00:07
-
-
Save splee/1133099 to your computer and use it in GitHub Desktop.
The Soda Algorithm
This file contains hidden or 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
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