Skip to content

added english to standard galactic alphabet translator #263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Galactic-Alphabet-Translator/README.md
Original file line number Diff line number Diff line change
@@ -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 <directory containing main.py>

# prompts user for sentence in English and returns translated sentence
python main.py
```
23 changes: 23 additions & 0 deletions Galactic-Alphabet-Translator/main.py
Original file line number Diff line number Diff line change
@@ -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)