aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Russell <ac.russell@live.com>2024-01-21 17:37:56 -0500
committerAdam Russell <ac.russell@live.com>2024-01-21 17:37:56 -0500
commit18906c0e06d68c2efa51608b71772fb1216ea3fa (patch)
tree983fe60f981b84eee439586faa7cd38653a99e52
parent86ed7e9f7fe4e19919a836752e7582c8c9bb1799 (diff)
downloadperlweeklychallenge-club-18906c0e06d68c2efa51608b71772fb1216ea3fa.tar.gz
perlweeklychallenge-club-18906c0e06d68c2efa51608b71772fb1216ea3fa.tar.bz2
perlweeklychallenge-club-18906c0e06d68c2efa51608b71772fb1216ea3fa.zip
srand should only be called once per process
-rw-r--r--challenge-252/adam-russell/perl/ch-2.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/challenge-252/adam-russell/perl/ch-2.pl b/challenge-252/adam-russell/perl/ch-2.pl
index 92893abfa7..488877436a 100644
--- a/challenge-252/adam-russell/perl/ch-2.pl
+++ b/challenge-252/adam-russell/perl/ch-2.pl
@@ -3,8 +3,8 @@ use v5.38;
# Given an integer, $n, write a script to find an array containing $n
# unique integers such that they add up to zero.
##
+srand(ord q/TWC/);
sub rand_sum_zero{
- srand(ord q/TWC/);
my $n = shift;
my @r;
my $x = int(rand($n * 5)) + 1;