I'm trying to create a console function where you could type any sentence (so only string) and make a ROT13 rotation to that sentence. However, my level in C# is pretty low and I'm having some troubles with that...
I'll explain what I'm trying to do:
1/ Take the array made by the static void main.
2/ Try to convert the entered sentence (so arguments into char).
3/ Take each char and convert it into an integer (to get ASCII number).
4/ Add +13 or -13 depending on the letter to make the rotation.
5/ Put the int into char and assemble the char into a string.
6/ Output the sentence.
I'm blocking for step 2,3 and 5.
static void Main(char[] args)
{
for (int n = 0; n < args.Length; n++)
{
if (letter >= 'a' && letter <= 'z')
{
if (letter > 'm')
{
letter -= 13;
}
else
{
letter += 13;
}
}
}
Thanks in advance !

New Topic/Question
Reply



MultiQuote




|