updated contents from Atlas repo
This commit is contained in:
17
interfaces/drum.py
Normal file
17
interfaces/drum.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from random import shuffle
|
||||
|
||||
from tombola import Tombola
|
||||
|
||||
|
||||
class TumblingDrum(Tombola):
|
||||
|
||||
def __init__(self, iterable):
|
||||
self._balls = []
|
||||
self.load(iterable)
|
||||
|
||||
def load(self, iterable):
|
||||
self._balls.extend(iterable)
|
||||
shuffle(self._balls)
|
||||
|
||||
def pop(self):
|
||||
return self._balls.pop()
|
||||
Reference in New Issue
Block a user