Timeline for Ice Golf Challenge
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 17, 2020 at 9:04 | history | edited | CommunityBot | Commonmark migration | |
| Apr 19, 2018 at 13:57 | comment | added | Kevin Cruijssen | Thanks for the TIO link. The code I provided above didn't work, so I fixed it, and golfed three more bytes. Try it online 415 bytes. (You'll have to re-add your huge test case again from your current TIO. I couldn't paste the link in this comment because the link was too big with that test case.. ;p) | |
| Apr 19, 2018 at 9:37 | history | edited | Manfred Radlwimmer | CC BY-SA 3.0 | added 60 characters in body |
| Apr 19, 2018 at 9:25 | history | edited | Manfred Radlwimmer | CC BY-SA 3.0 | added 8091 characters in body |
| Apr 19, 2018 at 9:17 | comment | added | Kevin Cruijssen | Golfed a bit more: int P(string[]C){int w=C[0].Length,i=0,l=c.Length;var c=string.Join("",C);var h=new int[l];for(var n=new List<int>();i<l;n.Add(i++))h[i]=c[i]!='@'?int.MaxValue:0;for(i=1;;i++){var t=n;n=new List<int>();foreach(int x in t){foreach(int d in new[]{-1,1,-w,w}){for(int j=x+d;c[j]==' ';j+=d);if(c[j]=='#'&h[j-d]>s){h[j-d]=s;n.Add(j-d);}if(c[j]=='.'&h[j]>s){h[j]=s;n.Add(j);}if(c[j]=='o')return s;}}if(n.Count<1)return -1;}} (418 bytes). Also, could you perhaps add a TIO-link with test code? | |
| Apr 19, 2018 at 8:43 | history | answered | Manfred Radlwimmer | CC BY-SA 3.0 |