Created
July 17, 2020 07:25
-
-
Save mdjx/32c3c9e29e9750268f9cc4c067396559 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$blocks = @() | |
$blockChain = @() | |
#$blocks += New-Object -TypeName psobject -Property @{c = [char]0x2597; s=@(0,0,0,1); w=3} | |
#$blocks += New-Object -TypeName psobject -Property @{c = [char]0x259d; s=@(0,1,0,0); w=2} | |
$blocks += New-Object -TypeName psobject -Property @{c = [char]0x2599; s=@(1,0,1,1); w=4} | |
$blocks += New-Object -TypeName psobject -Property @{c = [char]0x259b; s=@(1,1,1,0); w=3} | |
$blocks += New-Object -TypeName psobject -Property @{c = [char]0x259c; s=@(1,1,0,1); w=3} | |
$blocks += New-Object -TypeName psobject -Property @{c = [char]0x259f; s=@(0,1,1,1); w=3} | |
$blocks += New-Object -TypeName psobject -Property @{c = [char]0x258d; s=@(0,0,1,1); w=2} | |
$FullBlock = New-Object -TypeName psobject -Property @{c = [char]0x2588; s=@(1,1,1,1); w=4} | |
$currentTitleBlocks = @($blocks[-1].c) | |
$TotalSpace = 50 | |
$titleEnd = $currentTitleBlocks | |
while ($TotalSpace -gt 0) { | |
$block = get-random($blocks) | |
$leftPad = 0 | |
$rightPad = $TotalSpace - $block.w | |
while ($rightPad -ge 0) { | |
$newTitle = " " * $leftPad + $block.c + " " * $rightPad + $titleEnd | |
$Host.UI.RawUI.WindowTitle = $newTitle | |
$leftPad++ | |
$rightPad-- | |
start-sleep -milliseconds 50 | |
} | |
$blockChain += $block | |
$titleEnd = $newTitle.trim() | |
$TotalSpace = $TotalSpace - $block.w | |
start-sleep -milliseconds 100 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment