mirror of
https://github.com/mi57730/a2d.git
synced 2024-10-31 19:05:06 +00:00
18 lines
273 B
Perl
18 lines
273 B
Perl
|
#!/usr/bin/env perl
|
||
|
|
||
|
use strict;
|
||
|
use warnings;
|
||
|
|
||
|
|
||
|
while (<STDIN>) {
|
||
|
chomp;
|
||
|
s/[^ #]//g;
|
||
|
tr/ #/01/;
|
||
|
next unless $_;
|
||
|
$_ .= '0' while length($_) % 7 != 0;
|
||
|
|
||
|
my @a = m/(.......)/g;
|
||
|
|
||
|
print ' .byte ' . join(',', map { "px(\%$_)" } @a) . "\n";
|
||
|
}
|