diff --git a/Galactic-Alphabet-Translator/README.md b/Galactic-Alphabet-Translator/README.md new file mode 100644 index 00000000..b121294c --- /dev/null +++ b/Galactic-Alphabet-Translator/README.md @@ -0,0 +1,13 @@ +# Standard Galactic Alphabet Translator + +The Standard Galactic Alphabet (SGA) was created by Tom Hall for Commander Keen. It also appears in Minecraft as the Enchanting Table Language + +## Usage +Download main.py +```bash +# navigate to the directory containing main.py +cd + +# prompts user for sentence in English and returns translated sentence +python main.py +``` \ No newline at end of file diff --git a/Galactic-Alphabet-Translator/main.py b/Galactic-Alphabet-Translator/main.py new file mode 100644 index 00000000..dfe275da --- /dev/null +++ b/Galactic-Alphabet-Translator/main.py @@ -0,0 +1,23 @@ +# Dictionary mapping English letters to Galactic Alphabet +galactic_alphabet = { + 'a': 'ᔑ', 'b': 'ʖ', 'c': 'ᓵ', 'd': '↸', 'e': 'ᒷ', 'f': '⎓', 'g': '⊣', 'h': '⍑', 'i': '╎', 'j': '⋮', + 'k': 'ꖌ', 'l': 'ꖎ', 'm': 'ᒲ', 'n': 'リ', 'o': '𝙹', 'p': '!¡', 'q': 'ᑑ', 'r': '∷', 's': 'ᓭ', 't': 'ℸ', + 'u': '⚍', 'v': '⍊', 'w': '∴', 'x': ' ̇/', 'y': '||', 'z': '⨅', ' ': ' ' +} + +# Function to convert English to Galactic alphabet +def convert_to_galactic(sentence): + galactic_sentence = "" + for char in sentence.lower(): + if char in galactic_alphabet: + galactic_sentence += galactic_alphabet[char] + else: + galactic_sentence += char # Keep non-alphabet characters like punctuation unchanged + return galactic_sentence + +# Get user input +english_sentence = input("Enter a sentence in English: ") + +# Output the converted sentence +galactic_sentence = convert_to_galactic(english_sentence) +print("Sentence in Galactic Alphabet:", galactic_sentence)