#!/usr/bin/perl -w

# $Id: permute.pl,v 1.2 2000/12/04 03:37:03 alderman Exp $

# permute a list of integers

use strict;

my($MAX_VAL) = 60;
my(@twonums, @result);

# Create array of two digit numbers from 00 to 60
for(my $i = 0; $i <= $MAX_VAL; $i++) {
    my($twonum) = sprintf("%2.2d",$i);
    push(@twonums,$twonum);
}

# Permute that list
@result = permute(@twonums);

print join("\n",@result,"");


BEGIN {
    sub permute(@) {
	my(@inlist) = @_;
	while(@inlist > 0) {
	    my($selection) = int(rand($#inlist));
	    push(@result, $inlist[$selection]);
	    splice(@inlist, $selection, 1);
	}
	return @result;
    }
}
