diff --git a/#936_ASCII_ART_GENERATOR/ascii_art_generator.py b/#936_ASCII_ART_GENERATOR/ascii_art_generator.py new file mode 100644 index 00000000..ee1a3dae --- /dev/null +++ b/#936_ASCII_ART_GENERATOR/ascii_art_generator.py @@ -0,0 +1,74 @@ +# ascii_art_generator.py +# Renders any text as large ASCII block letters +# Author: Your Name + +LETTERS = { + '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 render_ascii_art(text: str) -> str: + """Convert a string to large ASCII block letters.""" + text = text.upper() + + # Each letter has 5 rows + rows = ["", "", "", "", ""] + + for char in text: + if char in LETTERS: + letter_rows = LETTERS[char] + else: + letter_rows = ["?????"] * 5 # Unsupported character + + for i in range(5): + rows[i] += letter_rows[i] + " " # Add spacing between letters + + return "\n".join(rows) + +def main(): + print("=" * 50) + print(" 🎨 ASCII Art Text Generator") + print(" Type your text below (letters only)") + print(" Type 'quit' to exit") + print("=" * 50) + + while True: + user_input = input("\nEnter text: ").strip() + + if user_input.lower() == 'quit': + print("Thanks for using ASCII Art Generator! 👋") + break + + if not user_input: + print("⚠️ Please enter some text.") + continue + + print("\n" + render_ascii_art(user_input) + "\n") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index a8c20032..5e2631db 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,4 @@ { - "python-envs.defaultEnvManager": "ms-python.python:conda", "python-envs.defaultPackageManager": "ms-python.python:conda", "python-envs.pythonProjects": [] } \ No newline at end of file diff --git a/README.md b/README.md index e1b74d0a..2d56a768 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 🌟 Fork & Star ⭐ the Repository to Show Your Support! + # 🌟 Fork & Star ⭐ the Repository to Show Your Support! Welcome to our project! We're excited to have you here. Below are some guidelines and information to help you contribute effectively.