Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jrmoulton/testpackage
https://github.com/jrmoulton/testpackage
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jrmoulton/testpackage
- Owner: jrmoulton
- Created: 2020-07-05T05:20:29.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-07-17T15:45:03.000Z (over 4 years ago)
- Last Synced: 2025-01-12T01:05:03.730Z (14 days ago)
- Language: Swift
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Test Package
### The Challenge
You have maps of parts of the space station, each starting at a prison exit and ending at the door to an escape pod. The map is represented as a matrix of 0s and 1s, where 0s are passable space and 1s are impassable walls. The door out of the prison is at the top left (0,0) and the door into an escape pod is at the bottom right (𝑤−1,ℎ−1). Write a function answer(map) that generates the length of the shortest path from the prison door to the escape pod, where you are allowed to remove one wall as part of your remodeling plans. The path length is the total number of nodes you pass through, counting both the entrance and exit nodes. The starting and ending positions are always passable (0). The map will always be solvable, though you may or may not need to remove a wall. The height and width of the map can be from 2 to 20. Moves can only be made in cardinal directions; no diagonal moves are allowed.
### Instructions to Run
From inside of main package folder run ```./run.sh```
It is necessary to rebuild after every code change using ```swift build``` then run the executable using ```swift run```
The main file is located in Sources/testPackage/main.swift