-
Notifications
You must be signed in to change notification settings - Fork 53
/
jump.ps1
43 lines (36 loc) · 774 Bytes
/
jump.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<#
Author: Doug Finke
Email: [email protected]
Blog: https://dfinke.github.io/
Twitter: https://twitter.com/dfinke
GitHub: https://github.com/dfinke
YouTube: https://www.youtube.com/dougfinke
PowerShell Meetup: https://www.meetup.com/NycPowershellMeetup/
LinkedIn: https://www.linkedin.com/in/douglasfinke/
#>
param(
$number
)
$map = @{
'1' = '9'
'2' = '8'
'3' = '7'
'4' = '6'
'5' = '0'
'6' = '4'
'7' = '3'
'8' = '2'
'9' = '1'
'0' = '5'
}
-join (
$number.ToCharArray() | ForEach-Object {
$key = $_.ToString()
if ($map.ContainsKey($key)) {
$map.$key
}
else {
$key
}
}
)