Dnes sme diskutovali na tému: Logika. Zdá sa, že python ju pekne zachováva:

Dnes sme diskutovali na tému: Logika. Zdá sa, že python ju pekne zachováva:

enter image description here

#notok1ever=[[7,0],[3,0],[8,0]] #for number+mask dimmension
#oneok1notp=[[7,0],[8,0],[0,0]]
#oneok1andp2=[[8,1],[0,1],[7,1]]
#oneok1andp3=[[8,1],[7,1],[0,0]]
#oneok1andp4=[[0,1],[8,1],[7,0]] #with 7 not
oneok2notp=[[6,0],[1,0],[4,0]] # if 2 at 3rd, then 4 at 2nd and 1 cant be at 3rd
oneok2andp=[[6,0],[4,1],[1,0]]
oneok1andp=[[6,0],[8,0],[2,1]] #6 is not the first okp+notp
twook1notp=[[2,0],[0,0],[6,0]] #2 is at the end, 8cant be 2nd
twook1andp=[[0,1],[2,0],[2,1]] #0 must be 1st, 2 is 3rd, 6 cant be
#-----------------------------
#logical mask or sum is then:
matrix_masks=[
    [[6,0],[1,0],[4,0]], 
    [[6,0],[4,1],[1,0]],
    [[6,0],[8,0],[2,1]], 
    [[2,0],[0,0],[6,0]], 
    [[0,1],[2,0],[2,1]]
]
for i in range(5):
    if matrix_masks[i][0][1]==1:
        print(matrix_masks[i][0][0])
for i in range(5):
    if matrix_masks[i][1][1]==1:
        print(matrix_masks[i][1][0])
for i in range(5):
    if matrix_masks[i][2][1]==1:
        print(matrix_masks[i][2][0])
        break

Author: AarNoma

The first Slovak cyborg 1 system

Comments “Dnes sme diskutovali na tému: Logika. Zdá sa, že python ju pekne zachováva:”