#!/usr/bin/perl use strict; use warnings; my @wheels = (0) x 6; sub collapse { join ':', map { sprintf "%02d", $_ } @wheels; } sub emit { print collapse(), "\n"; } for my $round ( reverse 0..5 ) { for my $range ( 1..99 ) { $wheels[$round] = $range; emit(); } } __END__ $ ./459473.pl | head 00:00:00:00:00:01 00:00:00:00:00:02 00:00:00:00:00:03 00:00:00:00:00:04 00:00:00:00:00:05 00:00:00:00:00:06 00:00:00:00:00:07 00:00:00:00:00:08 00:00:00:00:00:09 00:00:00:00:00:10 $ ./459473.pl | head -n 105 | tail 00:00:00:00:00:96 00:00:00:00:00:97 00:00:00:00:00:98 00:00:00:00:00:99 00:00:00:00:01:99 00:00:00:00:02:99 00:00:00:00:03:99 00:00:00:00:04:99 00:00:00:00:05:99 00:00:00:00:06:99 $ ./459473.pl | head -n 205 | tail 00:00:00:00:97:99 00:00:00:00:98:99 00:00:00:00:99:99 00:00:00:01:99:99 00:00:00:02:99:99 00:00:00:03:99:99 00:00:00:04:99:99 00:00:00:05:99:99 00:00:00:06:99:99 00:00:00:07:99:99 $ ./459473.pl | tail 90:99:99:99:99:99 91:99:99:99:99:99 92:99:99:99:99:99 93:99:99:99:99:99 94:99:99:99:99:99 95:99:99:99:99:99 96:99:99:99:99:99 97:99:99:99:99:99 98:99:99:99:99:99 99:99:99:99:99:99