Commit fc0e609f authored by Bastien Terrier's avatar Bastien Terrier
Browse files

Fix sentence allowed in args

parent 7344670d
......@@ -223,3 +223,11 @@ alphabet['?'] = [
[0, 0, 0],
[1, 0, 0]
]
alphabet[' '] = [
[0],
[0],
[0],
[0],
[0]
]
......@@ -40,7 +40,7 @@ def displaySentence(sentence):
initFile(f_dataStream, sentence)
for char in sentence:
if ord(char) < ord('A') or ord(char) > ord('Z') :
if ord(char) < ord('A') or ord(char) > ord('Z') or char != "?" or char != "!" or char != " " :
print("Error, not a character")
else:
displayCharacter(f_dataStream, char)
......@@ -5,11 +5,12 @@ import sys #args
#check syntax
if (len(sys.argv) < 2 or len(sys.argv) > 3):
print("Syntax error : python process.py sentence_to_display [size]")
print("Syntax error : python process.py \"sentence_to_display\" [size]")
exit(0)
#sentence to display
s_sentence = sys.argv[1];
s_sentence = s_sentence.upper()
s_sentence = s_sentence.replace('""', "")
displaySentence(s_sentence)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment