W/W WRECKWRIGHTVESSEL 09 THE WAYFARER
RUST LINK

OBJECTIVE

    Try it, then change it

    This is a practice program, not the level solution. Your draft can be restored.

    YOUR NEXT STEP

      0 / 3 tips revealed
      SALVAGE FEED CAM 01 / TOP DOWNAUXILIARY POWER
      WAYFARER / DOCK (0,2) · RACK CAPACITY 3 · AMBER = RECORD ROUTE
      RECOVERED VALUE0 cr
      HULL DAMAGE0 %
      ENERGY USED0 u
      DOCK TRIPS0
      CARGO0 / 3
      0 / 0
      FLIGHT RECORDER
      Waiting for your first command.
      PERSONAL BEST · SAME CONTRACT

      No successful run recorded.

      R salvage.rsRUST 2021
      Saved locally
      ⌘ / Ctrl + Enter
      SHIP COMMANDS FOR THIS CONTRACT

      Write these in the editor below. End commands with ;. Keep ? on commands that can fail.

      More commands & Rust basics

      let part = ...; names a value so you can use it later. Lines starting with // are comments; the robot ignores them. ? stops the program and shows the error if an action fails. Write only the function body; the game supplies the surrounding function.

      fn solve(ship: &mut Ship) → Result<(), String> {
      Type ship. for commands · Ctrl+Space for suggestions
        Ok(())
      }
      Rust compiler ready. Your program runs in an isolated cloud environment.
      SHIP API REFERENCE
      ship.go(x, y)?

      Travel vertically, then horizontally. Grid: x 0–7, y 0–4. Each tile costs 1 + cargo count energy.

      ship.step(dx, dy)?

      Move one adjacent tile. Loaded weak tiles add 25 damage. At 100 damage the run stops.

      ship.scan(x, y)

      Reading { fragile: bool, component: Option<Kind> }. Scanning costs one action, zero energy.

      ship.recover()?

      Returns owned Component { kind, value, mass }. Requires a part at your tile and a free rack slot.

      ship.inspect(&part)

      Borrows a Component and returns its value.

      ship.install(part)?

      Consumes the component at dock (0,2). Restores the matching ship system.

      ship.log("message")

      Add a message to the flight recorder. Kind variants: Battery, Alloy, Coolant, Core.

      Functions, structs, Vec, iterators, and all standard Rust syntax work from the start. 400 simulation actions; 2.5 seconds execution. Errors display compiler line numbers with a two-line wrapper offset.

      WELCOME ABOARD THE WAYFARER

      You write the robot's instructions.

      Restore this ship by writing small Rust programs. You do not steer the robot with the keyboard. Your code tells it where to go and what to recover.

      1. Read the objective and find the parts. The grid uses (column, row), starting at 0 in the upper-left. The robot begins at the green dock (0,2). Glowing boxes are recoverable parts.
      2. Try one command. The command cards beside the editor explain what the ship can do. For example, ship.go(1, 1)?; moves to an empty tile. Type it into the editor and press Compile & run.
      3. Build up your program. Every run starts at the dock with a fresh copy of the contract. Keep the commands that worked and add the next action. Your code and completed repairs are saved automatically.
      4. Watch, fix, and try again. Follow the robot and flight recorder. Errors appear below Run. Pause, Step, and the timeline let you inspect a run. Retrying costs nothing.
      5. Ask for help when you want it. Each contract has three tips, revealed one at a time. After the third, you can choose to view a solution. Finish a repair to unlock the next contract.

      Discovery mode introduces one problem at a time. Expert mode opens all contracts. Both use real Rust and allow all its syntax.