现在的位置: 首页 > 综合 > 正文

显示led 数字的perl程序

2013年02月04日 ⁄ 综合 ⁄ 共 482字 ⁄ 字号 评论关闭

#!/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_____________

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

抱歉!评论已关闭.