3 added IO
source | link

Simultaneous Selection

In the game Risk of Rain there is a game mode where you can select which items you want out of dropped boxes. The only problem is that when you open two boxes at the same time your movements in one box effect your movements in another. Now this can be a problem since you may want to retrieve a particular item from one of the boxes. However there is a solution.

Since the boxes have different shapes and you are not permitted to move your cursor outside of the box you can desynchronize the two cursors.

For example if we have the two boxes

S.F...    S.....
......    ...F..
....      .....

Where F is the goal and S is the starting location, we can get the cursor to the goal by moving the cursor

Right 4 times
Down 3 times 
Up 1 time
Left 1 time

Still working on it ...


Input

As input you will receive two 2 dimensional boolean containers, representing the shapes of the boxes. In these boolean arrays true means that square exists in the box false means square does not exist. You may assume that your input will be padded with false values such that no true values touches the edge of the array.

You will also receive two coordinate pairs representing the start and end locations.

Output

You should output a ordered container of "moves" such that when performed on both boxes the cursor will arrive at the end point. A "move" may be one of 4 chosen values each representing one of the 4 cardinal directions. For example you might choose: [N,S,E,W], [1,2,3,4] or [(1,0),(0,1),(-1,0),(0,-1)]. Your program must be self consistent in these values across multiple sessions.

If no solution is possible for the given boxes you must output a value that is distinct from any possible sequence of moves, for example a list containing a 5th value that cannot represent a move, or a non list item.

Still working on it ...

Simultaneous Selection

In the game Risk of Rain there is a game mode where you can select which items you want out of dropped boxes. The only problem is that when you open two boxes at the same time your movements in one box effect your movements in another. Now this can be a problem since you may want to retrieve a particular item from one of the boxes. However there is a solution.

Since the boxes have different shapes and you are not permitted to move your cursor outside of the box you can desynchronize the two cursors.

For example if we have the two boxes

S.F...    S.....
......    ...F..
....      .....

Where F is the goal and S is the starting location, we can get the cursor to the goal by moving the cursor

Right 4 times
Down 3 times 
Up 1 time
Left 1 time

Still working on it ...

Simultaneous Selection

In the game Risk of Rain there is a game mode where you can select which items you want out of dropped boxes. The only problem is that when you open two boxes at the same time your movements in one box effect your movements in another. Now this can be a problem since you may want to retrieve a particular item from one of the boxes. However there is a solution.

Since the boxes have different shapes and you are not permitted to move your cursor outside of the box you can desynchronize the two cursors.

For example if we have the two boxes

S.F...    S.....
......    ...F..
....      .....

Where F is the goal and S is the starting location, we can get the cursor to the goal by moving the cursor

Right 4 times
Down 3 times 
Up 1 time
Left 1 time

Still working on it ...


Input

As input you will receive two 2 dimensional boolean containers, representing the shapes of the boxes. In these boolean arrays true means that square exists in the box false means square does not exist. You may assume that your input will be padded with false values such that no true values touches the edge of the array.

You will also receive two coordinate pairs representing the start and end locations.

Output

You should output a ordered container of "moves" such that when performed on both boxes the cursor will arrive at the end point. A "move" may be one of 4 chosen values each representing one of the 4 cardinal directions. For example you might choose: [N,S,E,W], [1,2,3,4] or [(1,0),(0,1),(-1,0),(0,-1)]. Your program must be self consistent in these values across multiple sessions.

If no solution is possible for the given boxes you must output a value that is distinct from any possible sequence of moves, for example a list containing a 5th value that cannot represent a move, or a non list item.

Still working on it ...

2 added 186 characters in body
source | link

Simultaneous Selection

In the game Risk of Rain there is a game mode where you can select which items you want out of dropped boxes. The only problem is that when you open two boxes at the same time your movements in one box effect your movements in another. Now this can be a problem since you may want to retrieve a particular item from one of the boxes. However there is a solution.

Since the boxes have different shapes and you are not permitted to move your cursor outside of the box you can desynchronize the two cursors.

For example if we have the two boxes

S..F...    S...F..
..F....    ....F..
....      .....

Where F is the goal and S is the starting location, we can get the cursor to the goal by moving the cursor

Right 4 times
Down 3 times 
Up 1 time
Left 1 time

Still working on it ...

Simultaneous Selection

In the game Risk of Rain there is a game mode where you can select which items you want out of dropped boxes. The only problem is that when you open two boxes at the same time your movements in one box effect your movements in another. Now this can be a problem since you may want to retrieve a particular item from one of the boxes. However there is a solution.

Since the boxes have different shapes and you are not permitted to move your cursor outside of the box you can desynchronize the two cursors.

For example if we have the two boxes

S.....    ...F..
..F...    ......
....      .....

Still working on it ...

Simultaneous Selection

In the game Risk of Rain there is a game mode where you can select which items you want out of dropped boxes. The only problem is that when you open two boxes at the same time your movements in one box effect your movements in another. Now this can be a problem since you may want to retrieve a particular item from one of the boxes. However there is a solution.

Since the boxes have different shapes and you are not permitted to move your cursor outside of the box you can desynchronize the two cursors.

For example if we have the two boxes

S.F...    S.....
......    ...F..
....      .....

Where F is the goal and S is the starting location, we can get the cursor to the goal by moving the cursor

Right 4 times
Down 3 times 
Up 1 time
Left 1 time

Still working on it ...

1
source | link

Simultaneous Selection

In the game Risk of Rain there is a game mode where you can select which items you want out of dropped boxes. The only problem is that when you open two boxes at the same time your movements in one box effect your movements in another. Now this can be a problem since you may want to retrieve a particular item from one of the boxes. However there is a solution.

Since the boxes have different shapes and you are not permitted to move your cursor outside of the box you can desynchronize the two cursors.

For example if we have the two boxes

S.....    ...F..
..F...    ......
....      .....

Still working on it ...