## PowerShell, <s>199 175</s> (171 - 15%)=145.35 param([char[]]$a)($a|%{$b=[convert]::ToString(+$_,2);$c=[convert]::ToInt32("$((-join$b[$b.Length..0])-split0-replace1,0-join1)",2);if($c-gt31-or$c-eq10){[char]$c}})-join'' Uses <s>an unfortunate amount of</s> some .NET calls/built-ins, which <s>significantly</s> bloats the code. ### Explained: Takes the input `param(..)` and casts it as a `char[]` so we can work through it appropriately. The next bit `(..)-join''` collects and joins our output together. Inside those parens, we iterate with `$a|%{..}` as a foreach loop. Inside the loop: - We create a new string `$b`, which is our input letter cast as an int `+$_` and `[convert]`ed to base `2` - This next bit, setting `$c`, is tricky, so let's start inside and work our way out - We reverse the string `$b` with `(-join$b[$b.length..0])` - We leverage my previous code for [inverting a binary string](https://codegolf.stackexchange.com/a/58475/42963) and recast the result as a string with `"$(..)"` - We feed that string into a different .NET call that `[convert]`s `ToInt32` from base `2`, which is finally stored that into `$c` - If `$c` is greater than `31`, or equal to `10`, we cast it as a char and that value is left on the pipeline for output (which is what gets collected and `-join''`ed together, above), else nothing gets left on this particular iteration Phew. Qualifies for the -15% bonus, as well. ### Example PS C:\Tools\Scripts\golfing> .\reverse-and-invert-a-string.ps1 "Hello, World!" v,dd2> Xdl