Code:\Command Line\PowerShell ▸ .\counter.ps1
Number to count to: 275
█
█
██
█
█ █
██
███
█
█ █
█ █
█ ██
██
██ █
███
████
█
█ █
█ █
█ ██
█ █
█ █ █
█ ██
█ ███
██
██ █
██ █
██ ██
███
███ █
████
█████
█
█ █
█ █
█ ██
█ █
█ █ █
█ ██
█ ███
█ █
█ █ █
█ █ █
█ █ ██
█ ██
█ ██ █
█ ███
█ ████
██
██ █
██ █
██ ██
██ █
██ █ █
██ ██
██ ███
███
███ █
███ █
███ ██
████
████ █
█████
██████
█
█ █
█ █
█ ██
█ █
█ █ █
█ ██
█ ███
█ █
█ █ █
█ █ █
█ █ ██
█ ██
█ ██ █
█ ███
█ ████
█ █
█ █ █
█ █ █
█ █ ██
█ █ █
█ █ █ █
█ █ ██
█ █ ███
█ ██
█ ██ █
█ ██ █
█ ██ ██
█ ███
█ ███ █
█ ████
█ █████
██
██ █
██ █
██ ██
██ █
██ █ █
██ ██
██ ███
██ █
██ █ █
██ █ █
██ █ ██
██ ██
██ ██ █
██ ███
██ ████
███
███ █
███ █
███ ██
███ █
███ █ █
███ ██
███ ███
████
████ █
████ █
████ ██
█████
█████ █
██████
███████
█
█ █
█ █
█ ██
█ █
█ █ █
█ ██
█ ███
█ █
█ █ █
█ █ █
█ █ ██
█ ██
█ ██ █
█ ███
█ ████
█ █
█ █ █
█ █ █
█ █ ██
█ █ █
█ █ █ █
█ █ ██
█ █ ███
█ ██
█ ██ █
█ ██ █
█ ██ ██
█ ███
█ ███ █
█ ████
█ █████
█ █
█ █ █
█ █ █
█ █ ██
█ █ █
█ █ █ █
█ █ ██
█ █ ███
█ █ █
█ █ █ █
█ █ █ █
█ █ █ ██
█ █ ██
█ █ ██ █
█ █ ███
█ █ ████
█ ██
█ ██ █
█ ██ █
█ ██ ██
█ ██ █
█ ██ █ █
█ ██ ██
█ ██ ███
█ ███
█ ███ █
█ ███ █
█ ███ ██
█ ████
█ ████ █
█ █████
█ ██████
██
██ █
██ █
██ ██
██ █
██ █ █
██ ██
██ ███
██ █
██ █ █
██ █ █
██ █ ██
██ ██
██ ██ █
██ ███
██ ████
██ █
██ █ █
██ █ █
██ █ ██
██ █ █
██ █ █ █
██ █ ██
██ █ ███
██ ██
██ ██ █
██ ██ █
██ ██ ██
██ ███
██ ███ █
██ ████
██ █████
███
███ █
███ █
███ ██
███ █
███ █ █
███ ██
███ ███
███ █
███ █ █
███ █ █
███ █ ██
███ ██
███ ██ █
███ ███
███ ████
████
████ █
████ █
████ ██
████ █
████ █ █
████ ██
████ ███
█████
█████ █
█████ █
█████ ██
██████
██████ █
███████
████████
█
█ █
█ █
█ ██
█ █
█ █ █
█ ██
█ ███
█ █
█ █ █
█ █ █
█ █ ██
█ ██
█ ██ █
█ ███
█ ████
█ █
█ █ █
█ █ █
█ █ ██
Last active
April 17, 2020 21:41
-
-
Save Jack5079/62465b106e0a3227bb7e5a76eedf0cc4 to your computer and use it in GitHub Desktop.
powershell binary counting
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
| param( | |
| [long]$CountTo = [long](Read-Host 'Number to count to'), | |
| [string]$Foreground = '█', | |
| [string]$Background = ' ', | |
| [decimal] $Interval = 1, | |
| [decimal] $DivideBy = 1.1 | |
| ) | |
| $padding = [convert]::ToString($CountTo, 2).Length | |
| $count = 0 | |
| Do { | |
| [convert]::ToString(++$count, 2).PadLeft($padding, ' ') -replace '0', $Background -replace '1', $Foreground | Write-Host | |
| Start-Sleep $Interval | |
| $Interval /= $DivideBy | |
| } while ($count -lt $CountTo) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment