-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy patha_puzzle_game.py
More file actions
33 lines (27 loc) · 757 Bytes
/
a_puzzle_game.py
File metadata and controls
33 lines (27 loc) · 757 Bytes
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
########check if a number is a prime number######
########return 1 if a number is prime number else 0#####
def prime(x):
for i in range(2, int(x/2)+1):
if(x % i == 0):
return(0)
return(1)
########swap two adjacent Puzzle boxes#######
######## A:Puzzle Matrix #######
######## C1:Coordinates of first box####
######## C2:Coordinates of second box###
def swapper(A, C1, C2):
x = A[C1[0]][C1[1]]
A[C1[0]][C1[1]] = A[C2[0]][C2[1]]
A[C2[0]][C2[1]] = x
return(A)
def indexChooser(A):
Steps=0
for i in range(3):
for j in range(3):
if
t = int(input())
for i in range(t):
input()
Puzzle = []
for j in range(3):
Puzzle.append(input().split(" "))