diff --git a/Bitmap Message (by AdyaTech)/bitmapmessage.py b/Bitmap Message (by AdyaTech)/bitmapmessage.py new file mode 100644 index 0000000..59961fa --- /dev/null +++ b/Bitmap Message (by AdyaTech)/bitmapmessage.py @@ -0,0 +1,47 @@ +import sys + +# (!) Try changing this multiline string to any image you like: + +# There are 68 periods along the top and bottom of this string: +# (You can also copy and paste this string from +# https://inventwithpython.com/bitmapworld.txt) +bitmap = """ +.................................................................... + ************** * *** ** * ****************************** + ********************* ** ** * * ****************************** * + ** ***************** ****************************** + ************* ** * **** ** ************** * + ********* ******* **************** * * + ******** *************************** * + * * **** *** *************** ****** ** * + **** * *************** *** *** * + ****** ************* ** ** * + ******** ************* * ** *** + ******** ******** * *** **** + ********* ****** * **** ** * ** + ********* ****** * * *** * * + ****** ***** ** ***** * + ***** **** * ******** + ***** **** ********* + **** ** ******* * + *** * * + ** * * +....................................................................""" + +print('Bitmap Message') +print('Enter the message to display with the bitmap.') +message = input('> ') +if message == '': + sys.exit() + +# Loop over each line in the bitmap: +for line in bitmap.splitlines(): + # Loop over each character in the line: + for i, bit in enumerate(line): + if bit == ' ': + # Print an empty space since there's a space in the bitmap: + print(' ', end='') + else: + # Print a character from the message: + print(message[i % len(message)], end='') + print() # Print a newline. diff --git a/Bitmap Message (by AdyaTech)/image.png b/Bitmap Message (by AdyaTech)/image.png new file mode 100644 index 0000000..dece146 Binary files /dev/null and b/Bitmap Message (by AdyaTech)/image.png differ