Commit 5270fd26 authored by Bastien Terrier's avatar Bastien Terrier
Browse files

V1 : monoline sentence with a, b, c, d and e

parent df6c8327
......@@ -23,3 +23,43 @@ alphabet['B'] = [
[1, 0, 0, 1],
[1, 1, 1, 0]
]
alphabet['C'] = [
[0, 1, 1, 1],
[1, 0, 0, 0],
[1, 0, 0, 0],
[1, 0, 0, 0],
[0, 1, 1, 1]
]
alphabet['D'] = [
[1, 1, 1, 0],
[1, 0, 0, 1],
[1, 0, 0, 1],
[1, 0, 0, 1],
[1, 1, 1, 0]
]
alphabet['E'] = [
[1, 1, 1, 1],
[1, 0, 0, 0],
[1, 1, 1, 0],
[1, 1, 1, 0],
[1, 1, 1, 1]
]
alphabet[''] = [
[],
[],
[],
[],
[]
]
# alphabet[''] = [
# [],
# [],
# [],
# [],
# []
# ]
......@@ -3,18 +3,36 @@ from resources import * #import resources
def initFile(f_dataStream, sentence):
f_dataStream.write("#!/bin/bash")
f_dataStream.write("\n\n#Powered by Bastien T")
f_dataStream.write("\n#Sentence : {}".format(sentence))
f_dataStream.write("\n\n#Powered by Bastien T\n")
f_dataStream.write("\n#Sentence : {}\n".format(sentence))
##############################
def displayCharacter(f_dataStream, char):
f_dataStream.write("#Character {}\n".format(char))
global global_x_pos
local_y_pos = global_y_pos
def displayCharacter(char):
print char, "\n"
# print alphabet[char]
for r in alphabet[char]:
print("[")
i_cptColum = 0
local_x_pos = global_x_pos
for c in r:
print(c)
#display to screen
print("]\n")
#add command to file at good position
if c == 1:
f_dataStream.write("{}{}+{} & \n".format(s_xeyes_command, local_x_pos, local_y_pos))
i_cptColum += 1
local_x_pos = local_x_pos - i_xeyes_size
local_y_pos = local_y_pos + i_xeyes_size
global_x_pos = global_x_pos - (i_cptColum+1)*i_xeyes_size #+1 for space beetween characters
##############################
def displaySentence(sentence):
with open(s_filename, 'w') as f_dataStream:
......@@ -25,4 +43,4 @@ def displaySentence(sentence):
if ord(char) < ord('A') or ord(char) > ord('Z') :
print("Error, not a character")
else:
displayCharacter(char)
displayCharacter(f_dataStream, char)
s_filename = "xeyes_sentences.sh"
s_filename = "../xeyes_sentences.sh"
i_xeyes_size = 25
s_xeyes_command = "xeyes -geometry {0}x{0}-".format(i_xeyes_size)
global_x_pos = 1000
global_y_pos = 300
local_x_pos = 0
local_y_pos = 0
#!/bin/bash
#Powered by Bastien T
#Sentence : AABBA
\ No newline at end of file
pip install screeninfo => screen size
#!/bin/bash
#Powered by Bastien T
#Sentence : ABCDE
#Character A
xeyes -geometry 25x25-975+300 &
xeyes -geometry 25x25-950+300 &
xeyes -geometry 25x25-1000+325 &
xeyes -geometry 25x25-925+325 &
xeyes -geometry 25x25-1000+350 &
xeyes -geometry 25x25-975+350 &
xeyes -geometry 25x25-950+350 &
xeyes -geometry 25x25-925+350 &
xeyes -geometry 25x25-1000+375 &
xeyes -geometry 25x25-925+375 &
xeyes -geometry 25x25-1000+400 &
xeyes -geometry 25x25-925+400 &
#Character B
xeyes -geometry 25x25-875+300 &
xeyes -geometry 25x25-850+300 &
xeyes -geometry 25x25-825+300 &
xeyes -geometry 25x25-875+325 &
xeyes -geometry 25x25-800+325 &
xeyes -geometry 25x25-875+350 &
xeyes -geometry 25x25-850+350 &
xeyes -geometry 25x25-825+350 &
xeyes -geometry 25x25-875+375 &
xeyes -geometry 25x25-800+375 &
xeyes -geometry 25x25-875+400 &
xeyes -geometry 25x25-850+400 &
xeyes -geometry 25x25-825+400 &
#Character C
xeyes -geometry 25x25-725+300 &
xeyes -geometry 25x25-700+300 &
xeyes -geometry 25x25-675+300 &
xeyes -geometry 25x25-750+325 &
xeyes -geometry 25x25-750+350 &
xeyes -geometry 25x25-750+375 &
xeyes -geometry 25x25-725+400 &
xeyes -geometry 25x25-700+400 &
xeyes -geometry 25x25-675+400 &
#Character D
xeyes -geometry 25x25-625+300 &
xeyes -geometry 25x25-600+300 &
xeyes -geometry 25x25-575+300 &
xeyes -geometry 25x25-625+325 &
xeyes -geometry 25x25-550+325 &
xeyes -geometry 25x25-625+350 &
xeyes -geometry 25x25-550+350 &
xeyes -geometry 25x25-625+375 &
xeyes -geometry 25x25-550+375 &
xeyes -geometry 25x25-625+400 &
xeyes -geometry 25x25-600+400 &
xeyes -geometry 25x25-575+400 &
#Character E
xeyes -geometry 25x25-500+300 &
xeyes -geometry 25x25-475+300 &
xeyes -geometry 25x25-450+300 &
xeyes -geometry 25x25-425+300 &
xeyes -geometry 25x25-500+325 &
xeyes -geometry 25x25-500+350 &
xeyes -geometry 25x25-475+350 &
xeyes -geometry 25x25-450+350 &
xeyes -geometry 25x25-500+375 &
xeyes -geometry 25x25-475+375 &
xeyes -geometry 25x25-450+375 &
xeyes -geometry 25x25-500+400 &
xeyes -geometry 25x25-475+400 &
xeyes -geometry 25x25-450+400 &
xeyes -geometry 25x25-425+400 &
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