Making a constructed language translator.

Hi,

I am an absolute beginner at coding, and am in way over my head.

I have created a conlang which is a pretty basic substitution cipher, with some extra rules, such as no double letters in the translated word - for example, removing the second "t" in "letter".

I found a translator for a conlang on the internet, that does pretty much the same thing, but with different additional rules - if the translated word ends in "e" a "h" is added to the end of the word, for example.

The source code was available for download, so I figured it'd be pretty simple to just swap out the cipher for my own, and remove/edit the extra rules.

I was wrong.

I finally found the cipher, and that is easy enough to change. What I'm struggling with is the extra rules. I have zero knowledge of programming, I am afraid. To be honest, I'm not entirely sure I've identified the right language. .CS files are C++, right?

Anyways, if anyone would be interested in helping me, I would greatly appreciate it.

Thank you for your time.
.CS files are C# (C Sharp) files, which you can code in with Visual Studio
Does this mean I am in completely the wrong forum? I apologise.
Possibly. You never said what your end goal was with the file or what language you wanted it in.
Basically, I want to replace the cipher with my own ( so instead of A = U, which it is at the moment, A should = O, etc) and change the additional language rules - so instead of adding a H to the end of words ending in E, it removes duplicate letters, and so on.

I can swap the cipher out myself no problem, I found where that's stored. It's the extra rules that I don't know how to alter.

Then once that's done, I need to take all these folders and files, and stuff them into an .exe file, which will run the translator once double-clicked.
If you list the rules/show some code I am sure we could try and help even though it is in C#, or we could help with creating a c++ alternative. Otherwise you could always try a C# forum. It's kind of hard to tell with too much information other than it being a basic substitution cipher with extra rules such as removing duplicated letters (tt, dd, ect..) and that A should = 0.

Is this what you are trying to accomplish?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Example program
#include <iostream>
#include <string>
#include <cctype>

int main()
{
    std::string alphabet = "ORANGEBCDFHIJKLMPQSTUVWXYZ";
    
    std::string input = "";
    std::cout << "Please enter a sentence to be encrypted: ";
    std::getline(std::cin, input);
    
    std::cout << "Before: " << input << '\n';
    std::string output = "";
    char previous = '\0';
    
    for(char ch : input)
    {
        ch = toupper(ch);
        if(isalpha(ch) && ch != previous)
        {
            output += alphabet[ch - 'A'];
        }
        previous = ch;
    }
    
    std::cout << "After: " << output << std::endl;
    
    return 0;
}
Please enter a sentence to be encrypted: HeLlo, WoRLd!
Before: HeLlo, WoRLd!
After: CGILWLQIN
Topic archived. No new replies allowed.