Browse Source

Finished roo say

pull/1/head
Jeffery Russell 7 years ago
parent
commit
a402ad46c8
1 changed files with 20 additions and 11 deletions
  1. +20
    -11
      src/roosay.py

+ 20
- 11
src/roosay.py View File

@ -22,38 +22,47 @@ def roo_say(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:
"""Print top"""
print(" " + "-" * (max_len + 2))
"Print top"
print(" " + "-" * (2 + max_len))
"print middle"
if len(print_list) == 1:
print("< " + print_list[0] + " >")
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:
print("Please pass in a message parameter")
def convert_to_list(message):
temp_build = ""
temp_return = []
max_len = 0
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
else:
temp_return.append(temp_build)
if max_len < len(temp_build):
max_len = len(temp_build)
else:
temp_return.append(temp_build)
temp_build = word
if len(temp_build) > 0:
temp_return.append(temp_return)
temp_return.append(temp_build)
return temp_return, max_len
@ -69,4 +78,4 @@ def print_roo():
if __name__ == '__main__':
main()
main()

Loading…
Cancel
Save