@kufiyf

Почему список не заполняется?

Почему список М не заполняется, хотя все проверки работают?
from tkinter import*
from time import*
from math import*
b = 0
e = 0
x = 0
z = 0
y = 0
cube = 0
skan = 0
m = []
codes = []
camera_pos = [0,0,0]
poses = []
scales = []
tk = Tk()
canvas = Canvas(tk, width = 700, height=600)
canvas.pack()
def create_cube(posit,scale):
    global cube
    global x
    global z
    global y
    codes.append(posit[0]+scale[0]/2)
    codes.append(posit[1]+scale[1]/2)
    codes.append(posit[2]+scale[2]/2)
    
    codes.append(posit[0]-scale[0]/2)
    codes.append(posit[1]-scale[1]/2)
    codes.append(posit[2]-scale[2]/2)
    x = floor(((codes[0]-codes[3])//5)*((codes[1]-codes[4])//5))
    z = floor(((codes[0]-codes[3])//5)*((codes[2]-codes[5])//5))
    y = floor(((codes[1]-codes[4])//5)*((codes[2]-codes[5])//5))
    cube += 1
    
    print(codes)
def render():
    global cube
    global skan
    global codes
    global b
    global x
    global z
    global y
    if(cube >= 1):
        if(skan == 0):
            for i in range(x):
                m.append(floor(sqrt(2**(codes[0] - camera_pos[0] - b)+2**(codes[1] - camera_pos[1] - e)+2**(codes[2] - camera_pos[2]))))
                b += 5
                if(codes[0] <= b):
                    b = 0
                    e += 5
                sleep(0.1)
            b = 0
            e = 0
            skan += 1
        elif(skan == 1):
            for i in range(x):
                m.append(floor(sqrt(2**(codes[0] - camera_pos[0] - b)+2**(codes[1] - camera_pos[1] - e)+2**(codes[5] - camera_pos[2]))))
                b += 5
                if(codes[0] <= b):
                    b = 0
                    e += 5
                sleep(0.1)
            b = 0
            e = 0
            skan += 1
        elif(skan == 2):
            for i in range(z):
                m.append(floor(sqrt(2**(codes[0] - camera_pos[0] - b)+2**(codes[1] - camera_pos[1])+2**(codes[2] - camera_pos[2] - e))))
                b += 5
                if(codes[0] <= b):
                    b = 0
                    e += 5
                sleep(0.1)
            b = 0
            e = 0
            skan += 1
        elif(skan == 3):
            for i in range(z):
                m.append(floor(sqrt(2**(codes[0] - camera_pos[0] - b)+2**(codes[4] - camera_pos[1])+2**(codes[2] - camera_pos[2] - e))))
                b += 5
                if(codes[0] <= b):
                    b = 0
                    e += 5
                sleep(0.1)
            b = 0
            e = 0
            skan += 1
        elif(skan == 4):
            for i in range(y):
                m.append(floor(sqrt(2**(codes[0] - camera_pos[0])+2**(codes[1] - camera_pos[1] - b)+2**(codes[2] - camera_pos[2] - e))))
                b += 5
                if(codes[0] <= b):
                    b = 0
                    e += 5
                sleep(0.1)
            b = 0
            e = 0
            skan += 1
        elif(skan == 5):
            for i in range(y):
                m.append(floor(sqrt(2**(codes[3] - camera_pos[0])+2**(codes[1] - camera_pos[1] - b)+2**(codes[2] - camera_pos[2] - e))))
                b += 5
                if(codes[0] <= b):
                    b = 0
                    e += 5
                sleep(0.1)
            b = 0
            e = 0
            skan += 1
    print(m)
#делай проверку с b и e
        #sqrt(2**()+2**()+2**())
create_cube([1,1,1],[1,1,1])
render()
  • Вопрос задан
  • 89 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы