-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBotClean Stochastic
More file actions
31 lines (29 loc) · 945 Bytes
/
BotClean Stochastic
File metadata and controls
31 lines (29 loc) · 945 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
#!/bin/python3
def nextMove(posr, posc, board):
if board[posr][posc] == 'd':
print("CLEAN")
else:
for i in range(0,5):
for j in range(0,5):
if board[i][j] == 'd':
if i > posr:
print("DOWN")
posr = i
break
elif i < posr:
print("UP")
posr = i
break
elif j > posc:
print("RIGHT")
posc = j
break
elif j < posc:
print("LEFT")
posc = j
break
return
if __name__ == "__main__":
pos = [int(i) for i in input().strip().split()]
board = [[j for j in input().strip()] for i in range(5)]
nextMove(pos[0], pos[1], board)