|
@ -22,38 +22,47 @@ def roo_say(message): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def print_message(message): |
|
|
def print_message(message): |
|
|
print_list, max_len = convert_to_list(message) |
|
|
|
|
|
|
|
|
print_list, max_len= convert_to_list(message) |
|
|
|
|
|
|
|
|
if len(print_list) > 0: |
|
|
if len(print_list) > 0: |
|
|
"""Print top""" |
|
|
|
|
|
print(" " + "-" * (max_len + 2)) |
|
|
|
|
|
|
|
|
"Print top" |
|
|
|
|
|
print(" " + "-" * (2 + max_len)) |
|
|
|
|
|
|
|
|
"print middle" |
|
|
"print middle" |
|
|
if len(print_list) == 1: |
|
|
if len(print_list) == 1: |
|
|
print("< " + print_list[0] + " >") |
|
|
print("< " + print_list[0] + " >") |
|
|
else: |
|
|
else: |
|
|
for i in range(0) |
|
|
|
|
|
|
|
|
for i in range(0, len(print_list)): |
|
|
|
|
|
if i == 0: |
|
|
|
|
|
print("/ " + print_list[i] + " " * (max_len - len(print_list[i])) +" \\") |
|
|
|
|
|
elif i == len(print_list) -1: |
|
|
|
|
|
print("\ " + print_list[i] + " " * (max_len - len(print_list[i])) + " /") |
|
|
|
|
|
else: |
|
|
|
|
|
print("| " + print_list[i] + " " * (max_len - len(print_list[i])) + " |") |
|
|
|
|
|
"print bottom" |
|
|
|
|
|
print(" " + "-" * (max_len + 2)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else: |
|
|
else: |
|
|
print("Please pass in a message parameter") |
|
|
print("Please pass in a message parameter") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def convert_to_list(message): |
|
|
def convert_to_list(message): |
|
|
temp_build = "" |
|
|
temp_build = "" |
|
|
temp_return = [] |
|
|
temp_return = [] |
|
|
max_len = 0 |
|
|
max_len = 0 |
|
|
for word in message.split(" "): |
|
|
for word in message.split(" "): |
|
|
if len(temp_build) + len(word) <= 35: |
|
|
|
|
|
|
|
|
if len(temp_build) + len(word) < 35: |
|
|
|
|
|
if len(temp_build) > 0: |
|
|
|
|
|
temp_build += " " |
|
|
temp_build += word |
|
|
temp_build += word |
|
|
else: |
|
|
|
|
|
temp_return.append(temp_build) |
|
|
|
|
|
if max_len < len(temp_build): |
|
|
if max_len < len(temp_build): |
|
|
max_len = len(temp_build) |
|
|
max_len = len(temp_build) |
|
|
|
|
|
else: |
|
|
|
|
|
temp_return.append(temp_build) |
|
|
temp_build = word |
|
|
temp_build = word |
|
|
if len(temp_build) > 0: |
|
|
if len(temp_build) > 0: |
|
|
temp_return.append(temp_return) |
|
|
|
|
|
|
|
|
temp_return.append(temp_build) |
|
|
return temp_return, max_len |
|
|
return temp_return, max_len |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -69,4 +78,4 @@ def print_roo(): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
if __name__ == '__main__': |
|
|
main() |
|
|
|
|
|
|
|
|
main() |