Hilltops

Abhinav Reddy

HILLTOPS GAME


GAME DESCRIPTION

In the hilltops problem, you are given the heights, all distinct, of a set of hilltops. The lowest hilltop contains an underground aqueduct.

Your goal is to create a configuration via swaps in which water falling on any hilltop eventually flows to the lowest hilltop and doesn't get stuck on any other hilltop.

OBJECTIVES

  • Make the grid Hilltop-Perfect: All water must flow to the minimum without getting stuck elsewhere.
  • Minimize Swaps: Achieve the goal in as few moves as possible.
  • Minimize Max Worst Case Distance: Reduce the longest path water takes to the lowest hilltop from any starting hilltop (Tie-breaker).

CONTROLS

  • Drag and Drop: Click a tile, holding down the mouse button, drag the tile to the tile with which you want to swap, and release the button.
  • Toggle 3D: View the topology to visualize heights.

UNDERSTANDING THE DEBUG GRIDS

When you check a configuration, two helper grids appear to help you diagnose issues:

1. Reachability Matrix

  • ✓ (Green): Water starting at this hilltop can eventually reach the lowest hilltop.
  • X (Red): Water is trapped! Water from this hilltop flows only to a hilltop other than the lowest.

2. Worst Distance Matrix

  • Number: The length of the longest possible path water takes to get from this cell to the lowest hilltop.
  • - (Red): Water from this hilltop flows only to a hilltop other than the lowest. 

Enjoy the game!

Video description of the game