Rot13 in Beef

Published on 22 January 2024 (Updated: 22 January 2024)

Welcome to the Rot13 in Beef page! Here, you'll find the source code for this program as well as a description of how the program works.

Current Solution

using System;

namespace Rot13;

class Program
{
    public static void Usage()
    {
        Console.WriteLine("Usage: please provide a string to encrypt");
        Environment.Exit(0);
    }

    public static void Rot13(StringView str, ref String result)
    {
        result.Clear();
        result.Reserve(str.Length);
        for (char8 ch in str)
        {
            char8 chLower = ch.ToLower;
            if (chLower >= 'a' && chLower <= 'm')
            {
                ch += 13;
            }
            else if (chLower >= 'n' && chLower <= 'z')
            {
                ch -= 13;
            }

            result += ch;
        }
    }

    public static int Main(String[] args)
    {
        if (args.Count < 1 || args[0].Length < 1)
        {
            Usage();
        }

        String result = scope String();
        Rot13(args[0], ref result);
        Console.WriteLine(result);
        return 0;
    }
}

Rot13 in Beef was written by:

If you see anything you'd like to change or update, please consider contributing.

How to Implement the Solution

No 'How to Implement the Solution' section available. Please consider contributing.

How to Run the Solution

No 'How to Run the Solution' section available. Please consider contributing.