RotX Rot = new RotX();PHP Code:
using System;
using System.Collections.Generic;
using System.Text;
class RotX
{
public String Rot(String Text, int Mod)
{
Char[] Rotten = Text.ToCharArray();
String Return = String.Empty;
foreach (Char Old in Rotten)
{
int Grandmother = (int)Old;
if (Grandmother == ' ')
{
Return += " ";
}
else if (Grandmother >= 'a' && Grandmother <= 'm')
{
Return += Convert.ToChar(Grandmother + Mod);
}
else if (Grandmother >= 'm' && Grandmother <= 'z')
{
Return += Convert.ToChar(Grandmother - Mod);
}
else if (Grandmother >= 'M' && Grandmother <= 'Z')
{
Return += Convert.ToChar(Grandmother - Mod);
}
else if (Grandmother >= 'A' && Grandmother <= 'M')
{
Return += Convert.ToChar(Grandmother + Mod);
}
}
return Return;
}
}
Rot.Rot(Text,Mod);
I coded this out of boredom, and I'm having a shitload of fun messing with this![]()
Results 1 to 8 of 8
Thread: Rot-X
Threaded View
- 11 Jan. 2011 09:57pm #1
Rot-X
Last edited by Bman; 11 Jan. 2011 at 10:03pm.