显示led 数字的perl程序

来源:互联网 发布:网络接入控制综述 编辑:程序博客网 时间:2024/06/13 09:45

#!/usr/bin/perl -w
use strict;

open FONT, "font.txt";
chomp(my @font = <FONT>);
close FONT;
my @led = map { s/(.{4})/$1,/g; split /,/ } @font;


chomp(my $num = <>);
my @n = split //, $num;
for (0..6) {
    for my $n(@n) {
        print $led[$n+10*$_];
    }
    print "/n";

}

_____________font.txt_____________

 --      --  --      --  --  --  --  --
|  ||      |   ||  ||   |      ||  ||  |
|  ||      |   ||  ||   |      ||  ||  |
         --  --  --  --  --      --  --
|  ||   |      |   |   ||  |   ||  |   |
|  ||   |      |   |   ||  |   ||  |   |
 --      --  --      --  --      --  --

原创粉丝点击