Skip to content

Commit

Permalink
Fix wrong shuffle
Browse files Browse the repository at this point in the history
  • Loading branch information
miguilimzero committed Oct 6, 2022
1 parent 74c5a27 commit 97b0360
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/AntiBotLinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@ public function generateLinks(int $amount = 4): array
$universe = $universe->flip();
}

// Generate images without any repeated, IMPORTANT: Randomize images order (AFTER CREATE SOLUTION)
// Generate images without any repeated
$options = $universe->map(fn ($after) => [
'id' => random_int(1, 99999),
'image' => $this->generateRandomImage($after),
])->shuffle();
]);

return [
'links' => [
'phrase' => $this->generateRandomImage($universe->keys()->join(', ')),
'options' => $options->all(),
'options' => $options->shuffle()->all(), // IMPORTANT: Shuffle images order only after generate the phrase!
],
'solution' => $options->pluck('id')->join(''),
];
Expand Down

0 comments on commit 97b0360

Please sign in to comment.