MAINT: Apply pre-commit

Remove byte-order-marker pre-commit check as there would be
many adjustments necessary
This commit is contained in:
Martin Thoma
2022-03-05 09:29:23 +01:00
parent f5e33ae38f
commit e64fb6795c
536 changed files with 6267 additions and 5556 deletions

View File

@@ -2,7 +2,7 @@ import random
def print_n_whitespaces(n: int):
print(" "*n, end="")
print(" " * n, end="")
def print_board():
@@ -79,21 +79,21 @@ while True:
elif check_move(I, J, N) == False:
print("ILLEGAL MOVE. TRY AGAIN...")
else:
if A[I-1][J-1] != 0:
if A[I - 1][J - 1] != 0:
print("SQUARE OCCUPIED. TRY AGAIN...")
else:
A[I-1][J-1] = 1
A[I - 1][J - 1] = 1
# COMPUTER TRIES AN INTELLIGENT MOVE
SkipEFLoop = False
for E in range(-1, 2):
for F in range(-1, 2):
if E+F-E*F == 0 or SkipEFLoop:
if E + F - E * F == 0 or SkipEFLoop:
continue
X = I + F
Y = J + F
if check_move(X, Y, N) == False:
continue
if A[X-1][Y-1] == 1:
if A[X - 1][Y - 1] == 1:
SkipEFLoop = True
X = I - E
Y = J - F
@@ -101,21 +101,21 @@ while True:
while True: # 610
X = random.randint(1, N)
Y = random.randint(1, N)
if check_move(X, Y, N) and A[X-1][Y-1] == 0:
A[X-1][Y-1] = 2
if check_move(X, Y, N) and A[X - 1][Y - 1] == 0:
A[X - 1][Y - 1] = 2
print_board()
break
else:
if A[X-1][Y-1] != 0:
if A[X - 1][Y - 1] != 0:
while True:
X = random.randint(1, N)
Y = random.randint(1, N)
if check_move(X, Y, N) and A[X-1][Y-1] == 0:
A[X-1][Y-1] = 2
if check_move(X, Y, N) and A[X - 1][Y - 1] == 0:
A[X - 1][Y - 1] = 2
print_board()
break
else:
A[X-1][Y-1] = 2
A[X - 1][Y - 1] = 2
print_board()
print()
print("THANKS FOR THE GAME!!")