๐Ÿš‚ Train Cargo Challenge

Six crates. One train. Can you earn the most delivery points without going over the load limit?

1. Choose a mission

Every crate is available once. You must take a whole crate or leave it. Load units and delivery points are invented game values, not real train capacities or money.

2. Build your load

Tick a crate to load it; untick to unload it. Keyboard: Tab to a checkbox, then Space. You can go over the limit while experimenting, but that load cannot win.

3. Check your plan

Selected load0 / 10

Delivery points0

Capacity remaining10

Try a combination, then check it.

4. Compare with a computer search

Make your prediction first. Then reveal a best load and see how the computer checks it. There can be more than one equally good load.

Why the obvious choice can lose

This is a small 0/1 knapsack puzzle: each crate is either selected (1) or left behind (0). The goal is the largest total score among loads that fit. A crate with the most points, or the most points per load unit, does not always lead to the best complete load.

Our search tries both choices for each crate. Six crates make 2 ร— 2 ร— 2 ร— 2 ร— 2 ร— 2 = 64 possible selections, including the empty train. It rejects loads above the limit and compares the scores of the rest. This is called exhaustive search. More crates make this method grow quickly; this lab deliberately keeps the puzzle small.

  1. In First dispatch, try the 13-point crate first. Can you beat that plan by leaving it behind?
  2. Can you find a load that exactly fills the train but scores less than another full load?
  3. Switch missions and predict whether picking the best points-per-unit crate first will work.

Teaching model only: this simplified puzzle is not real railway loading advice. Your selections stay in this page's memory. They are not saved or uploaded; reload to start again.

Keep exploring

Code Lab ยท Packet Rescue Lab ยท All courses