def timing(self, dumy): if self.timing_started: #已经在计时,结束计时 self.timing_stop = time.time() self.timing_started = False Panel.printHint("计时结束! 总共用时:%d秒" % (int(self.timing_stop - self.timing_start))) else: #没有在计时,开始计时 self.timing_start = time.time() self.timing_started = True Panel.printHint("计时开始......")
def hint(self, show): advice = self.hint2() t1 = advice.get("t1", None) t2 = advice.get("t2", None) for my_b in self.my_playground.blocks(): if t1 != None: if (my_b.block.current.x == int(t1[0]) and my_b.block.current.y == int(t1[1]) and my_b.block.current.z == int(t1[2])): my_b.mark = "1" if t2 != None: if (my_b.block.current.x == int(t2[0]) and my_b.block.current.y == int(t2[1]) and my_b.block.current.z == int(t2[2])): my_b.mark = "2" if t1 != None: self.my_playground.displayContent() hint = advice.get("h", "No Advise") Panel.printHint(hint)
def displayAll(self): self.my_playground.displayContent() #self.my_tutorial.displayContent() self.my_library.displayContent() Panel.printLeft(u"当前解题方法是" + self.resolve_method + u"法") Panel.printHint(u"下一步提示")