projects
/
mygpt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0c75fce
)
Fixed an asymmetry between top / bottom and between left / right.
author
Francois Fleuret
<francois@fleuret.org>
Mon, 25 Apr 2022 18:30:25 +0000
(20:30 +0200)
committer
Francois Fleuret
<francois@fleuret.org>
Mon, 25 Apr 2022 18:30:25 +0000
(20:30 +0200)
picoclvr.py
patch
|
blob
|
history
diff --git
a/picoclvr.py
b/picoclvr.py
index
6ddcf73
..
4906c65
100755
(executable)
--- a/
picoclvr.py
+++ b/
picoclvr.py
@@
-48,10
+48,10
@@
def generate(nb, height = 6, width = 8, max_nb_statements = 10):
for r, c in [ (k, color_names[shape_c[k]]) for k in range(nb) ]:
s += [ f'there is {c}' ]
for r, c in [ (k, color_names[shape_c[k]]) for k in range(nb) ]:
s += [ f'there is {c}' ]
- if shape_i[r] >= height - height/
4
: s += [ f'{c} bottom' ]
- if shape_i[r] < height/
4
: s += [ f'{c} top' ]
- if shape_j[r] >= width - width/
4
: s += [ f'{c} right' ]
- if shape_j[r] < width/
4
: s += [ f'{c} left' ]
+ if shape_i[r] >= height - height/
/3
: s += [ f'{c} bottom' ]
+ if shape_i[r] < height/
/3
: s += [ f'{c} top' ]
+ if shape_j[r] >= width - width/
/3
: s += [ f'{c} right' ]
+ if shape_j[r] < width/
/3
: s += [ f'{c} left' ]
for t, d in [ (k, color_names[shape_c[k]]) for k in range(nb) ]:
if shape_i[r] > shape_i[t]: s += [ f'{c} below {d}' ]
for t, d in [ (k, color_names[shape_c[k]]) for k in range(nb) ]:
if shape_i[r] > shape_i[t]: s += [ f'{c} below {d}' ]