1
0
mirror of https://github.com/jaapbrasser/SharedScripts.git synced 2026-04-18 19:01:56 +02:00

Added convertto-Morse function 🆕

This commit is contained in:
Jaap Brasser
2022-01-11 22:10:55 +01:00
parent ac15e55821
commit d7f93a428b
+46
View File
@@ -0,0 +1,46 @@
function ConvertTo-Morse {
param(
[string] $InputObject
)
$Morse = @{
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 = '--..'
}
$InputObject.ToCharArray().ForEach{$Morse[([string]$_)]} -join ' '
}