So...here it is...
| LedNumbers.pl |
|---|
#!/usr/bin/perl
use strict;
use warnings;
use diagnostics;
my %leds = (
0 => ' _ ,| | ,|_| ',
1 => ' ,| ,| ',
2 => ' _ , _| ,|_ ',
3 => '_ ,_| ,_| ',
4 => ' ,|_| , | ',
5 => ' _ ,|_ , _| ',
6 => ' _ ,|_ ,|_| ',
7 => '_ , | , | ',
8 => ' _ ,|_| ,|_| ',
9 => ' _ ,|_| , _| '
);
print "Enter a number: ";
my $num = <>;
my @numbers = ( $num =~ /\d/g );
for my $i (0 .. 2){
for my $j (0 .. scalar(@numbers) - 1){
my @line = split /\,/,$leds{$numbers[$j]};
print $line[$i];
}
print "\n";
}
|
And here's the output...
And just so you know...this is my 24th version of this code...yep...I have written my LED Numbers app in 24 languages so far -;) What's going to be my end point? Who knows...programming is the limit -;)
Greetings,
Blag.
Development Culture.

No hay comentarios:
Publicar un comentario