From bfefde79385ccd01756dcb98e4fb99b498290cc9 Mon Sep 17 00:00:00 2001 From: Kai Lauterbach Date: Sat, 14 Jan 2012 10:44:35 +0100 Subject: [PATCH] Renamed and random generator added. --- tools/{param2HexFrame.pl => frame2Cube.pl} | 4 ++ tools/genRandomParam.pl | 44 ++++++++++++++++++++++ 2 files changed, 48 insertions(+) rename tools/{param2HexFrame.pl => frame2Cube.pl} (97%) create mode 100644 tools/genRandomParam.pl diff --git a/tools/param2HexFrame.pl b/tools/frame2Cube.pl similarity index 97% rename from tools/param2HexFrame.pl rename to tools/frame2Cube.pl index 5abaa27..0034d0d 100644 --- a/tools/param2HexFrame.pl +++ b/tools/frame2Cube.pl @@ -1,5 +1,9 @@ #!/usr/bin/perl -w # +# author: Kai Lauterbach (klaute at gmail dot com) +# date: 01/2012 +# license: GPL v3 +# # usage: # # ./param2HexFrame.pl "frame 1 data" "frame 2 data" ... "frame N data" diff --git a/tools/genRandomParam.pl b/tools/genRandomParam.pl new file mode 100644 index 0000000..fbe2d06 --- /dev/null +++ b/tools/genRandomParam.pl @@ -0,0 +1,44 @@ +#!/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; + +print "./param2HexFrame.pl "; +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 "\" "; +} +