Last active
August 30, 2019 23:18
-
-
Save JamesTryand/370f4b1b0a8bc6f78d65ebdf2be0b2db to your computer and use it in GitHub Desktop.
This file contains 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
1..9| %{$sb = [text.stringbuilder]::new()}{ [void]$sb.Append($_); "$([string]::Join('',[linq.enumerable]::Repeat(' ',9 - $_)))$($sb.ToString()) x 8 + $_ = $([int]$sb.ToString() * 8 + $_)" } | |
# for the correct coloring use | |
1..9| %{$sb = [text.stringbuilder]::new()}{ [void]$sb.Append($_);$ws = [string]::Join('',[linq.enumerable]::Repeat(' ',9 - $_)); "$($ws)$($sb.ToString()) x 8 + $_ = $([int]$sb.ToString() * 8 + $_)$($ws)" } | %{ write-host $_.substring(0,12) -b white -f black -NoNewline ; write-host $_.substring(12,1) -b white -f red -NoNewline ; write-host $_.substring(13) -b white -f black } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment