Signpost
This mission is an adaptation of the "Signpost" game (from Simon Tatham's Portable Puzzle Collection ). If you are lost or just want to play, the game is available here .
You're on a rectangular grid. You must find your way to go through the entire grid, following the directions indicated. Some boxes are already given like the start and the end of the path, you have to respect them.
The numbers say the location in the path, starting at 1. For example, a box with the number 9 indicates that this box is the ninth on the path.
Empty boxes are represented by zeros. Possible directions: north 'N', northwest 'NW', west 'W', southwest 'SW', south 'S', southeast 'SE', east 'E', northeast 'NE' and nothing '' (for the end of the path).
Then, you have to return the completed grid representing the path.
[[1, 0, 0, 0, 0], (('SE', 'E' , 'SW', 'S' , 'S' ), [[ 1, 13, 3, 14, 21], [0, 0, 9, 0, 18], ('E' , 'W' , 'S' , 'NE', 'SW'), [ 8, 7, 9, 20, 18], [0, 0, 0, 0, 0], ('S' , 'N' , 'N' , 'N' , 'S' ), ===\ [ 4, 6, 2, 19, 22], [0, 0, 0, 0, 0], ('NE', 'N' , 'NE', 'SE', 'W' ), ===/ [ 5, 12, 17, 24, 23], [0, 0, 0, 0, 25]] ('NE', 'NE', 'W' , 'W' , '' )) [11, 16, 10, 15, 25]]
Input: A list of lists of integers, and a tuple of tuples of strings.
Output: A list/tuple of lists/tuples of integers.
Example:
signpost([[1, 0, 0], [0, 0, 0], [0, 0, 9]], (('S' , 'E' , 'S' ), ('S' , 'S' , 'NW'), ('NE', 'NE', '' ))) == [[1, 7, 8], [2, 4, 6], [3, 5, 9]] signpost([[1, 0, 0, 0, 0], [0, 0, 9, 0, 18], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 25]], (('SE', 'E' , 'SW', 'S' , 'S' ), ('E' , 'W' , 'S' , 'NE', 'SW'), ('S' , 'N' , 'N' , 'N' , 'S' ), ('NE', 'N' , 'NE', 'SE', 'W' ), ('NE', 'NE', 'W' , 'W' , '' ))) == [[ 1, 13, 3, 14, 21], [ 8, 7, 9, 20, 18], [ 4, 6, 2, 19, 22], [ 5, 12, 17, 24, 23], [11, 16, 10, 15, 25]]
To play the puzzles / tests yourself: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Preconditions:
- Given puzzles are solvable and have only one solution.
- 3 ≤ len(grid) ≤ 30 and 3 ≤ len(grid[0]) ≤ 50.
- len(grid) == len(directions) and all(len(row1) == len(row2) == len(grid[0]) for row1, row2 in zip(grid, directions)).
CheckiO Extensions allow you to use local files to solve missions. More info in a blog post.
In order to install CheckiO client you'll need installed Python (version at least 3.8)
Install CheckiO Client first:
pip3 install checkio_client
Configure your tool
checkio --domain=py config --key=
Sync solutions into your local folder
checkio sync
(in beta testing) Launch local server so your browser can use it and sync solution between local file end extension on the fly. (doesn't work for safari)
checkio serv -d
Alternatevly, you can install Chrome extension or FF addon
checkio install-plugin
checkio install-plugin --ff
checkio install-plugin --chromium
Read more here about other functionality that the checkio client provides. Feel free to submit an issue in case of any difficulties.
Welcome to Pair Programming! Engage in real-time collaboration on coding projects by starting a session and sharing the provided unique URL with friends or colleagues. This feature is perfect for joint project development, debugging, or learning new skills together. Simply click 'Start Session' to begin your collaborative coding journey!
You are trying to join a pair programming session that has not started yet.
Please wait for the session creator to join.
It looks like the creator of the pair programming session closed the editor window.
It might happen accidentally, so that you can wait for reconnection.