|
# ¡uʍop-ǝpısdn ʇxǝʇ ɹnoʎ dı|ɟ |
|
function Flip-Text { param ([parameter(ValueFromPipeline=$True)][string] $in) |
|
$table = New-Object Collections.Hashtable ([StringComparer]::CurrentCulture) |
|
$table.Add([char]'a', [char]0x0250) |
|
$table.Add([char]'b', [char]'q') |
|
$table.Add([char]'c', [char]0x0254) |
|
$table.Add([char]'d', [char]'p') |
|
$table.Add([char]'e', [char]0x01DD) |
|
$table.Add([char]'f', [char]0x025F) |
|
$table.Add([char]'g', [char]0x0183) |
|
$table.Add([char]'h', [char]0x0265) |
|
$table.Add([char]'i', [char]0x0131) |
|
$table.Add([char]'j', [char]0x027E) |
|
$table.Add([char]'k', [char]0x029E) |
|
$table.Add([char]'l', [char]'|') |
|
$table.Add([char]'m', [char]0x026F) |
|
$table.Add([char]'n', [char]'u') |
|
$table.Add([char]'o', [char]'o') |
|
$table.Add([char]'p', [char]'d') |
|
$table.Add([char]'q', [char]'b') |
|
$table.Add([char]'r', [char]0x0279) |
|
$table.Add([char]'s', [char]'s') |
|
$table.Add([char]'t', [char]0x0287) |
|
$table.Add([char]'u', [char]'n') |
|
$table.Add([char]'v', [char]0x028C) |
|
$table.Add([char]'w', [char]0x028D) |
|
$table.Add([char]'x', [char]'x') |
|
$table.Add([char]'y', [char]0x028E) |
|
$table.Add([char]'z', [char]'z') |
|
$table.Add([char]'A', [char]0x0250) |
|
$table.Add([char]'B', [char]'q') |
|
$table.Add([char]'C', [char]0x0254) |
|
$table.Add([char]'D', [char]'p') |
|
$table.Add([char]'E', [char]0x01DD) |
|
$table.Add([char]'F', [char]0x025F) |
|
$table.Add([char]'G', [char]0x0183) |
|
$table.Add([char]'H', [char]0x0265) |
|
$table.Add([char]'I', [char]0x0131) |
|
$table.Add([char]'J', [char]0x027E) |
|
$table.Add([char]'K', [char]0x029E) |
|
$table.Add([char]'L', [char]'|') |
|
$table.Add([char]'M', [char]0x026F) |
|
$table.Add([char]'N', [char]'u') |
|
$table.Add([char]'O', [char]'o') |
|
$table.Add([char]'P', [char]'d') |
|
$table.Add([char]'Q', [char]'b') |
|
$table.Add([char]'R', [char]0x0279) |
|
$table.Add([char]'S', [char]'s') |
|
$table.Add([char]'T', [char]0x0287) |
|
$table.Add([char]'U', [char]'n') |
|
$table.Add([char]'V', [char]0x028C) |
|
$table.Add([char]'W', [char]0x028D) |
|
$table.Add([char]'X', [char]'x') |
|
$table.Add([char]'Y', [char]0x028E) |
|
$table.Add([char]'Z', [char]'z') |
|
$table.Add([char]'.', [char]0x02D9) |
|
$table.Add([char]'[', [char]']') |
|
#$table.Add([char]'\'', [char]',') |
|
#$table.Add([char]',', [char]'\'') |
|
$table.Add([char]'(', [char]')') |
|
$table.Add([char]'{', [char]'}') |
|
$table.Add([char]'?', [char]0x00BF) |
|
$table.Add([char]'!', [char]0x00A1) |
|
$table.Add([char]'<', [char]'>') |
|
$table.Add([char]'_', [char]0x203E) |
|
$table.Add([char]' ', [char]' ') |
|
|
|
$out = New-Object System.Text.StringBuilder |
|
$in.ToCharArray() | %{ |
|
$char = if ($table.ContainsKey($_)) {$table[$_]} else {$_} |
|
$out.Append($char) | Out-Null |
|
} |
|
|
|
# Reverse string and print |
|
$out = $out.ToString(); |
|
$out = -join $out[-1..-$out.Length] |
|
Write-Output $otu |
|
} |