Timeline for answer to Island Golf #1: Circumnavigation by Not a tree
Current License: CC BY-SA 3.0
Post Revisions
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 28, 2017 at 1:08 | comment | added | Not a tree | @DLosc Well, that's because the code's broken. I think I've fixed it now, though! (I've got no idea what happened there; sorry…) | |
| Mar 28, 2017 at 1:03 | history | edited | Not a tree | CC BY-SA 3.0 |
The code should actually work now. (Also it's a byte shorter.)
|
| Mar 24, 2017 at 8:56 | comment | added | Not a tree |
@DLosc, The function is the whole thing, not just f. (Well, strictly speaking it's the stuff after the semicolon.) To call the function, type the entire thing into a Mathematica window, followed by [, your input, and ], so it should look something like f@m_:=m(1-m[[2,2]]) . . . #/.{"."->0,"#"->1}]&[{"...", ".#.", "..."}] (abridged for space).
|
|
| Mar 23, 2017 at 6:41 | comment | added | Not a tree |
@GregMartin, I didn't know about that use of MorphologicalComponents either until today!
|
|
| Mar 23, 2017 at 6:39 | history | edited | Not a tree | CC BY-SA 3.0 |
Using different input and output formats cuts out 21 bytes
|
| Mar 23, 2017 at 5:50 | comment | added | Greg Martin |
Nicely done! I never knew about MorphologicalComponents[#, Method->"ConvexHull"] :) You can save even more bytes by assuming that the input is already split into characters, and by returning a 2D array of characters as well.
|
|
| Mar 23, 2017 at 5:31 | history | answered | Not a tree | CC BY-SA 3.0 |