Comments (4)
Can I take this up. I already have written some code for this.
Check it out:
https://replit.com/@AbhiramMangipud/Caeser-Cipher
Btw, there are more program's available on my Replit. Ping me if you need anything, or else, use anything you want.
Here's a small preview of my code:
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
from 100linesofcode.
@K0MPLEXWorksTogether not 100% sure if I'm interpreting your message correctly,
but if you're asking me, if you can use my code for the caesar's cipher:
sure, go ahead.
The second I contributed it to this repo I considered it Open Source, so it's available to be used for everyone who finds it :)
from 100linesofcode.
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.
from 100linesofcode.
I think the owner of the repo isn't actively maintaining it anymore.
But you can still feel free to use my code, if you want to, np for me :)
from 100linesofcode.
Related Issues (20)
- Sudoku Solver in Python HOT 2
- A simple song downloader made with Python. HOT 1
- Turtle programs HOT 3
- Python TicTacToe HOT 5
- Repo gone cold - PR to me
- A Readme Generator HOT 3
- Multi-Unit Converter HOT 1
- Movie Ticket Manager using Java HOT 1
- WiFi DoS with MAC Spoofing attack Shell Script HOT 1
- Car advertisement brochure HOT 1
- Music player
- Add a bubble sort visualizer to PythonAlgoVisualizer HOT 1
- Add Program: Simple Random Number Generator HOT 1
- B HOT 1
- Bm
- Use requirements.txt for "Detect and Translate Languages" HOT 1
- Add Program: Fake Data Generator HOT 1
- Implement Machine Learning for House Price Prediction HOT 1
- Add program: color matcher HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 100linesofcode.