self.v.display(" %8.8s " % (output))
self.last = output
+ def affinity(self):
+ return 3
+
class FortuneIdler(StringIdler):
def __init__(self, v):
fortune = "/usr/games/fortune"
StringIdler.__init__(self, v, text,repeat=False)
def affinity(self):
- return 15
+ return 20
StringIdler(v, text=CREDITS),
StringIdler(v, text=str(math.pi) + " "),
StringIdler(v, text=str(math.e) + " "),
- StringIdler(v),
FortuneIdler(v),
ClockIdler(v),
+ StringIdler(v),
GrayIdler(v),
TrainIdler(v),
GrayIdler(v,one="*",zero="-"),
GrayIdler(v,one="/",zero="\\",reorder=1),
GrayIdler(v,one="X",zero="O",reorder=1),
]
+ disabled = [
+ ]
idler = choose_idler()
def choose_idler():
global idler
- idler = idlers[int(random()*len(idlers))]
+ iiindex = 0
+
+ if idler:
+ iiindex = idlers.index(idler)
+
+ iilen = len(idlers)
+
+ move = int(random()*len(idlers)) + 1
+
+ while move >= 0:
+ idler = idlers[( (iiindex + 1) % iilen)]
+ move = move - idler.affinity()
+
idler.reset()
def idle_step():