-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathPython.py
41 lines (34 loc) · 978 Bytes
/
Python.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
#****************************************#
#* *#
#* CodinGame.com Solutions by pathosDev *#
#* *#
#* Puzzle: Power of Thor - Episode 1 *#
#* Difficulty: Easy *#
#* Date solved: 08.11.2018 *#
#* *#
#****************************************#
#Read inputs.
inputs = input().split(' ')
lightX = int(inputs[0])
lightY = int(inputs[1])
initialTX = int(inputs[2])
initialTY = int(inputs[3])
while True:
remainingTurns = int(input())
move = ''
#Vertical movement.
if lightY > initialTY:
initialTY += 1
move += 'S'
elif lightY < initialTY:
initialTY -= 1
move += 'N'
#Horizontal movement.
if lightX > initialTX:
initialTX += 1
move += 'E'
elif lightX < initialTX:
initialTX -= 1
move += 'W'
#Output next move.
print(move)