Permalink
Browse files

shuffling instead of randomizing

  • Loading branch information...
polettix committed Sep 30, 2012
1 parent 1e64092 commit 5a8d2d9c86b195a96810b6cc448e75771a986fd7
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/Narsil/Game.pm
View
@@ -7,6 +7,7 @@ use English qw( -no_match_vars );
use Try::Tiny;
use Moo;
use 5.012;
+use List::Util qw< shuffle >;
extends 'Narsil::Object';
@@ -123,7 +124,8 @@ sub calculate_join_application {
my @participants = $match->participants();
if (scalar(@participants) == $self->allowed_number_of_users()) {
$match->phase('active');
- $match->add_mover($participants[rand @participants]);
+ $match->participants(@participants = shuffle @participants);
+ $match->add_mover($participants[0]);
} ## end if (scalar(@participants...
} ## end if (!$match->is_participant...

0 comments on commit 5a8d2d9

Please sign in to comment.