Opening your workspace…
Workspace/Coding room
Opening your workspace…
Climb Pokémon Tower in Lavender Town with the Silph Scope. On 6F, the ghost blocking the stairs is Cubone’s mother, Marowak. You must battle her to pass. From the tile where you enter the floor, what is the fewest Trainer battles you can trigger before you face Marowak?
["E...M",".#^#.","....."]Output0The Channeler watches the middle tile of the top row. Go down the left edge, across the bottom, and up the right edge to reach Marowak unseen.
["##v##","E...M","##^##"]Output2Both Channelers watch the same tile in the corridor. Crossing it triggers two battles before you reach Marowak.
Each trainer watches only one square. A least-cost path can avoid revisiting squares.
function solve(floor) { // Write your solution here. }
Tab inserts two spaces. Shift+Tab outdents. Use the arrow keys and Tab to choose a suggestion. Press Escape, then Tab, to leave the editor. Press Control or Command with apostrophe to run samples or with Enter to submit.