Made an epic showcase website and API!

This commit is contained in:
rzmk 2021-08-17 16:39:42 -04:00
parent 9e21e4dbdd
commit 1907fad7c5
89 changed files with 36444 additions and 3 deletions

17
projects/Day 8/art.py Normal file
View file

@ -0,0 +1,17 @@
logo = """
,adPPYba, ,adPPYYba, ,adPPYba, ,adPPYba, ,adPPYYba, 8b,dPPYba,
a8" "" "" `Y8 a8P_____88 I8[ "" "" `Y8 88P' "Y8
8b ,adPPPPP88 8PP""""""" `"Y8ba, ,adPPPPP88 88
"8a, ,aa 88, ,88 "8b, ,aa aa ]8I 88, ,88 88
`"Ybbd8"' `"8bbdP"Y8 `"Ybbd8"' `"YbbdP"' `"8bbdP"Y8 88
88 88
"" 88
88
,adPPYba, 88 8b,dPPYba, 88,dPPYba, ,adPPYba, 8b,dPPYba,
a8" "" 88 88P' "8a 88P' "8a a8P_____88 88P' "Y8
8b 88 88 d8 88 88 8PP""""""" 88
"8a, ,aa 88 88b, ,a8" 88 88 "8b, ,aa 88
`"Ybbd8"' 88 88`YbbdP"' 88 88 `"Ybbd8"' 88
88
88
"""

33
projects/Day 8/main.py Normal file
View file

@ -0,0 +1,33 @@
import art
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']
def caesar(text, shift, direction):
final_text = ""
for letter in text:
if letter in alphabet:
letter_index = alphabet.index(letter)
if direction == "encode":
letter_index += shift
if letter_index >= 26:
letter_index -= 26
elif direction == "decode":
letter_index -= shift
final_text += alphabet[letter_index]
else:
final_text += letter
print(f"Here's the result: {final_text}")
def cipher():
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(text, shift, direction)
restart = input("Type 'yes' if you want to go again. Otherwise type 'no'.\n")
if restart == "yes":
cipher()
else:
return
print(art.logo)
cipher()