# FOR Mini Project — Caesar Cipher
# for loop + enumerate() + modulo — encrypt like Caesar

# ─────────────────────────────────────────────
# The alphabet
# ─────────────────────────────────────────────

alphabet = "abcdefghijklmnopqrstuvwxyz"

# ─────────────────────────────────────────────
# Caesar Cipher
# ─────────────────────────────────────────────

shift = int(input("Enter shift number: "))

for index, letter in enumerate(alphabet):
    shifted_index = (index + shift) % 26
    shifted_letter = alphabet[shifted_index]
    print(f"{letter} -> {shifted_letter}")

# ─────────────────────────────────────────────
# Test it
# ─────────────────────────────────────────────

# Enter shift number: 3
# a -> d
# b -> e
# c -> f
# ...
# x -> a
# y -> b
# z -> c

# ─────────────────────────────────────────────
# What's really happening
# ─────────────────────────────────────────────

# enumerate() gives position and letter at the same time
# (index + shift) % 26 shifts forward and wraps around
#
# shift = 3
# a (0)  -> d (3)
# x (23) -> a (0)   — wraps around
# z (25) -> c (2)   — wraps around

# ─────────────────────────────────────────────
# Go further
# ─────────────────────────────────────────────

# Try shift 13  — ROT13, a famous internet cipher
# Try shift 26  — what happens? Why?
# Try a negative shift — does it work?
