Created
August 17, 2022 12:53
-
-
Save modos/97356797a38d1ed80001a59d16c5eb79 to your computer and use it in GitHub Desktop.
رنگآمیزی مکعب - پایتون
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def coloring(h): | |
h = list(h) | |
counter = 0 | |
for k in h: | |
counter2 = 0 | |
if counter == 0 or counter == (len(h) - 1): | |
for k2 in k: | |
for k3 in range(len(k2)): | |
k2[k3] = 1 | |
else: | |
for k2 in k: | |
for k3 in range(len(k2)): | |
if counter2 == 0 or counter2 == (len(k) - 1): | |
k2[k3] = 1 | |
else: | |
if k3 == 0 or k3 == (len(k2) - 1): | |
k2[k3] = 1 | |
else: | |
k2[k3] = 0 | |
counter2 += 1 | |
counter += 1 | |
return (h) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment