Compare commits
2
Commits
27952755d3
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16cdc0b08b | ||
|
|
c89da47d2a |
@@ -1,76 +1,78 @@
|
|||||||
# 🔐 Caesar Cipher
|
# 🔐 Caesar Cipher
|
||||||
|
|
||||||
A beginner-friendly Python program that encodes and decodes messages with the Caesar cipher.
|
A beginner-friendly Python program that encodes and decodes messages with the Caesar cipher.
|
||||||
|
|
||||||
## 📚 Table of Contents
|
## 📚 Table of Contents
|
||||||
|
|
||||||
- [Overview](#-overview)
|
- [Overview](#-overview)
|
||||||
- [Requirements](#-requirements)
|
- [Requirements](#-requirements)
|
||||||
- [Setup](#-setup)
|
- [Setup](#-setup)
|
||||||
- [Run](#-run)
|
- [Run](#-run)
|
||||||
- [Tests](#-tests)
|
- [Tests](#-tests)
|
||||||
- [License](#-license)
|
- [License](#-license)
|
||||||
- [Links](#-links)
|
- [Links](#-links)
|
||||||
|
|
||||||
## 🧭 Overview
|
## 🧭 Overview
|
||||||
|
|
||||||
The Caesar cipher shifts every letter by a fixed number of places (with a shift of 3, `E` becomes `H`). This project, from Udemy's *100 Days of Code: The Complete Python Pro Bootcamp* (Day 8), finds letter positions with `list.index` and wraps around the alphabet with the modulo operator. The interactive program lets you encode or decode as many messages as you like. Code lives in `src/`, tests in `tests/`, docs in `docs/`.
|
The Caesar cipher shifts every letter by a fixed number of places (with a shift of 3, `E` becomes `H`). This project, from Udemy's *100 Days of Code: The Complete Python Pro Bootcamp* (Day 8), finds letter positions with `list.index` and wraps around the alphabet with the modulo operator. The interactive program lets you encode or decode as many messages as you like. Code lives in `src/`, tests in `tests/`, docs in `docs/`.
|
||||||
|
|
||||||
## 📋 Requirements
|
## 📋 Requirements
|
||||||
|
|
||||||
- Python 3.13 or newer
|
- Python 3.13 or newer
|
||||||
- `pytest` (development only; no runtime dependencies)
|
- `pytest` (development only; no runtime dependencies)
|
||||||
- Optional: [Doxygen](https://www.doxygen.nl/) to build the API docs
|
- Optional: [Doxygen](https://www.doxygen.nl/) to build the API docs
|
||||||
|
|
||||||
## 🛠️ Setup
|
## 🛠️ Setup
|
||||||
|
|
||||||
Create and activate a local virtual environment, then upgrade pip and install the project:
|
Create and activate a local virtual environment, then upgrade pip and install the project:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python -m venv .venv
|
python -m venv .venv
|
||||||
```
|
```
|
||||||
|
|
||||||
Activate it:
|
Activate it:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Linux / macOS
|
# Linux / macOS
|
||||||
source .venv/bin/activate
|
source .venv/bin/activate
|
||||||
# Git Bash on Windows
|
# Git Bash on Windows
|
||||||
source .venv/Scripts/activate
|
source .venv/Scripts/activate
|
||||||
```
|
```
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
# Windows PowerShell
|
# Windows PowerShell
|
||||||
.venv\Scripts\Activate.ps1
|
.venv\Scripts\Activate.ps1
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
python -m pip install -e ".[dev]"
|
python -m pip install -e ".[dev]"
|
||||||
```
|
```
|
||||||
|
|
||||||
## ▶️ Run
|
## ▶️ Run
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python -m caesar_cipher
|
python -m caesar_cipher
|
||||||
```
|
```
|
||||||
|
|
||||||
or, after installation, `caesar-cipher`.
|
or, after installation, `caesar-cipher`.
|
||||||
|
|
||||||
## 🧪 Tests
|

|
||||||
|
|
||||||
```bash
|
## 🧪 Tests
|
||||||
python -m pytest
|
|
||||||
```
|
```bash
|
||||||
|
python -m pytest
|
||||||
Build the API docs with `doxygen Doxyfile` (output in `docs/doxygen/html`).
|
```
|
||||||
|
|
||||||
## 📄 License
|
Build the API docs with `doxygen Doxyfile` (output in `docs/doxygen/html`).
|
||||||
|
|
||||||
GNU AGPL-3.0 – see [LICENSE](LICENSE).
|
## 📄 License
|
||||||
|
|
||||||
## 🔗 Links
|
GNU AGPL-3.0 – see [LICENSE](LICENSE).
|
||||||
|
|
||||||
- [Repository](https://git.tirsystem.com/Tirsvad-Udemy-100_days_of_code)
|
## 🔗 Links
|
||||||
- [Documentation](docs/index.md)
|
|
||||||
- [Issue tracker](https://git.tirsystem.com/Tirsvad-Udemy-100_days_of_code/008-caesar_cipher/issues)
|
- [Repository](https://git.tirsystem.com/Tirsvad-Udemy-100_days_of_code)
|
||||||
|
- [Documentation](docs/index.md)
|
||||||
|
- [Issue tracker](https://git.tirsystem.com/Tirsvad-Udemy-100_days_of_code/008-caesar_cipher/issues)
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="760" height="700" viewBox="0 0 760 700">
|
||||||
|
<rect width="760" height="700" rx="8" fill="#0d1117"/>
|
||||||
|
<circle cx="22" cy="20" r="6" fill="#ff5f56"/><circle cx="42" cy="20" r="6" fill="#ffbd2e"/><circle cx="62" cy="20" r="6" fill="#27c93f"/>
|
||||||
|
<g font-family="Consolas,Menlo,monospace" font-size="14" xml:space="preserve">
|
||||||
|
<text x="20" y="50" fill="#56d4dd"> ____ _ _____ ____ _ ____</text>
|
||||||
|
<text x="20" y="70" fill="#56d4dd"> / ___| / \ | ____/ ___| / \ | _ \</text>
|
||||||
|
<text x="20" y="90" fill="#56d4dd">| | / _ \ | _| \___ \ / _ \ | |_) |</text>
|
||||||
|
<text x="20" y="110" fill="#56d4dd">| |___ / ___ \| |___ ___) / ___ \| _ <</text>
|
||||||
|
<text x="20" y="130" fill="#56d4dd"> \____/_/ \_\_____|____/_/ \_\_| \_\</text>
|
||||||
|
<text x="20" y="150" fill="#56d4dd"> ____ ___ ____ _ _ _____ ____</text>
|
||||||
|
<text x="20" y="170" fill="#56d4dd"> / ___|_ _| _ \| | | | ____| _ \</text>
|
||||||
|
<text x="20" y="190" fill="#56d4dd">| | | || |_) | |_| | _| | |_) |</text>
|
||||||
|
<text x="20" y="210" fill="#56d4dd">| |___ | || __/| _ | |___| _ <</text>
|
||||||
|
<text x="20" y="230" fill="#56d4dd"> \____|___|_| |_| |_|_____|_| \_\</text>
|
||||||
|
<text x="20" y="250" fill="#f0c674"></text>
|
||||||
|
<text x="20" y="270" fill="#c9d1d9">Type 'encode' to encrypt, type 'decode' to decrypt:</text>
|
||||||
|
<text x="20" y="290" fill="#7ee787">encode</text>
|
||||||
|
<text x="20" y="310" fill="#c9d1d9">Type your message:</text>
|
||||||
|
<text x="20" y="330" fill="#7ee787">Hello, World!</text>
|
||||||
|
<text x="20" y="350" fill="#c9d1d9">Type the shift number:</text>
|
||||||
|
<text x="20" y="370" fill="#7ee787">3</text>
|
||||||
|
<text x="20" y="390" fill="#f0c674">Here's the encoded result: Khoor, Zruog!</text>
|
||||||
|
<text x="20" y="410" fill="#c9d1d9">Type 'yes' if you want to go again. Otherwise type 'no'.</text>
|
||||||
|
<text x="20" y="430" fill="#7ee787">yes</text>
|
||||||
|
<text x="20" y="450" fill="#c9d1d9">Type 'encode' to encrypt, type 'decode' to decrypt:</text>
|
||||||
|
<text x="20" y="470" fill="#7ee787">decode</text>
|
||||||
|
<text x="20" y="490" fill="#c9d1d9">Type your message:</text>
|
||||||
|
<text x="20" y="510" fill="#7ee787">Khoor, Zruog!</text>
|
||||||
|
<text x="20" y="530" fill="#c9d1d9">Type the shift number:</text>
|
||||||
|
<text x="20" y="550" fill="#7ee787">3</text>
|
||||||
|
<text x="20" y="570" fill="#f0c674">Here's the decoded result: Hello, World!</text>
|
||||||
|
<text x="20" y="590" fill="#c9d1d9">Type 'yes' if you want to go again. Otherwise type 'no'.</text>
|
||||||
|
<text x="20" y="610" fill="#7ee787">no</text>
|
||||||
|
<text x="20" y="630" fill="#f0c674">Goodbye</text>
|
||||||
|
</g></svg>
|
||||||
|
After Width: | Height: | Size: 2.5 KiB |
Reference in New Issue
Block a user