Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # https://pastebin.com/SL6TCPi3
- # Randomly distorts strings
- Param (
- [Parameter(ValueFromPipeline=$true)]
- [String] $String
- )
- $Host.UI.RawUI.WindowTitle = 'String Distorter'
- $Distortion = 'P','a','r','m','(','[','e','t','M','n','d','o','y','=','f','l','s',',','i','0',')',']','w','c','h','D','b','U','p','C','k','1','<','#','T','S','I','u','v','g','x','.','A','F',':','-','E','/','|','H','O','\','8','&','Y','B','@','>','R','W','L','2','V','!','Q','q','j','N','_','G','*','9','3','5','7','X','4','6','K','+',';','z','▄','─','═','?','J','ß','ä','ö','î','~','€','§','%','³','â','à','í','á','²','Ä','ó','Û','Â','Í','☐','Ê','Ô','ò','À','ì','è','█','È','ü','ô','´','é','¶','É','ê','°','Á','^','Ö','Î','Ì','Ü','Z','û'
- if ([string]$String -eq '') {
- $String = 'This is a string'
- }
- $String -split '.*?' | ForEach-Object {
- if ($i %2 -eq 1) {
- $_ = $Distortion[(Get-Random -Maximum ($Distortion.Count - 1))]
- $r = Get-Random -Minimum 1 -Maximum 10
- } else {
- $r = Get-Random -Minimum 3 -Maximum 10
- }
- $cur += $_
- if ($cur.Length -ge $r) {
- $i++
- $Output += @($cur)
- $cur = ''
- }
- }
- ($Output += @($cur))
- Write-Host "`n"
- $Output | ForEach-Object {
- if ($n++%2 -eq 0) {
- Write-Host $_ -NoNewline
- } else {
- Write-Host $_ -BackgroundColor DarkYellow -ForegroundColor Black -NoNewline
- }
- }
- Read-Host
Add Comment
Please, Sign In to add comment