From db75a84f35184973dbcd642692671339edba9fa1 Mon Sep 17 00:00:00 2001 From: Nick Chambers Date: Wed, 12 Oct 2022 21:37:40 -0500 Subject: [PATCH] Implement a bitmap template generator --- solution-3.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 solution-3.py diff --git a/solution-3.py b/solution-3.py new file mode 100644 index 0000000..b05affb --- /dev/null +++ b/solution-3.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 + +phrase = input(f"Phrase: ") + +bitmap = [ + "....................................................................", + " ************** * *** ** * ******************************", + " ********************* ** ** * * ****************************** *", + " ** ***************** ******************************", + " ************* ** * **** ** ************** *", + " ********* ******* **************** * *", + " ******** *************************** *", + " * * **** *** *************** ****** ** *", + " **** * *************** *** *** *", + " ****** ************* ** ** *", + " ******** ************* * ** ***", + " ******** ******** * *** ****", + " ********* ****** * **** ** * **", + " ********* ****** * * *** * *", + " ****** ***** ** ***** *", + " ***** **** * ********", + " ***** **** *********", + " **** ** ******* *", + " *** * *", + " ** * *", + "...................................................................." +] + +for line in bitmap: + new_line = "" + + for idx, point in enumerate(line): + if point == " ": + new_line += " " + else: + new_line += phrase[idx % len(phrase)] + + print(new_line)