I am trying to convert a Python program into C#. I do not understand what is being done here.
def mrF(alg, times = 1):
if ((times % 2) == 0):
return alg
else:
if (alg == 'R'):
return "L'"
if (alg[0] == 'G'):
return alg
if (alg[-1] == "'"):
return alg[:-1]
elif (alg[-1] == '2'):
return alg
else:
return (alg + "'")
Is alg a string or a string array or a list?
alg[0] == 'G'withalg.startswith('G')would be more readable. And then there's the cryptic namesalgandmrF, and the fact that this function's purpose is opaque and yet it is uncommented...