# reduce n -- remove n items from end
# set i n -- assign item at index i to be n
# get i -- display item at index i
+# first, last -- show first or last item
# show -- write entire array to stdout, space separated on one line
sub random ($) {
$max = 0; # Estimate of size of array
$serial = 1;
while ($lines) {
- $what = random(17);
+ $what = random(21);
if ($what < 8) {
my $op = (qw(push pop shift unshift))[$what % 4];
if ($op eq "push" || $op eq "unshift") {
} else {
print "get $i\n";
}
+ } elsif ($what < 20) {
+ my $op = (qw(first last))[$what % 2];
+ print "$op\n" if $max;
} elsif (random(10) == 0) {
print "show\n";
} else { next; }