You’re walking down a long, narrow valley in the fog (“Walk downhill”). Across the valley the ground is 100× steeper than along it, so plain steps of step_size × slope bounce from wall to wall while you crawl along the floor. Write steps(slopes_seen, step_size): slopes_seen has, for each direction, every slope you’ve felt so far, oldest first. Return the step to take now in each direction, using step_size as the biggest step you’d ever take.
| 1st | 2nd | 3rd | |
|---|---|---|---|
| across | 2 | 2.4 | 1.6 |
| along | 0.02 | 0.024 | 0.016 |