-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.py
More file actions
76 lines (72 loc) · 1.43 KB
/
data.py
File metadata and controls
76 lines (72 loc) · 1.43 KB
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
def initialPuzzle(choix):
if choix == 1:
n = 9
M=[[0 for col in range (n)] for ligne in range(n)]
#Cyan
M[0][0]=1
M[3][7]=1
#Orange
M[1][0]=2
M[1][4]=2
#Rose
M[8][1]=3
M[1][7]=3
#Jaune
M[2][7]=4
M[6][2]=4
#Bleu
M[4][1]=5
M[4][5]=5
#Marron
M[4][2]=6
M[4][4]=6
#Vert
M[7][3]=7
M[5][7]=7
#Rouge
M[4][7]=8
M[5][5]=8
# M[6][6]=9
# M[6][8]=9
elif choix ==2:
M=[
[0,0,0,0,0,0,0,0,0],
[0,1,0,0,2,0,0,0,0],
[0,0,0,0,3,0,4,2,0],
[0,0,0,0,0,0,5,0,0],
[0,0,0,0,0,0,0,0,0],
[7,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,6,0,0],
[0,7,0,1,5,6,3,0,0],
[0,0,0,0,4,0,0,0,0]]
n=len(M[0])
elif choix==3:
M=[[ 0, 0, 0, 0, 0, 0, 0 ,0, 0, 0, 0],
[ 0, 0, 0, 1, 2, 0, 0 ,0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0 ,3, 4, 5, 6],
[ 0, 0, 0, 7, 0, 0, 0 ,0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0 ,0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 6, 0 ,0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0 ,10, 5, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0 ,0, 0, 0, 0],
[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