2024-12-18 13:06:15 +00:00
|
|
|
#include <iostream>
|
|
|
|
#include <sstream>
|
|
|
|
#include "Errorseal.h"
|
2024-12-18 16:26:30 +00:00
|
|
|
#include "translator.h"
|
2024-12-18 13:06:15 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Coder: TheSkyWinds
|
|
|
|
* Translator: MewTheNekomata
|
|
|
|
*
|
|
|
|
* Created: 12/16/24.
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Mew's translations:
|
2024-12-18 15:48:11 +00:00
|
|
|
// A=; B=x C=* D=x E=& F=( G=x H=) I=[ J=x K=x L=| M=x N=/ O=? P=+ Q=x R=] S={ T=} U=. V=x W=- X=x Y=x Z=x
|
2024-12-18 13:06:15 +00:00
|
|
|
|
|
|
|
// Sky's translations:
|
2024-12-18 15:48:11 +00:00
|
|
|
// A=; B=@ C=* D=< E=& F=( G=" H=) I=[ J=x K=x L=| M=x N=/ O=? P=+ Q=x R=] S={ T=} U=. V=x W=- X=x Y=x Z=x
|
2024-12-18 13:06:15 +00:00
|
|
|
|
2024-12-20 13:20:26 +00:00
|
|
|
int usrOption() {
|
|
|
|
int option{0};
|
|
|
|
bool finished{false};
|
2024-12-18 13:06:15 +00:00
|
|
|
|
2024-12-20 13:20:26 +00:00
|
|
|
do {
|
|
|
|
std::cout << "Enter 1. Translate from Astral" << '\n';
|
|
|
|
std::cout << "Enter 2. Translate to Astral" << '\n';
|
|
|
|
std::cout << "Enter 3. Exit the program" << '\n';
|
|
|
|
std::cout << "Prompt: ";
|
|
|
|
|
|
|
|
std::cin >> option;
|
|
|
|
|
|
|
|
if (option > 3 || error::cinError()) {
|
|
|
|
std::cout << "Unrecognised option." << '\n' << std::endl;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
finished = true;
|
|
|
|
} while (finished != true);
|
|
|
|
error::ignoreLine();
|
|
|
|
return option;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string usrInput(int option) {
|
2024-12-18 13:06:15 +00:00
|
|
|
std::string input{};
|
|
|
|
|
2024-12-20 13:20:26 +00:00
|
|
|
if (option == 1) {
|
|
|
|
std::cout << "Enter the untranslated text: ";
|
|
|
|
std::getline(std::cin, input);
|
|
|
|
}
|
|
|
|
else if (option == 2) {
|
|
|
|
std::cout << "Enter the text to translate: ";
|
|
|
|
std::getline(std::cin, input);
|
|
|
|
}
|
|
|
|
|
2024-12-18 13:06:15 +00:00
|
|
|
|
|
|
|
error::cinErrorVerbose();
|
|
|
|
|
|
|
|
return input;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
std::string untranslatedText{};
|
2024-12-20 13:20:26 +00:00
|
|
|
int option{};
|
2024-12-18 13:06:15 +00:00
|
|
|
|
2024-12-20 13:20:26 +00:00
|
|
|
do {
|
|
|
|
option = {usrOption()};
|
|
|
|
untranslatedText = {usrInput(option)};
|
2024-12-18 13:06:15 +00:00
|
|
|
|
2024-12-20 13:20:26 +00:00
|
|
|
if (option == 1)
|
|
|
|
std::cout << "Translation: " << translation::translateFromAstral(untranslatedText) << std::endl;
|
|
|
|
if (option == 2)
|
|
|
|
std::cout << "Translation: " << translation::translateToAstral(untranslatedText) << std::endl;
|
|
|
|
} while (option != 3);
|
|
|
|
return 0;
|
2024-12-18 13:06:15 +00:00
|
|
|
}
|