Created
July 2, 2014 12:44
-
-
Save m-ender/dcb1e5efcc1a03c2b83f to your computer and use it in GitHub Desktop.
I'm using this Mathematica snippet to generate tie breaker tracks based on the given tie-breaker. I sometimes need to add or remove a few more rows/columns to/from the boundary to ensure square sizes. Otherwise the track is used as is.
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
res = 290; | |
Riffle[ | |
(*remove road cells around the border*) | |
(Drop[#, 4]) & /@ (Drop[#, -4] &) /@ Most@Rest@ | |
ImageData[ | |
Binarize@Rasterize[ | |
Import["path\\to\\tie-breaker.pdf"], | |
ImageSize -> res + 8 | |
] | |
] /. {0 -> "#", 1 -> "."}, | |
"\n"] <> "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment