-
Notifications
You must be signed in to change notification settings - Fork 319
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
Add Program: Simple Caesar Cipher En-/Decoder #365
Comments
Can I take this up. I already have written some code for this. import art
# Printing The Cool ASCII Art.
print(art.logo)
# Maintain A List Of ALl The English Alphabet.
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', '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']
def caesar(start_text, shift_amount, cipher_direction):
# Maintaining End Text.
end_text = ""
# Check For Direction Of Cipher.
if direction == "encode":
pass
elif direction == "decode":
shift_amount *= -1
else:
print("You have entered an invalid ciphering direction. Try again.")
return None
# Adding Elements To The Cipher Text.
for letter in start_text:
if letter in alphabet:
position = alphabet.index(letter)
new_position = (position + shift_amount) % 26
end_text += alphabet[new_position]
else:
end_text += letter
# Displaying Cipher Text.
print(f"The {cipher_direction}d text is: {end_text}")
# Game Loop.
goAgain = True
while(goAgain):
direction = input("Type 'encode' to encrypt, type 'decode' to decrypt:\n")
text = input("Type your message:\n").lower()
shift = int(input("Type the shift number:\n"))
caesar(start_text=text, shift_amount=shift, cipher_direction=direction)
another_try = input("Enter 'go' if you want to go again. Else enter 'stop'.\n")
if another_try == 'go':
pass
elif another_try == 'stop':
print("Goodbye Then!")
goAgain = False
else:
print("You have entered invalid choice. Stopping...")
goAgain = False |
@K0MPLEXWorksTogether not 100% sure if I'm interpreting your message correctly, |
I'm so sorry. I didn't know about you opening this issue, to get an approval for your pull request. I thought the issue was up for taking. |
I think the owner of the repo isn't actively maintaining it anymore. |
As requested in the CONTRIBUTING.md, I'm opening this issue to request a merge for my pull request for my branch "Simple Caesar Cipher En-/Decoder"
I created a little C++ program which encodes & decodes input text by a shit-modifier.
I also included a README.md file that explains how to works.
This Issue is regarding Pull Request #366 .
The text was updated successfully, but these errors were encountered: