Name: Anonymous 2010-11-29 14:45
sup /prog/, I wrote this in c#, and it seems that I'm too stupid to reverse this to write a rotate right algorithm. can you halp?
/// <summary>
/// rotates the chars in a string to the left p times
/// </summary>
/// <param name="v">value to rotate</param>
/// <param name="len">value length</param>
/// <param name="p">places to rotate</param>
/// <returns></returns>
static string rotl(string v, int len, int p)
{
char[] o = new char[len];
for (int i = 0; i < len; i++)
{
o[i] = v[(i + p) % len];
}
return new string(o);
}