Skip to main content
8 events
when toggle format what by license comment
Jul 12, 2017 at 17:20 comment added helion3 @Heslacher Unfortunately this work is for a Unity project so I'm limited to 2.0 and some 3.5, that join method is 4.0+.
Jul 12, 2017 at 16:12 comment added Heslacher So just use msdn.microsoft.com/en-us/library/dd992421(v=vs.110).aspx
Jul 12, 2017 at 15:31 comment added helion3 Also, with string.Join(" -> ", Points);, it can't quite be that simple since Points isn't a string[]. I could iterate it and make a string array, but at that point it feels less beneficial over what I have.
Jul 12, 2017 at 15:19 comment added helion3 @Heslacher Thanks for input! Several of these changes I'll make! I'm unclear how walking the zeros is better. In order to find the overall shape like you suggest, I need cycle detection, but in order to know which path is truly the "exterior wall" I have to walk all paths and pick the longest. That's literally what I do now and it gives me the info I want. It's also more efficient. Given a square 10 tiles long, that's walking just under 40 "wall" tiles. If I also look at the interior zeros, I'd walk 64 extra tiles. That's roughly 150% more tiles to look at.
Jul 12, 2017 at 6:22 comment added downrep_nation ;) get the new compiler then! its beautiful and still compiles to the same .NET version
Jul 12, 2017 at 6:21 comment added Heslacher correct, but since I am still < C# 6 I am just used to string.Format
Jul 12, 2017 at 6:19 comment added downrep_nation return string.Format("{{{0},{1}}}", x, y); can be replaced with return $"{{{x}}},{{{y}}}"; as an expression based body: public override string ToString() => $"{{{x}}},{{{y}}}";
Jul 12, 2017 at 5:31 history answered Heslacher CC BY-SA 3.0