Scripting Games, Sudden Death Challenge 4

Very Straightforward, the key piece is the [char][int] cast.

$n=Get-Content 'c:\scripts\numbers.txt'
0..($n.length/2-1)|%{$s=""}{$s+=[char][int]($n.substring($_*2,2))}{$s}

Just index along the string of digits, converting pairs to the equivalent character

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s