Rush Hour Initial Configurations

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.

$text"; } $cur = floor($offset / $window_size) + 1; $num_pages = floor(count($images) / $window_size) + 1; $self = $_SERVER['PHP_SELF'] . "?window_size=$window_size"; if ($offset > 0) { $prev_offset = $offset - $window_size; if ($prev_offset < 0) { $prev_offset = 0; } $prev_url = $self . "&offset=" . ($prev_offset); $prev = linkify("Previous", $prev_url); } if ($offset <= count($images) - $window_size) { $next_offset = $offset + $window_size; if ($next_offset > count($images)) { $next_offset = count($images); } $next_url = $self . "&offset=" . ($next_offset); $next = linkify("Next", $next_url); } echo "

$prev Page $cur of $num_pages $next

"; // Images foreach ($images as $index => $file) { $min_moves = substr($file,4,2); $reachable_configurations = substr($file, 7, -4); if ($index >= $offset && $index < $offset+$window_size) { // print "$index $min_moves $reachable_configurations
"; ?>

Reachable Configurations:

Minimum solution: moves