@YuzhiEntity/

Behaulken

Python

No description

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.9758481577344509","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"cm93MSA9IGlucHV0KCJFbnRlciBmaXJzdCBmaXZlIGJpdCBsaXN0OiIpLnNwbGl0KCkKcm93MiA9IGlucHV0KCJFbnRlciBzZWNvbmQgZml2ZSBiaXQgbGlzdDoiKS5zcGxpdCgpCnJvdzMgPSBpbnB1dCgiRW50ZXIgdGhpcmQgZml2ZSBiaXQgbGlzdDoiKS5zcGxpdCgpCnJvdzQgPSBpbnB1dCgiRW50ZXIgZm91cnRoIGZpdmUgYml0IGxpc3Q6Iikuc3BsaXQoKQpyb3c1ID0gaW5wdXQoIkVudGVyIGZpZnRoIGZpdmUgYml0IGxpc3Q6Iikuc3BsaXQoKQpncmlkID0gW3JvdzEsIHJvdzIsIHJvdzMsIHJvdzQsIHJvdzVdCm5ld2NlbGwgPSBbXQpwcmludCgiXG5DdXJyZW50IGdyaWQ6IikKcHJpbnQoIiAiLmpvaW4ocm93MSkpCnByaW50KCIgIi5qb2luKHJvdzIpKQpwcmludCgiICIuam9pbihyb3czKSkKcHJpbnQoIiAiLmpvaW4ocm93NCkpCnByaW50KCIgIi5qb2luKHJvdzUpKQp3aGlsZSBUcnVlOgogIHggPSBpbnB1dCgiVHlwZSBzcGFjZSBmb2xsb3dlZCBieSBlbnRlciB0byBiZWhhdWxrLiBQcmVzcyBlbnRlciB0byBzdG9wLiIpCiAgaWYgeCA9PSAiIjoKICAgIGJyZWFrCiAgZWxzZToKICAgIGZvciByb3dudW0sIGV2ZXJ5IGluIGVudW1lcmF0ZShncmlkKToKICAgICAgZm9yIGNvbG51bSwgc2V0c3VuYSBpbiBlbnVtZXJhdGUoZXZlcnkpOgogICAgICAgIHNldHN1bmEgPSBpbnQoc2V0c3VuYSkKICAgICAgICBpZiByb3dudW0gPT0gMDoKICAgICAgICAgIGlmIGNvbG51bSA9PSAwOgogICAgICAgICAgICBpZiBzZXRzdW5hID09IDA6CiAgICAgICAgICAgICAgaWYgZ3JpZFsxXVswXSA9PSAxIGFuZCBncmlkWzFdWzFdID09IDEgYW5kIGdyaWRbMF1bMV0gPT0gMToKICAgICAgICAgICAgICAgIG5ld2NlbGwuYXBwZW5kKFswLCAwLCAxXSkKICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICBpZiBncmlkWzFdWzBdICsgZ3JpZFsxXVsxXSArIGdyaWRbMF1bMV0gaW4gWzIsIDNdOgogICAgICAgICAgICAgICAgcGFzcwogICAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICBuZXdjZWxsLmFwcGVuZChbMCwgMCwgMF0pCiAgICAgICAgICBlbGlmIGNvbG51bSA9PSA0OgogICAgICAgICAgICBpZiBzZXRzdW5hID09IDA6CiAgICAgICAgICAgICAgaWYgZ3JpZFswXVszXSA9PSAxIGFuZCBncmlkWzFdWzNdID09IDEgYW5kIGdyaWRbMV1bNF0gPT0gMToKICAgICAgICAgICAgICAgIG5ld2NlbGwuYXBwZW5kKFswLCA0LCAxXSkKICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICBpZiBncmlkWzBdWzNdICsgZ3JpZFsxXVszXSArIGdyaWRbMV1bNF0gaW4gWzIsIDNdOgogICAgICAgICAgICAgICAgcGFzcwogICAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICBuZXdjZWxsLmFwcGVuZChbMCwgNCwgMF0pCiAgICAgICAgICBlbHNlOgogICAgICAgICAgICBpZiBzZXRzdW5hID09IDA6CiAgICAgICAgICAgICAgaWYgZ3JpZFswXVtjb2xudW0tMV0gKyBncmlkWzBdW2NvbG51bSsxXSArIGdyaWRbMV1bY29sbnVtXSArIGdyaWRbMV1bY29sbnVtLTFdICsgZ3JpZFsxXVtjb2xudW0rMV0gPT0gMzoKICAgICAgICAgICAgICAgIG5ld2NlbGwuYXBwZW5kKFswLCBjb2xudW0sIDFdKQogICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgIGlmIGdyaWRbMF1bY29sbnVtLTFdICsgZ3JpZFswXVtjb2xudW0rMV0gKyBncmlkWzFdW2NvbG51bV0gKyBncmlkWzFdW2NvbG51bS0xXSArIGdyaWRbMV1bY29sbnVtKzFdIGluIFsyLCAzXToKICAgICAgICAgICAgICAgIHBhc3MKICAgICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgICAgbmV3Y2VsbC5hcHBlbmQoWzAsIGNvbG51bSwgMF0pCiAgICAgICAgZWxpZiByb3dudW0gPT0gNDoKICAgICAgICAgIGlmIGNvbG51bSA9PSAwOgogICAgICAgICAgICBpZiBzZXRzdW5hID09IDA6CiAgICAgICAgICAgICAgaWYgZ3JpZFszXVswXSA9PSAxIGFuZCBncmlkWzNdWzFdID09IDEgYW5kIGdyaWRbM11bMV0gPT0gMToKICAgICAgICAgICAgICAgIG5ld2NlbGwuYXBwZW5kKFszLCAwLCAxXSkKICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICBpZiBncmlkWzNdWzBdICsgZ3JpZFsxXVsxXSArIGdyaWRbMF1bMV0gaW4gWzIsIDNdOgogICAgICAgICAgICAgICAgcGFzcwogICAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICBuZXdjZWxsLmFwcGVuZChbMywgMCwgMF0pCiAgICAgICAgICBlbGlmIGNvbG51bSA9PSA0OgogICAgICAgICAgICBpZiBzZXRzdW5hID09IDA6CiAgICAgICAgICAgICAgaWYgZ3JpZFszXVs0XSA9PSAxIGFuZCBncmlkWzNdWzNdID09IDEgYW5kIGdyaWRbNF1bM10gPT0gMToKICAgICAgICAgICAgICAgIG5ld2NlbGwuYXBwZW5kKFs0LCA0LCAxXSkKICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICBpZiBncmlkWzNdWzRdICsgZ3JpZFszXVszXSArIGdyaWRbNF1bM10gaW4gWzIsIDNdOgogICAgICAgICAgICAgICAgcGFzcwogICAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICBuZXdjZWxsLmFwcGVuZChbNCwgNCwgMF0pCiAgICAgICAgICBlbHNlOgogICAgICAgICAgICBpZiBzZXRzdW5hID09IDA6CiAgICAgICAgICAgICAgaWYgZ3JpZFs0XVtjb2xudW0tMV0gKyBncmlkWzRdW2NvbG51bSsxXSArIGdyaWRbM11bY29sbnVtXSArIGdyaWRbM11bY29sbnVtLTFdICsgZ3JpZFszXVtjb2xudW0rMV0gPT0gMzoKICAgICAgICAgICAgICAgIG5ld2NlbGwuYXBwZW5kKFswLCBjb2xudW0sIDFdKQogICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgIGlmIGdyaWRbNF1bY29sbnVtLTFdICsgZ3JpZFs0XVtjb2xudW0rMV0gKyBncmlkWzNdW2NvbG51bV0gKyBncmlkWzNdW2NvbG51bS0xXSArIGdyaWRbM11bY29sbnVtKzFdIGluIFsyLCAzXToKICAgICAgICAgICAgICAgIHBhc3MKICAgICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgICAgbmV3Y2VsbC5hcHBlbmQoWzAsIGNvbG51bSwgMF0pCiAgICAgICAgZWxzZToKICAgICAgICAgIGlmIGNvbG51bSA9PSAwOgogICAgICAgICAgICBpZiBzZXRzdW5hID09IDA6CiAgICAgICAgICAgICAgaWYgZ3JpZFtyb3dudW0rMV1bMF0gKyBncmlkW3Jvd251bSsxXVsxXSArIGdyaWRbcm93bnVtXVsxXSArIGdyaWRbcm93bnVtLTFdWzBdICsgZ3JpZFtyb3dudW0tMV1bMV0gPT0gMzoKICAgICAgICAgICAgICAgIG5ld2NlbGwuYXBwZW5kKFtyb3dudW0sIDAsIDFdKQogICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgIGlmIGdyaWRbcm93bnVtKzFdWzBdICsgZ3JpZFtyb3dudW0rMV1bMV0gKyBncmlkW3Jvd251bV1bMV0gKyBncmlkW3Jvd251bS0xXVswXSArIGdyaWRbcm93bnVtLTFdWzFdIGluIFsyLCAzXToKICAgICAgICAgICAgICAgIHBhc3MKICAgICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgICAgbmV3Y2VsbC5hcHBlbmQoW3Jvd251bSwgMCwgMF0pCiAgICAgICAgICBlbGlmIGNvbG51bSA9PSA0OgogICAgICAgICAgICBpZiBzZXRzdW5hID09IDA6CiAgICAgICAgICAgICAgaWYgZ3JpZFtyb3dudW0rMV1bNF0gKyBncmlkW3Jvd251bSsxXVszXSArIGdyaWRbcm93bnVtXVszXSArIGdyaWRbcm93bnVtLTFdWzRdICsgZ3JpZFtyb3dudW0tMV1bM10gPT0gMzoKICAgICAgICAgICAgICAgIG5ld2NlbGwuYXBwZW5kKFtyb3dudW0sIDQsIDFdKQogICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgIGlmIGdyaWRbcm93bnVtKzFdWzRdICsgZ3JpZFtyb3dudW0rMV1bM10gKyBncmlkW3Jvd251bV1bM10gKyBncmlkW3Jvd251bS0xXVs0XSArIGdyaWRbcm93bnVtLTFdWzNdIGluIFsyLCAzXToKICAgICAgICAgICAgICAgIHBhc3MKICAgICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgICAgbmV3Y2VsbC5hcHBlbmQoW3Jvd251bSwgNCwgMF0pCiAgICAgICAgICBlbHNlOiAgCiAgICAgICAgICAgIGlmIHNldHN1bmEgPT0gMDoKICAgICAgICAgICAgICBpZiBncmlkW3Jvd251bS0xXVtjb2xudW0tMV0gKyBncmlkW3Jvd251bS0xXVtjb2xudW1dICsgZ3JpZFtyb3dudW0tMV1bY29sbnVtKzFdICsgZ3JpZFtyb3dudW1dW2NvbG51bS0xXSArIGdyaWRbcm93bnVtXVtjb2xudW0rMV0gKyBncmlkW3Jvd251bSsxXVtjb2xudW0tMV0gKyBncmlkW3Jvd251bSsxXVtjb2xudW1dICsgZ3JpZFtyb3dudW0rMV1bY29sbnVtKzFdID09IDM6CiAgICAgICAgICAgICAgICBuZXdjZWxsLmFwcGVuZChbcm93bnVtLCBjb2xudW0sIDFdKQogICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgIGlmIGdyaWRbcm93bnVtLTFdW2NvbG51bS0xXSArIGdyaWRbcm93bnVtLTFdW2NvbG51bV0gKyBncmlkW3Jvd251bS0xXVtjb2xudW0rMV0gKyBncmlkW3Jvd251bV1bY29sbnVtLTFdICsgZ3JpZFtyb3dudW1dW2NvbG51bSsxXSArIGdyaWRbcm93bnVtKzFdW2NvbG51bS0xXSArIGdyaWRbcm93bnVtKzFdW2NvbG51bV0gKyBncmlkW3Jvd251bSsxXVtjb2xudW0rMV0gaW4gWzIsIDNdOgogICAgICAgICAgICAgICAgcGFzcwogICAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICBuZXdjZWxsLmFwcGVuZChbcm93bnVtLCBjb2xudW0sIDFdKQogICAgZm9yIGFsIGluIG5ld2NlbGw6CiAgICAgIGdyaWRbYWxbMF1dW2FsWzFdXSA9IGFsWzJdCiAgICBwcmludChncmlkWzBdKQogICAgcHJpbnQoZ3JpZFsxXSkKICAgIHByaW50KGdyaWRbMl0pCiAgICBwcmludChncmlkWzNdKQogICAgcHJpbnQoZ3JpZFs0XSkKICAgICAgICAgICAgICAKICA="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
row1 = input("Enter first five bit list:").split()
row2 = input("Enter second five bit list:").split()
row3 = input("Enter third five bit list:").split()
row4 = input("Enter fourth five bit list:").split()
row5 = input("Enter fifth five bit list:").split()
grid = [row1, row2, row3, row4, row5]
newcell = []
print("\nCurrent grid:")
print(" ".join(row1))
print(" ".join(row2))
print(" ".join(row3))
print(" ".join(row4))
print(" ".join(row5))
while True:
  x = input("Type space followed by enter to behaulk. Press enter to stop.")
  if x == "":
    break
  else:
    for rownum, every in enumerate(grid):
      for colnum, setsuna in enumerate(every):
        setsuna = int(setsuna)
        if rownum == 0:
          if colnum == 0:
            if setsuna == 0:
              if grid[1][0] == 1 and grid[1][1] == 1 and grid[0][1] == 1:
                newcell.append([0, 0, 1])
            else:
              if grid[1][0] + grid[1][1] + grid[0][1] in [2, 3]:
                pass
              else:
                newcell.append([0, 0, 0])
          elif colnum == 4:
            if setsuna == 0:
              if grid[0][3] == 1 and grid[1][3] == 1 and grid[1][4] == 1:
                newcell.append([0, 4, 1])
            else:
              if grid[0][3] + grid[1][3] + grid[1][4] in [2, 3]:
                pass
              else:
                newcell.append([0, 4, 0])
          else:
            if setsuna == 0:
              if grid[0][colnum-1] + grid[0][colnum+1] + grid[1][colnum] + grid[1][colnum-1] + grid[1][colnum+1] == 3:
                newcell.append([0, colnum, 1])
            else:
              if grid[0][colnum-1] + grid[0][colnum+1] + grid[1][colnum] + grid[1][colnum-1] + grid[1][colnum+1] in [2, 3]:
                pass
              else:
                newcell.append([0, colnum, 0])
        elif rownum == 4:
          if colnum == 0:
            if setsuna == 0:
              if grid[3][0] == 1 and grid[3][1] == 1 and grid[3][1] == 1:
                newcell.append([3, 0, 1])
            else:
              if grid[3][0] + grid[1][1] + grid[0][1] in [2, 3]:
                pass
              else:
                newcell.append([3, 0, 0])
          elif colnum == 4:
            if setsuna == 0:
              if grid[3][4] == 1 and grid[3][3] == 1 and grid[4][3] == 1:
                newcell.append([4, 4, 1])
            else:
              if grid[3][4] + grid[3][3] + grid[4][3] in [2, 3]:
                pass
              else:
                newcell.append([4, 4, 0])
          else:
            if setsuna == 0:
              if grid[4][colnum-1] + grid[4][colnum+1] + grid[3][colnum] + grid[3][colnum-1] + grid[3][colnum+1] == 3:
                newcell.append([0, colnum, 1])
            else:
              if grid[4][colnum-1] + grid[4][colnum+1] + grid[3][colnum] + grid[3][colnum-1] + grid[3][colnum+1] in [2, 3]:
                pass
              else:
                newcell.append([0, colnum, 0])
        else:
          if colnum == 0:
            if setsuna == 0:
              if grid[rownum+1][0] + grid[rownum+1][1] + grid[rownum][1] + grid[rownum-1][0] + grid[rownum-1][1] == 3:
                newcell.append([rownum, 0, 1])
            else:
              if grid[rownum+1][0] + grid[rownum+1][1] + grid[rownum][1] + grid[rownum-1][0] + grid[rownum-1][1] in [2, 3]:
                pass
              else:
                newcell.append([rownum, 0, 0])
          elif colnum == 4:
            if setsuna == 0:
              if grid[rownum+1][4] + grid[rownum+1][3] + grid[rownum][3] + grid[rownum-1][4] + grid[rownum-1][3] == 3:
                newcell.append([rownum, 4, 1])
            else:
              if grid[rownum+1][4] + grid[rownum+1][3] + grid[rownum][3] + grid[rownum-1][4] + grid[rownum-1][3] in [2, 3]:
                pass
              else:
                newcell.append([rownum, 4, 0])
          else:  
            if setsuna == 0:
              if grid[rownum-1][colnum-1] + grid[rownum-1][colnum] + grid[rownum-1][colnum+1] + grid[rownum][colnum-1] + grid[rownum][colnum+1] + grid[rownum+1][colnum-1] + grid[rownum+1][colnum] + grid[rownum+1][colnum+1] == 3:
                newcell.append([rownum, colnum, 1])
            else:
              if grid[rownum-1][colnum-1] + grid[rownum-1][colnum] + grid[rownum-1][colnum+1] + grid[rownum][colnum-1] + grid[rownum][colnum+1] + grid[rownum+1][colnum-1] + grid[rownum+1][colnum] + grid[rownum+1][colnum+1] in [2, 3]:
                pass
              else:
                newcell.append([rownum, colnum, 1])
    for al in newcell:
      grid[al[0]][al[1]] = al[2]
    print(grid[0])
    print(grid[1])
    print(grid[2])
    print(grid[3])
    print(grid[4])