Skip to content

Instantly share code, notes, and snippets.

@VisualMelon
Last active May 7, 2017 23:07
Show Gist options
  • Save VisualMelon/2721bf323dc82ccd568275a340717939 to your computer and use it in GitHub Desktop.
Save VisualMelon/2721bf323dc82ccd568275a340717939 to your computer and use it in GitHub Desktop.
Chris: Office Escape Testing
# Can used with test.ps1
# > . .\test.ps1 chrisstrap.ps1
# Expects perl (5) to be installed, and chris.pl to be in the current directory
#
# You can investigate issues by first writing the solution to a file...
# > type .\testcase0.txt | . .\chrisstrap.ps1 > chrissol0.txt
# ... and then feeding it to OfficeEscapeSolver.exe
# > type .\testcase0.txt | . .\OfficeEscapeSolver.exe * .\chrissol0.txt
# Which will (hopefully) provide helpful information
$s = ""
$c = 0
$input | % {
$s += $_;
if ($c -eq 0)
{
$s += "`n";
}
else
{
$s += ":";
}
$c = 1;
}
# ref: http://stackoverflow.com/a/16334189/383598
$s | & cmd /c 'perl chris.pl 2>&1'
@VisualMelon
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment