Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bastien Terrier
xeyes_sentences
Commits
fc0e609f
Commit
fc0e609f
authored
May 24, 2018
by
Bastien Terrier
Browse files
Fix sentence allowed in args
parent
7344670d
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/alphabet.py
View file @
fc0e609f
...
...
@@ -223,3 +223,11 @@ alphabet['?'] = [
[
0
,
0
,
0
],
[
1
,
0
,
0
]
]
alphabet
[
' '
]
=
[
[
0
],
[
0
],
[
0
],
[
0
],
[
0
]
]
src/functions.py
View file @
fc0e609f
...
...
@@ -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
)
src/xeyes_sentences.py
View file @
fc0e609f
...
...
@@ -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
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment