Share via


One-Liner: PowerShell Pi Mnemonic

I love this. I came across it when looking into how to calculate Pi with PowerShell.

 

 
"$('How I wish I could calculate Pi better'.split(' ') | % {$_.length})"

 

 

I've tweaked it ever so slightly.

 

 
$('How I wish I could calculate Pi better' -Split " " | % {[string]$a += $_.length}; $a.Insert(1,"."))

 

Comments

  • Anonymous
    July 14, 2017
    Well found! :-D