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
HURE GABRIELLE
qui-est-ce
Commits
d68bbcfa
Commit
d68bbcfa
authored
May 12, 2020
by
Gabrielle Huré
Browse files
debut travail avec Mickael sur verification personnages et questions
parent
0903dc60
Changes
1
Hide whitespace changes
Inline
Side-by-side
verification_mode_jeu_1.py
View file @
d68bbcfa
...
...
@@ -13,8 +13,8 @@ class VerificationModeJeu1:
self
.
liste_tags
=
liste_tags
self
.
nb_etage
=
self
.
__calcul_nb_etages
()
self
.
nb_questions_souhaitees
,
self
.
nb_personnages_souhaitees
=
self
.
__calcul_nb_questions_nb_personnages
()
self
.
objets_lus
=
self
.
__association_tags_lu_avec_bd
()
self
.
resultat_placement_tags
=
[
-
1
]
*
len
(
self
.
liste_tags
)
self
.
liste_objects_lus
,
self
.
liste_index_personnage
,
self
.
liste_index_questions
=
self
.
_association_tags_lu_avec_bd
()
def
__calcul_nb_etages
(
self
):
count
=
0
...
...
@@ -33,23 +33,30 @@ class VerificationModeJeu1:
nb_question
=
nb_question
+
2
**
i
return
nb_question
,
2
**
(
self
.
nb_etage
-
1
)
def
__association_tags_lu_avec_bd
(
self
):
def
_association_tags_lu_avec_bd
(
self
):
liste_index_personnage
=
[]
liste_index_questions
=
[]
liste_objects_lus
=
[]
for
capteur
in
self
.
liste_tags
:
for
index
,
capteur
in
enumerate
(
self
.
liste_tags
)
:
trouve
=
False
tag
=
capteur
.
tag_lu
print
(
tag
)
for
question
in
self
.
liste_questions
:
if
tag
==
question
.
tag
:
liste_objects_lus
.
append
(
question
)
liste_index_questions
.
append
(
index
)
trouve
=
True
break
if
trouve
==
False
:
if
not
trouve
:
for
personnage
in
self
.
liste_personnages
:
if
tag
==
personnage
.
tag
:
liste_objects_lus
.
append
(
personnage
)
liste_index_personnage
.
append
(
index
)
trouve
=
True
break
return
liste_objects_lus
if
not
trouve
:
liste_objects_lus
.
append
(
None
)
return
liste_objects_lus
,
liste_index_personnage
,
liste_index_questions
def
verification_questions
(
self
):
for
index
in
range
(
0
,
self
.
nb_questions_souhaitees
):
...
...
@@ -58,8 +65,25 @@ class VerificationModeJeu1:
else
:
self
.
resultat_placement_tags
[
index
]
=
0
def
validite_branche_recursif
(
self
,
index
):
if
index
in
self
.
liste_index_personnage
:
if
index
*
2
def
verification_personnages
(
self
):
for
index_personnage
in
self
.
liste_index_personnage
:
# aller voir tous les personnages
validite_branche
=
self
.
validite_branche_recursif
(
index_personnage
)
# dictionaire de validité des elements de la branche acrochée au personnage
"""
for index in range(self.nb_questions_souhaitees,
self.nb_questions_souhaitees + self.nb_personnages_souhaitees):
print("index perso", index, "-->", index + 1)
...
...
@@ -74,7 +98,7 @@ class VerificationModeJeu1:
# si objets sources ne sont pas des questions alors l'object n'est pas bien placé
if not isinstance(self.objets_lus[index_objet_supperieur], Question):
self.resultat_placement_tags[index] = 0
break
break
"""
""" continuer verification !!!"""
...
...
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