Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
11
Task/Morse-code/Sed/morse-code-1.sed
Normal file
11
Task/Morse-code/Sed/morse-code-1.sed
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sed -rf
|
||||
# Convert to uppercase
|
||||
s/.*/\U&/
|
||||
# Add lookup table
|
||||
s/$/\nA.-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--../
|
||||
# Main loop
|
||||
:a
|
||||
s/([A-Z])([^\n]*\n.*\1([-.]+))/\3 \2/
|
||||
ta
|
||||
# Remove lookup table
|
||||
s/\n.*//
|
||||
2
Task/Morse-code/Sed/morse-code-2.sed
Normal file
2
Task/Morse-code/Sed/morse-code-2.sed
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
$ echo hello world! | ./morse.sed
|
||||
.... . .-.. .-.. --- .-- --- .-. .-.. -.. !
|
||||
Loading…
Add table
Add a link
Reference in a new issue