mini-led-cube/tools/genRandomParam.pl

45 lines
711 B
Perl
Raw Normal View History

2012-01-14 10:44:35 +01:00
#!/usr/bin/perl -w
#
# author: Kai Lauterbach (klaute at gmail dot com)
# date: 01/2012
# license: GPL v3
#
#
use strict;
use Time::HiRes qw(usleep nanosleep);
my $odelay = 0;
my $olayer = 0;
my $oled = 0;
2012-01-15 00:29:34 +01:00
print "./frame2cube.pl ";
2012-01-14 10:44:35 +01:00
for (my $i = 0; $i < 32; $i++)
{
print "\"";
my $r = 0;
while ($r < 1 || $r > 5 || $odelay == $r)
{
$r = int(rand(6));
}
$odelay = $r;
print $r. ";";
$r = 0;
while ($r < 1 || $r > 3 || $olayer == $r)
{
$r = int(rand(4));
}
$olayer = $r;
print $r;
print ",";
$r = 0;
while ($r < 1 || $r > 9 || $oled == $r)
{
$r = int(rand(10));
}
$oled = $r;
print $r;
print "\" ";
}