Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Added Solution.py for Lost Robot
  • Loading branch information
dgupta777 authored Oct 27, 2017
commit 253c440c6420e30b9ab840a9ec6ff5f9d8d6ca68
15 changes: 15 additions & 0 deletions bin/Lost Robot/Solution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#According to question we can only instruct robot up or down or left or right. So in his current coordiantes and home coordinates one of the/
#coordinate either X or Y must be same.
for _ in range(int(input()):
x1,y1,x2,y2=map(int,input().split())#This will parse input to x1,y1,x2 and y2
if x1!=x2 and y1!=y2:
print('sad')
elif x1==x2 and y1<y2:
print('up')
elif x1==x2 and y1>y2:
print('down')
elif y1==y2 and x1<x2:
print('right')
elif y1==y2 and x1>x2:
print('left')