-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscribblepad.py
72 lines (53 loc) · 1.46 KB
/
scribblepad.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
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
#word = str(input("Enter the word to search for in UPPERCASE: "))
puzzleword = ['S','C','O','R','E']
s = ''
for i in range(len(puzzleword)):
t = puzzleword[i]
s = s + t
##
p = []
q = []
r = []
puzzlewordForward = []
puzzlewordPositionsForward = []
rows = int(input("Rows: "))
columns = int(input("Columns: "))
for row in range(rows):
for column in range(columns):
#print(column)
q.append(column)
#print(q)
if column == 17:
p.append(q)
#print(q)
#print(p)
if row != 17:
q.clear()
def checkforward(Row, Column):
if Column < (rows - len(word)):
for columns in range(Column, Column + len(word)):
puzzlewordForward.append(puzzle[Row][columns])
puzzlewordPositionsForward.append([Row, columns])
s = 0
for i in range(len(puzzlewordForward)):
t = puzzlewordForward[i]
s = s + t
if s == word:
print(word,"found!")
print(puzzlewordPositionsForward)
else:
puzzlewordPositionsForward.clear()
word = int(input("No to find: "))
for row in range(0, rows):
for column in range(0, columns):
if p[row][column] == word[0]:
checkforward(rows, columns)
#for i in range(0, rows):
#m.append(p)
print("Final Table:\n")
for row in range(rows):
for column in range(columns):
#if row == p[0][0] and column == p[0][1]:
print(p[row][column], end=' ')
if column == 17:
print('\n')