Код: Выделить всё
def doorcheck(self):
global time_digit, fredpos
current_time = millis()
current_timestring = str(current_time)
if time_digit == 5 or time_digit == 0:
print("yis")
if fredpos==4:
fredpos=0
frDoorCheck=1
self.x = self.posX[self.i]
self.y = self.posY[self.i]
print(time_digit)
if current_time > 0 and current_time < 1000:
time_digit = current_timestring[0]
if current_time > 999 and current_time < 10000:
time_digit = current_timestring[1]
if current_time > 9999 and current_time < 100000:
time_digit = current_timestring[2]
if current_time > 99999 and current_time < 1000000:
time_digit = current_timestring[3]
if time_digit == 5 or time_digit == 0:
print("yis")
if fredpos==4:
fredpos=0
frDoorCheck=1
self.x = self.posX[self.i]
self.y = self.posY[self.i]
Я хочу, чтобы утверждение if вверху и внизу считалось истинным, и хотя оно несколько раз оказывается истинным, оно отказывается показывать себя как истинное
Подробнее здесь: https://stackoverflow.com/questions/790 ... being-true