# Is it OK to ask how to revise a golfed function?

After reading through a few question on here I found out that asking questions about refining code golf code is not on topic. However in this case I'm not asking for the code to be golfed but re-ordered. I'll show the proposed question for clarity:

## Code to print an alphabet triangle

The following code is an anonymous function that returns a string of an alphabet triangle. See the following code golf question for clarity.

My answer uses the following code:

Func<int, int, string[], string> f = (n, i, s) =>
{
s = new string[i = 51];
for (; --i > 24;)
{
for (n = 65; i + n < 116;)
s[i] += (char)n++;

for (n = 50 - i + 64; n > 64;)
s[i] += (char)n--;

s[50 - i] = s[i];
}

return string.Join("\n", s);
};

Console.WriteLine(f(0, 0, new string[0]));


I would like to reduce the two inner loops into oneloop but cannot see an easy way to do that. How can I do this?

• I don't want to join CodeGolf to comment there. Try (n,i,s)=>{s=new string[51];for(i=0;i<26;){for(n=65;n-65<i;)s[i]+=(char)n++;for(;n>64;)s[i]+=(char)n--;s[50-i]=s[i++];}return string.Join("\n",s);}; If you do Z in the second loop, you don't need to initialize. – mdfst13 Aug 5 '16 at 15:52
• @mdfst13 Oh thanks! – TheLethalCoder Aug 5 '16 at 16:03
• I would think any golfed code would be too terribly formatted for good review. If it's non-golfed (like above) then I don't see why not. – Raystafarian Sep 1 '16 at 20:08