langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
64
Task/Morse-code/Perl-6/morse-code.pl6
Normal file
64
Task/Morse-code/Perl-6/morse-code.pl6
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
my %m = ' ', '_ _ ',
|
||||
<
|
||||
! ---.
|
||||
" .-..-.
|
||||
$ ...-..-
|
||||
' .----.
|
||||
( -.--.
|
||||
) -.--.-
|
||||
+ .-.-.
|
||||
, --..--
|
||||
- -....-
|
||||
. .-.-.-
|
||||
/ -..-.
|
||||
: ---...
|
||||
; -.-.-.
|
||||
= -...-
|
||||
? ..--..
|
||||
@ .--.-.
|
||||
[ -.--.
|
||||
] -.--.-
|
||||
_ ..--.-
|
||||
0 -----
|
||||
1 .----
|
||||
2 ..---
|
||||
3 ...--
|
||||
4 ....-
|
||||
5 .....
|
||||
6 -....
|
||||
7 --...
|
||||
8 ---..
|
||||
9 ----.
|
||||
A .-
|
||||
B -...
|
||||
C -.-.
|
||||
D -..
|
||||
E .
|
||||
F ..-.
|
||||
G --.
|
||||
H ....
|
||||
I ..
|
||||
J .---
|
||||
K -.-
|
||||
L .-..
|
||||
M --
|
||||
N -.
|
||||
O ---
|
||||
P .--.
|
||||
Q --.---
|
||||
R .-.
|
||||
S ...
|
||||
T -
|
||||
U ..-
|
||||
V ...-
|
||||
W .--
|
||||
X -..-
|
||||
Y -.--
|
||||
Z --..
|
||||
>.map: -> $c, $m is copy {
|
||||
$m.=subst(rx/'-'/, 'BGAAACK!!! ', :g);
|
||||
$m.=subst(rx/'.'/, 'buck ', :g);
|
||||
$c => $m ~ '_ ';
|
||||
}
|
||||
|
||||
say prompt("Gimme a string: ").uc.comb.map: { %m{$_} // "<scratch> " }
|
||||
Loading…
Add table
Add a link
Reference in a new issue