Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

rotate my anus

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);
    }

Name: Elly_Tran_Ha !HfYItjXlBs 2010-11-29 14:49

//assuming you're not using negative numbers

int i = len; i>0; i--

//using negative numbers
int i=0; i>i-len; i--

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List