You move on a map which is 40 wide by 18 high. Thor is initially - TopicsExpress



          

You move on a map which is 40 wide by 18 high. Thor is initially placed on a random spot on the map and must reach the light of power as quickly as possible. During each turn, you must specify in which direction to move, from one of the following: N (North) NE (North-East) E (East) SE (South-East) S (South) SW (South-West) W (West) NW (North-West) You win when Thor reaches the light of power. YOU LOSE: if Thor moves off the map. if Thor doesnt have enough energy left to reach the light of power. INITIALIZATION INPUT: Line 1: 4 integers LX LY TX TY. (LX, LY) indicate the position of the light of power. (TX, TY) indicate Thor’s starting position. INPUT FOR ONE GAME TURN: Line 1: The level of Thor’s remaining energy E. This represents the number of moves he can still make. OUTPUT FOR ONE GAME TURN: A single line providing the move to be made: N NE E SE S SW W or NW CONSTRAINTS: 0 ≤ LX < 40 0 ≤ LY < 18 0 ≤ TX < 40 0 ≤ TY < 18 0 ≤ E ≤ 100 Response time per turn ≤ 100ms
Posted on: Sat, 27 Dec 2014 20:32:54 +0000

Trending Topics



Recently Viewed Topics




© 2015