def nextgen(machineName: str, nbGen: (int, 1), **kwargs) -> "next <MACHINE_NAME> [INT]": """Execute the Cythan Code of the machine.""" try: InstanceManager.advance(machineName, nbGen) except Errors.BreakPointMet as err: raise Errors.BreakPointMet(err) except KeyError: return AssertionError("No Cythan Machine have name: '" + str(machineName) + "'") return "Execution done."
def execute(self,nb): print(nb) for x in range(nb): self.machine.turn(1) for x in self.breakpoints: if len(x) == 3 and self.machine.data[x[1]][x[2]] == x[0]: self.breakpoints.remove(x);raise Errors.BreakPointMet("At position "+str(x[1])+":"+str(x[2])+" for value "+str(x[0])) if len(x) == 2 and self.machine.negdata[-x[1]] == x[0]: self.breakpoints.remove(x);raise Errors.BreakPointMet("At position "+str(x[1]))