Skip to content

Commit

Permalink
Expermineting to drag results
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrikBuetler committed Jun 24, 2024
1 parent c44abe0 commit 2489989
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/ui/Rearranger.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ public function seekAndSwap($array, $goal, $direction) {
$temparray = $array;
$tempkey = $goalkey;
echo "Element found inside this array:\n";
print_r($element, false);
echo "\nInitiating swap.. Key: " . $goalkey . "\n";
print_r($array, false);
break;
}
else {
Expand All @@ -43,6 +42,7 @@ public function seekAndSwap($array, $goal, $direction) {
}
}
if(isset($temparray) && isset($tempkey)) {
echo "\nInitiating swap.. Key: " . $goalkey . "\n";
return $this->swap($temparray, $goal, $tempkey, $direction);
}
}
Expand All @@ -61,6 +61,8 @@ public function searchInside ($subarray, $goal) {
return false;
}
public function swap($array, $goal, $goalkey, $direction) {
echo "swap received this array: \n";
print_r($array, false);
$temp = '';
$tempkey = 0;
$counter = 0;
Expand Down

0 comments on commit 2489989

Please sign in to comment.