March10

double color balls

5.jpg

#!C:\perl\perl

###########################

#         500万就靠你了    #

###########################
package fiveM;
use strict;

my (@blue, @red, $offset);
my ($i, $j);
@blue = 1..33;
@red = 1..16;
print 'red:';
srand ( time() ^ ($$ + ($$ << 15)) );
for ($i = 0; $i<6 ; $i++) {
  $offset = int(rand(33 - $i));
  print $blue[$offset];
  print ", ";
  splice (@blue, $offset, 1);
}
$offset = int(rand(16));
print "\nblue: ";
print $red[$offset];


--EOF--

本篇文章已有0条评论