X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=examples%2Fsmooth_bar.pl;fp=examples%2Fsmooth_bar.pl;h=befae9aab0ad5d1917feeb4c713487d7baec1c8c;hb=79c7be60fdd8511aa3fcfaf2e0777e4933e0d24e;hp=0000000000000000000000000000000000000000;hpb=1d57993ad6c38499ac417560bd18d20a689dd366;p=term-progressbar.git diff --git a/examples/smooth_bar.pl b/examples/smooth_bar.pl new file mode 100644 index 0000000..befae9a --- /dev/null +++ b/examples/smooth_bar.pl @@ -0,0 +1,19 @@ +#!/usr/bin/perl +use strict; +use warnings; + +use Term::ProgressBar 2.00; + +my $max = shift || 100; + +my $progress = Term::ProgressBar->new($max); + +for (0..$max) { + my $is_power = 0; + for(my $i = 0; 2**$i <= $_; $i++) { + $is_power = 1 + if 2**$i == $_; + } + + $progress->update($_) +}