forked from itsLuisa/SHAPELURN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PictureLevel.py
51 lines (36 loc) · 1.54 KB
/
PictureLevel.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from BlockPictureGenerator import *
"""
Allows to create a picture object as specified in BlockPictureGenerator with parameters based on the
current level and the current session
"""
def setPicParameters(level, i_picture, session_name, sec_ver=False):
"""
creates a Picture object where the number of shown blocks is based on the current level
returns the picture object after storing it in the subfolder session_name and giving it a unique file name
:param level: numer (int) of the current level
:param i_picture: number (int) of the current picture in the current level
:param session_name: name of the current session
:param sec_ver: whether the second version for level 2 with more blocks should be used
:return: the Picture Object
"""
file_name = session_name + "_L" + str(level) + "_" + str(i_picture)
path_pict = "./" + session_name + "/" + file_name
if level == 1:
complexity = (3,4)
elif level == 2:
if sec_ver:
complexity = (3,6)
else:
complexity = (3,4)
elif level == 3:
complexity = (4, 6)
elif level == 4:
complexity = (5, 8)
else:
complexity = (5, 8)
current_picture = Picture(complexity, path_pict)
return current_picture
if __name__=="__main__":
# for demonstrattion (only works if there exits a folder with name pictures in the source directory)
test_picture = setPicParameters(1, 1, "pictures")
test_picture.draw()