-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoriginal code.py
39 lines (33 loc) · 1.34 KB
/
original code.py
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
import numpy
N = input(int(("Please pick an integer N to make a N columns for Board:\n")))
M = input(int(("Please pick an integer M to make M rows for Board:\n")))
print("The Chess Board You Have Selected Is A", N,"x",M, "Board!")
class NAdjustedKing:
"the board size and number of solutions"
#Dont know how to get board to work
def initialBoard(row, column):
row = M
col = N
size =
self.size = size
self.solutions = 0
self.solve()
"solve the problem and print num solutions"
def solve(self):
positions = [-1] * self.size
self.place_king(positions, 0)
print("Found", self.solutions, "solutions!")
"Place the king on a row and check N cases. If a valid solutuon
#Cant get the king to work
def put_king(self, positions, target_row, taget_col):
for target_row in range(1:M):
if target_row = M:
for target_col in range(1:N):
if target_col = N:
self.show_full_board(positions)
self.solutuions += 1
else:
for target_col in range(1:N):
if col = N:
return;
else: